Fractal Softworks Forum

Starsector => Bug Reports & Support => Topic started by: Dark.Revenant on June 19, 2019, 09:52:08 PM

Title: ShipAPI.getShipAI() CTD when used on shuttle
Post by: Dark.Revenant on June 19, 2019, 09:52:08 PM
This log should be self-explanatory:
Code
228287 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.ClassCastException: com.fs.starfarer.combat.ai.movement.maneuvers.TransferCommandAI cannot be cast to com.fs.starfarer.api.combat.ShipAIPlugin
java.lang.ClassCastException: com.fs.starfarer.combat.ai.movement.maneuvers.TransferCommandAI cannot be cast to com.fs.starfarer.api.combat.ShipAIPlugin
at com.fs.starfarer.combat.entities.Ship.getShipAI(Unknown Source)
at data.scripts.everyframe.II_TitanPlugin.advance(II_TitanPlugin.java:698)
at com.fs.starfarer.title.Object.float$Oo.o00000(Unknown Source)
at com.fs.starfarer.combat.oOOO.B.super(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advanceInner(Unknown Source)
at com.fs.starfarer.combat.CombatEngine.advance(Unknown Source)
at com.fs.starfarer.combat.CombatState.traverse(Unknown Source)
at com.fs.state.AppDriver.begin(Unknown Source)
at com.fs.starfarer.combat.CombatMain.main(Unknown Source)
at com.fs.starfarer.StarfarerLauncher$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Tagged as not a mod-related bug because of the high likelihood that some vanilla script might use this method and would, therefore, suffer from the issue.
Title: Re: ShipAPI.getShipAI() CTD when used on shuttle
Post by: Dark.Revenant on June 19, 2019, 11:13:47 PM
Also, completely unrelated bug:

MarketCMD:1937-1952:
Code
if (destroy) {
    DecivTracker.decivilize(market, true);
    text.addPara(market.getName() + " destroyed.");
} else {
    int prevSize = market.getSize();
    CoreImmigrationPluginImpl.reduceMarketSize(market);
    if (prevSize == market.getSize()) {
        text.addPara("All operations disrupted.");
    } else {
        text.addPara("All operations disrupted. Colony size reduced to %s.",
                Misc.getHighlightColor()
                , "" + market.getSize());
    }

    ListenerUtil.reportSaturationBombardmentFinished(dialog, market, temp);
}

This means if I write code that, say, reduces the CR of a superweapon ship with a -5000 fuel cost bonus stat when you bombard a planet, it'll work for a tactical bombardment or a non-destructive saturation bombardment.  But if the market is completely obliterated, that's free of charge!
Title: Re: ShipAPI.getShipAI() CTD when used on shuttle
Post by: Alex on June 20, 2019, 07:49:55 AM
Thank you! Will fix both of these up when I get back; out of town right now.
Title: Re: ShipAPI.getShipAI() CTD when used on shuttle
Post by: Alex on June 22, 2019, 09:14:10 AM
(Fixed both, thanks again.)