Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.95.1a is out! (12/10/21); Blog post: The Pilgrim's Path (07/19/22)

Author Topic: ShipAPI.getShipAI() CTD when used on shuttle  (Read 705 times)

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2740
    • View Profile
    • Sc2Mafia
    • Email
ShipAPI.getShipAI() CTD when used on shuttle
« 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.
« Last Edit: June 19, 2019, 09:54:23 PM by Dark.Revenant »
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2740
    • View Profile
    • Sc2Mafia
    • Email
Re: ShipAPI.getShipAI() CTD when used on shuttle
« Reply #1 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!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 20575
    • View Profile
Re: ShipAPI.getShipAI() CTD when used on shuttle
« Reply #2 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.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 20575
    • View Profile
Re: ShipAPI.getShipAI() CTD when used on shuttle
« Reply #3 on: June 22, 2019, 09:14:10 AM »

(Fixed both, thanks again.)
Logged