stratagus icon indicating copy to clipboard operation
stratagus copied to clipboard

Fix nullptr crash when moving camera after loading game

Open jhasse opened this issue 6 months ago • 2 comments

Hi there :)

I'm new to Stratagus and just found out about it via Wargus. First of all awesome work, thank you very much!

I was playing the W2 campaign and after loading a savegame I moved the camera to my base which lead to a crash. I noticed that this is reproducible so I run with GDB attached and looked at the backtrace: type->Construction is nullptr. Adding this check fixes the crash and I can continue playing just fine. I have no idea what this code does though :D

I can provide you with the savegame if you want.

jhasse avatar Aug 21 '25 20:08 jhasse

I have no idea what this code does though :D That is the part of the code which draw unit under fog of war.

Whereas it might fix the crash, I wonder if there are previous issue: Not sure if type->Construction might be nullptr or not.

I can provide you with the savegame if you want.

Repro would be fine indeed.

Jarod42 avatar Aug 21 '25 20:08 Jarod42

Here's the save game: crash.sav.gz

After loading move the camera to the bottom right.

jhasse avatar Aug 25 '25 17:08 jhasse