Page 1 of 1

override bool Morph crashes

Posted: Mon Nov 04, 2024 11:50 am
by SPZ1
For some reason, adding this code to my DoomPlayer caused it to crash.

https://1drv.ms/u/c/f562b31d53640a9e/Ef ... A?e=HffrDg

Code: Select all

override bool Morph(Actor activator, class<PlayerPawn> playerclass, class<MorphedMonster> monsterclass, int duration, int style, class<Actor> morphflash, class<Actor>unmorphflash){
		
	super.Morph(activator, playerclass, monsterclass, duration, style, morphflash, unmorphflash);
}

Re: override bool Morph crashes

Posted: Mon Nov 04, 2024 1:45 pm
by Rachael
Yet another bug with the file system, I can't fix this one because I am not familiar with what Graf was doing with the new system or how it works.

In the future it really does help if you post minimal examples that can be easily run without requiring assembly - that is infinitely more useful than just posting code snippets, and even the crash logs themselves as well.

Re: override bool Morph crashes

Posted: Mon Nov 04, 2024 9:59 pm
by Boondorl
It's because you're missing the return value. This is a currently known bug with the ZScript parser where for some reason functions that expect a return that don't have one simply crash instead of throwing an error. The likely cause is a missing null check