Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Infinite loop when raiding for ship equipment and none is eligible.  (Read 491 times)

prav

  • Captain
  • ****
  • Posts: 389
    • View Profile

com.fs.starfarer.api.impl.campaign.graid.ShipWeaponsGroundRaidObjectivePluginImpl

If a faction does not know any eligible fighters (eg only high-tier while maxTier is 0) the game can enter an infinite loop at line 329, as fighterValue never decrements while the game tries to pick from an empty picker.

Code
while (fighterValue > 0) {
FighterWingSpecAPI fighter = fighterSubset.pick();
if (fighter != null) {...}
}
}
The other categories may have the same problem.

Repro steps: Delete all known fighters from tritachyon.faction, start a new campaign, and raid Culann for Ship Equipment.
« Last Edit: April 25, 2021, 06:24:58 AM by prav »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24114
    • View Profile
Re: Infinite loop when raiding for ship equipment and none is eligible.
« Reply #1 on: April 25, 2021, 10:40:58 AM »

Thank you, fixed this up!
Logged