For some reason, calling SetStateLabel from a static function crashes GZDoom on startup.Vaecrius wrote:Why can I not call SetStateLabel, FindState, etc. from a static function?
This will always hard crash on startup:Code: Select all
struct HDMobStatic play{ static void HDA_Chase(actor self,actor movetarget=null){ if(!self.target||self.target.health<random(-5,1)){ self.target=null; self.setstatelabel("spawn"); return; } /* vector3 totarget=self.target.pos-self.pos; ... */ } }
Here's a better example:
Code: Select all
version "2.4"
struct SSLCrashTest play {
static void SSLCrashTestFunc (Actor act) {
act.SetStateLabel ("Spawn");
}
}
Apparently if you change it from a struct to an actor it doesn't crash.
Even if you're not supposed to do that, GZDoom shouldn't crash.