A fix for the thing where you can get stuck inside a Mario block that has a monitor in it.

This commit is contained in:
toasterbabe 2016-10-12 22:06:40 +01:00
parent 71b7db4e0d
commit dff9209bd2

View file

@ -1782,8 +1782,8 @@ static mobj_t *SearchMarioNode(msecnode_t *node)
break; break;
} }
// Ignore popped monitors, too. // Ignore popped monitors, too.
if (node->m_thing->flags & MF_MONITOR if (node->m_thing->health == 0 // this only really applies for monitors
&& node->m_thing->threshold == 68) || (!(node->m_thing->flags & MF_MONITOR) && (mobjinfo[node->m_thing->type].flags & MF_MONITOR))) // gold monitor support
continue; continue;
// Okay, we found something valid. // Okay, we found something valid.
if (!thing // take either the first thing if (!thing // take either the first thing
@ -3156,15 +3156,15 @@ INT32 EV_MarioBlock(sector_t *sec, sector_t *roversector, fixed_t topheight, mob
S_StartSound(puncher, sfx_mario9); // Puncher is "close enough" S_StartSound(puncher, sfx_mario9); // Puncher is "close enough"
} }
if (itsamonitor) if (itsamonitor && thing)
{ {
P_UnsetThingPosition(tmthing); P_UnsetThingPosition(thing);
tmthing->x = oldx; thing->x = oldx;
tmthing->y = oldy; thing->y = oldy;
tmthing->z = oldz; thing->z = oldz;
tmthing->momx = 1; thing->momx = 1;
tmthing->momy = 1; thing->momy = 1;
P_SetThingPosition(tmthing); P_SetThingPosition(thing);
} }
} }
else else