Zwip-Zwap Zapony
Member
Disclaimer: Untested as of yet. I haven't finished setting up the states for this custom spring yet. But the source code doesn't lie (all the time), does it?
So while making a custom blue diagonal spring object for use in levels, I noticed something in the source code. In p_mobj.c, at around line 9223 (in the "next" branch of the game), it handles rotating a spring 22.5 degrees if the Ambush flag of the mobj is turned on...
But it handles it by checking if the mobj type is MT_YellowDiag or MT_RedDiag, not if the mobj has the MF_Spring flag, meaning custom diagonal springs will not be affected by the Ambush flag (unless some extreme wizardry is going on).
In my opinion, it'd make much more sense for it to check for the MF_Spring flag, since as far as I'm concerned, that's the main part of whether something is considered a spring or not, and it won't(?) do anything bad for purely vertical springs.
Code in question:
So while making a custom blue diagonal spring object for use in levels, I noticed something in the source code. In p_mobj.c, at around line 9223 (in the "next" branch of the game), it handles rotating a spring 22.5 degrees if the Ambush flag of the mobj is turned on...
But it handles it by checking if the mobj type is MT_YellowDiag or MT_RedDiag, not if the mobj has the MF_Spring flag, meaning custom diagonal springs will not be affected by the Ambush flag (unless some extreme wizardry is going on).
In my opinion, it'd make much more sense for it to check for the MF_Spring flag, since as far as I'm concerned, that's the main part of whether something is considered a spring or not, and it won't(?) do anything bad for purely vertical springs.
Code in question:
Code:
if (mthing->options & MTF_AMBUSH)
{
if (i == MT_YELLOWDIAG || i == MT_REDDIAG)
mobj->angle += ANGLE_22h;
Last edited by a moderator: