Fix nullptr crash when moving camera after loading game
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.
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.