[CW3] Map editor resize map crash when a clipped CRPL core is deleted

Started by Grabz, March 25, 2018, 10:04:59 AM

Previous topic - Next topic

Grabz

Reproducibility steps:

Download the map from the attachment and open it in the editor.

Take note of the emitter in top right of the map:


Now resize map and change new width from 96 to 78. Upon hitting apply, the game will delete that emitter, then the editor will crash. Saving will corrupt the map and load will get stuck on the loading screen.

Crash log:

IndexOutOfRangeException: Array index is out of range.
  at Terrain.PostProcessTerrain () [0x00000] in <filename unknown>:0

  at CrplCore.ProcessCommands (Boolean start, Boolean final, Boolean gameLoaded, Boolean paused) [0x00000] in <filename unknown>:0

  at CrplCore.GameUpdate (Boolean final, Boolean paused) [0x00000] in <filename unknown>:0

  at UnitManager.DestroyUnit (Boolean explosionEffect, Single scale, Boolean manual) [0x00000] in <filename unknown>:0

  at CRPLTowerManager.DestroyUnit (Boolean explosionEffect, Single scale, Boolean manual) [0x00000] in <filename unknown>:0

  at ResizeMapManager.DoResizeMapWindow (Int32 windowID) [0x00000] in <filename unknown>:0

  at GUIUtils.MyWindow (Rect rect, UnityEngine.WindowFunction func, System.String title, UnityEngine.GUIStyle style) [0x00000] in <filename unknown>:0

  at ResizeMapManager.OnGUI () [0x00000] in <filename unknown>:0

  at TerraformCommandCenter.OnGUI () [0x00000] in <filename unknown>:0

  at CommandCenter.OnGUI () [0x00000] in <filename unknown>:0

(Filename:  Line: -1)


Crash log when mousing over the bottom of the map after hitting apply:
I don't know why this happens, for some reason resizing width truncates the height internally when the game crashes?

IndexOutOfRangeException: Array index is out of range.
  at TerraformCommandCenter.UpdateCrossHairs () [0x00000] in <filename unknown>:0

  at TerraformCommandCenter.OnTerrainMouseMoveGameSpaceCell (Vector2 gameSpaceCoords) [0x00000] in <filename unknown>:0

  at TerraformCommandCenter.HandleTerrainInteraction () [0x00000] in <filename unknown>:0

  at TerraformCommandCenter.HandleInteraction () [0x00000] in <filename unknown>:0

  at CommandCenter.HandleInteraction () [0x00000] in <filename unknown>:0

  at GameSpace.HandleKeyMouseInput () [0x00000] in <filename unknown>:0

  at GameSpace.Update () [0x00000] in <filename unknown>:0

(Filename:  Line: -1)


Removing the cores from top right will have the resize procedure work as normal.