Fractal Softworks Forum

Starsector => Bug Reports & Support => Bug Reports & Support (modded) => Topic started by: Dark.Revenant on January 12, 2021, 02:04:44 AM

Title: Crash on mouseover caused by ships-with-modules in NPC fleets after savegame
Post by: Dark.Revenant on January 12, 2021, 02:04:44 AM
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:

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.
Title: Re: Crash on mouseover caused by ships-with-modules in NPC fleets after savegame
Post by: Alex on January 12, 2021, 09:48:12 AM
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.
Title: Re: Crash on mouseover caused by ships-with-modules in NPC fleets after savegame
Post by: Dark.Revenant on January 12, 2021, 11:16:47 AM
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.