View Issue Details
ID | Project | Category | Date Submitted | Last Update | |
---|---|---|---|---|---|
0021564 | AI War 2 | Crash/Exception | Sep 3, 2019 10:29 pm | Sep 5, 2019 12:29 pm | |
Reporter | BadgerBadger | Assigned To | Chris_McElligottPark | ||
Status | resolved | Resolution | fixed | ||
Product Version | 0.886 Zombie Homebodies | ||||
Fixed in Version | 0.887 Ending Scenes | ||||
Summary | 0021564: Problems with reconquest seeding | ||||
Description | 9/3/2019 8:18:03 PM Hit debugCode 30 exception System.Exception: guardPostBag is null for Brand at Arcen.AIW2.External.AIDefensePlacer_Default.StartReconquestDefenseSeeding (Arcen.AIW2.Core.ArcenSimContext Context, Arcen.AIW2.Core.Planet ThisPlanet, Arcen.AIW2.Core.Faction faction) [0x000f4] in <5880ab743172483c94406afdb82c323d>:0 in StartReconquestDefenseSeeding 9/3/2019 8:25:28 PM The code is debugCode = 30; PlanetFaction pFaction = ThisPlanet.GetPlanetFactionForFaction( faction ); ArcenRandomDrawBag<GameEntityTypeData> guardPostBag = null; if ( pFaction.ShipGroup_GuardPosts != null ) guardPostBag = pFaction.ShipGroup_GuardPosts.DrawBag; ... if ( guardPostBag == null ) { //Having an empty guardPostBag is okay, but I don't believe it should be null //if it is okay to be null then we can just change the below //if ( guardPostBag.GetHasItems() ) to include a check for guardPostBag != null throw new Exception("guardPostBag is null for " + ThisPlanet.Name); } My understanding is that the guardPostBag is set in #region DefinePlanetFactionDefenseTypesIfNeeded public static void DefinePlanetFactionDefenseTypesIfNeeded( ArcenSimContext Context, Planet ThisPlanet, Faction faction ) ... if ( pFaction.ShipGroup_GuardPosts == null ) { if ( ThisPlanet.PopulationType == PlanetPopulationType.AIHomeworld ) pFaction.ShipGroup_GuardPosts = reinforcementBudgetItem.DireGuardPostAIShipGroup.DrawBag.PickRandomItemAndReplace( Context.RandomToUse ); if ( pFaction.ShipGroup_GuardPosts == null || !pFaction.ShipGroup_GuardPosts.DrawBag.GetHasItems() ) pFaction.ShipGroup_GuardPosts = reinforcementBudgetItem.GuardPostAIShipGroup.DrawBag.PickRandomItemAndReplace( Context.RandomToUse ); } | ||||
Tags | No tags attached. | ||||
|
Thanks! * Some extra code has been put in place to make it so that if for some reason during reconquest of a planet there are no guard post types already assigned to the planet, the AI can now figure out AI types. ** Most likely the reason this was happening before is that it wasn't an AI planet at the start of the game, and so it belatedly needed to find the guard post and/or guardian types. ** At the moment this is completely untested, but it should work. |
Date Modified | Username | Field | Change |
---|---|---|---|
Sep 3, 2019 10:29 pm | BadgerBadger | New Issue | |
Sep 5, 2019 12:29 pm | Chris_McElligottPark | Assigned To | => Chris_McElligottPark |
Sep 5, 2019 12:29 pm | Chris_McElligottPark | Status | new => resolved |
Sep 5, 2019 12:29 pm | Chris_McElligottPark | Resolution | open => fixed |
Sep 5, 2019 12:29 pm | Chris_McElligottPark | Fixed in Version | => 0.887 Ending Scenes |
Sep 5, 2019 12:29 pm | Chris_McElligottPark | Note Added: 0052859 |