Custom Springs + Ambush = Not rotated 22.5*

Status
Not open for further replies.
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:
Code:
if (mthing->options & MTF_AMBUSH)
{
    if (i == MT_YELLOWDIAG || i == MT_REDDIAG)
        mobj->angle += ANGLE_22h;
 
Last edited by a moderator:
This isn't really a bug more than just a hardcoded feature for particular types of springs. If you REALLY wanted it for custom springs, I'd suggest you manually adjust the angles via Lua.
 
This isn't really a bug more than just a hardcoded feature for particular types of springs.
Yes, the particular type of springs being the diagonal kind. And one can make custom diagonal springs, which will then not be affected in the same way as vanilla diagonal springs (even if utilizing the same object set-up/properties and even the vanilla states of a diagonal spring, due to the object's name not matching up). While yes, that's not exactly a bug, if it can't be considered a bug, what can?
 
...actual bugs?

I'd actually advocate for this functionality to be removed from the default stuff, honestly. Diagonal ring trails can't do it since that flag's mapped to float, so why bother with this?
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top