Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Crash on mouseover caused by ships-with-modules in NPC fleets after savegame  (Read 1268 times)

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia

Code
105881 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain  - java.lang.NullPointerException
java.lang.NullPointerException
at com.fs.starfarer.ui.A.new.super(Unknown Source)
at com.fs.starfarer.ui.A.new.<init>(Unknown Source)
at com.fs.starfarer.campaign.ui.String.<init>(Unknown Source)
at com.fs.starfarer.ui.P.super(Unknown Source)
at com.fs.starfarer.campaign.ui.oOOo.addIconFor(Unknown Source)
at com.fs.starfarer.campaign.ui.oOOo.<init>(Unknown Source)
at com.fs.starfarer.ui.impl.StandardTooltipV2$9.public.float(Unknown Source)
at com.fs.starfarer.ui.impl.StandardTooltipV2$9.beforeShown(Unknown Source)
at com.fs.starfarer.campaign.C.o00000(Unknown Source)
at com.fs.starfarer.campaign.CampaignEngine.advance(Unknown Source)
at com.fs.starfarer.campaign.CampaignState.advance(Unknown Source)
at com.fs.starfarer.BaseGameState.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)

This crash is triggered when the player mouses over an NPC fleet when the following combination of conditions apply:
  • A ship-with-modules is present in the fleet
  • That ship-with-modules has a cloned or otherwise custom variant with the REFIT variant source (i.e. it's permanently inflated)
  • The game was previously saved whilst the fleet existed in the game world

There does not appear to be a workaround with regards to cloning or otherwise changing the IDs of the module variants.  I have not tried resetting the module variants to be stock variants, but that would defeat the purpose of the feature I was adding.

I can't begin to imagine what the root cause of this crash is, and I'm out of ideas to fix it on my end.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 23988
    • View Profile

Hmm - tried this on a fleet near the player:
Code
FleetMemberAPI member = fleet.getFleetData().addFleetMember("station_small_Standard");
ShipVariantAPI variant = member.getVariant();
variant = variant.clone();
variant.setSource(VariantSource.REFIT);
member.setVariant(variant, false, false);

And then saving the game. Both before and after loading (and after re-launching the game and loading), no crash when mousing over the fleet. There's a solid chance that it *would* have crashed and this is just fixed on my end, though; I remember there being some fixes for crashes related to rendering a fleet member icon for a ship-with-modules.
Logged

Dark.Revenant

  • Admiral
  • *****
  • Posts: 2806
    • View Profile
    • Sc2Mafia

Hmm - tried this on a fleet near the player:
Code
FleetMemberAPI member = fleet.getFleetData().addFleetMember("station_small_Standard");
ShipVariantAPI variant = member.getVariant();
variant = variant.clone();
variant.setSource(VariantSource.REFIT);
member.setVariant(variant, false, false);

And then saving the game. Both before and after loading (and after re-launching the game and loading), no crash when mousing over the fleet. There's a solid chance that it *would* have crashed and this is just fixed on my end, though; I remember there being some fixes for crashes related to rendering a fleet member icon for a ship-with-modules.

That's good to know.  I'll have to remember to re-test once the update comes out.
Logged