Closed bratkartoff closed 2 years ago
Is there an open menu which is using the reloaded definition as icon?
Yes, there is
var tmp = CreateObject(CICN);
...
AddMenuItem(GetName(point),"SelectFlagpole2",GetID(),crew,point->GetProcess(),ObjectNumber(point),"",4,tmp)
^
Ok, that was vital information.
In this specific case the problem seems to come from here: https://github.com/legacyclonk/LegacyClonk/blob/master/src/C4Object.cpp#L3099-L3103
In simple cases the icon simply references the graphics from the object definition. The referenced graphics are then deleted when the definition is reloaded and in the next frame the invalid graphics are tried to be used for rendering.
The question is how to fix it reasonably. I first have to analyze further what ReloadDef does …
I changed this definition
to this one
called
ReloadDef
and got this