TeamStarDrive / StarDrive

StarDrive BlackBox Mod
MIT License
26 stars 4 forks source link

ThrowIndexOutOfBounds Exception in PickTileForTerraformer #186

Closed TyanRL closed 2 months ago

TyanRL commented 2 months ago

Save files attached. Mars__1.50.15048_Combined_Arms-v8.6c_Dauntless Corporation, Star Date 1560.2.zip

(!) Exception: Program.CurrentDomain_UnhandledException

Index [0] out of range(0) Array Version = 1.50.15048 main/commit Mod = Combined Arms ModVersion = v8.6c Language = Russian StarDate = 1560.5 Ships = 4935 Planets = 308 Memory = 508748 XnaMemory = 183348 Thread = Universe.SimThread ThreadId = 25 Thread #25 Universe.SimThread StackTrace: at SDUtils.Array1.[Mars__1.50.15048_Combined_Arms-v8.6c_Dauntless Corporation, Star Date 1560.2.zip](https://github.com/user-attachments/files/16642343/Mars__1.50.15048_Combined_Arms-v8.6c_Dauntless.Corporation.Star.Date.1560.2.zip)(Int32 index, Int32 count) in ts\BlackBox\SDUtils\Array.cs:line 175 at SDUtils.Array1.get_Item(Int32 index) in ts\BlackBox\SDUtils\Array.cs:line 184 at Utils.RandomBase.Item[T](IReadOnlyList`1 items) in Utils\RandomBase.cs:line 116 at Planet.PickTileForTerraformer(PlanetGridSquare[] unHabitableTiles) in Universe\SolarBodies\Planet\Planet_EvaluateBuildings.cs:line 748 at Planet.TryBuildTerraformers(Single budget) in Universe\SolarBodies\Planet\Planet_EvaluateBuildings.cs:line 722 at Planet.DoGoverning() in Universe\SolarBodies\Planet\Planet_Govern.cs:line 39 at Empire.GovernPlanets() in Empire.cs:line 1420 at Empire.Update(UniverseState us, FixedSimTime timeStep) in Empire.cs:line 1030 at UniverseScreen.UpdateEmpires(FixedSimTime timeStep) in Universe\UniverseScreen\UniverseScreen.UpdateGame.cs:line 329 at UniverseScreen.ProcessTurnEmpires(FixedSimTime timeStep) in Universe\UniverseScreen\UniverseScreen.UpdateGame.cs:line 284 at UniverseScreen.SingleSimulationStep(FixedSimTime timeStep) in Universe\UniverseScreen\UniverseScreen.UpdateGame.cs:line 198 at UniverseScreen.ProcessSimulationTurns() in Universe\UniverseScreen\UniverseScreen.UpdateGame.cs:line 156 at UniverseScreen.UniverseSimulationLoop() in Universe\UniverseScreen\UniverseScreen.UpdateGame.cs:line 89 at UniverseScreen.UniverseSimMonitored() in Universe\UniverseScreen\UniverseScreen.UpdateGame.cs:line 57 at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart()

Thread #1 Main Thread StackTrace: at XNA.Input.WindowMessageHooker.Hook.WndProc(IntPtr msgWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) at XNA.NativeMethods.PeekMessage(Message& msg, IntPtr hWnd, UInt32 messageFilterMin, UInt32 messageFilterMax, UInt32 flags) at XNA.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e) in ts\BlackBox\XNA.Game\WindowsGameHost.cs:line 64 at XNA.WindowsGameHost.Run() in ts\BlackBox\XNA.Game\WindowsGameHost.cs:line 87 at XNA.Game.Run() in ts\BlackBox\XNA.Game\Game.cs:line 157 at Program.Main(String[] args) in GameScreens\Program.cs:line 217

gkapulis commented 2 months ago

Fixed in upcoming 1.50.15049. Thanks,

TyanRL commented 2 months ago

Thanks