Fixed type & MF_NOTHINK

Status
Not open for further replies.

Turtle Man

aka zturtleman
In P_SpawnMobj in src/p_mobj.c:
Code:
    if (!(mobj->type & MF_NOTHINK))
    {
        mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker;
        P_AddThinker(&mobj->thinker);
    }
It seems mobj->flags should be used here, not mobj->type.
 
Last edited by a moderator:
Code:
SRB2MOB: Fixed mischeck in P_SpawnMobj()
Author: Zack Middleton

Index: src/p_mobj.c
===================================================================
--- src/p_mobj.c    (revision 6906)
+++ src/p_mobj.c    (working copy)
@@ -6471,7 +6471,7 @@
     else
         mobj->z = z;
 
-    if (!(mobj->type & MF_NOTHINK))
+    if (!(mobj->flags & MF_NOTHINK))
     {
         mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker;
         P_AddThinker(&mobj->thinker);
I was unable to commit it, I do not have a username/password to use.
 
Code:
SRB2MOB: Fixed mischeck in P_SpawnMobj()
Author: Zack Middleton

Index: src/p_mobj.c
===================================================================
--- src/p_mobj.c    (revision 6906)
+++ src/p_mobj.c    (working copy)
@@ -6471,7 +6471,7 @@
     else
         mobj->z = z;
 
-    if (!(mobj->type & MF_NOTHINK))
+    if (!(mobj->flags & MF_NOTHINK))
     {
         mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker;
         P_AddThinker(&mobj->thinker);
I was unable to commit it, I do not have a username/password to use.

You can commit anonymously to MOB.
 
I just tested the fix and it seems that some objects actually stop working with this fix, thinkers should be added for all objects even if they have MF_NOTHINK

So just remove the entire
if (!(mobj->type & MF_NOTHINK))
 
Those objects should have the MF_NOTHINK flag removed in that case, or just fixed up so that they don't require the thinker anyway.
 
Shouldn't MF_NOTHINK cause the thinker function to be P_MobjNullThinker() instead? I mean, you still want the object in the list...
 
Shouldn't MF_NOTHINK cause the thinker function to be P_MobjNullThinker() instead? I mean, you still want the object in the list...

There's a P_MobjNullThinker?

Anyway, if some objects stop working, I'm not sure it's because they don't have a thinker in the list at all, maybe they just don't work without P_MobjThinker, therefore having a stub thinker would have the same problem...
 
Last edited:
Status
Not open for further replies.

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

Back
Top