// |
somthing |
is occupying it’s position? |
if |
(!P_CheckPosition (mobj, x, y) ) |
|
return; |
// no respwan |
//spawn a teleport fog at old spot
//because of removal of the body? mo = P_SpawnMobj (mobj->x,
mobj->y,
mobj->subsector->sector->floorheight , MT_TFOG); // initiate teleport sound
S_StartSound (mo, sfx_telept);
// spawn a teleport fog at the new spot ss = R_PointInSubsector (x,y);
mo = P_SpawnMobj (x, y, ss->sector->floorheight , MT_TFOG);
S_StartSound (mo, sfx_telept);
//spawn the new monster mthing = &mobj->spawnpoint;
//spawn it
if (mobj->info->flags & MF_SPAWNCEILING) z = ONCEILINGZ;
else
z = ONFLOORZ;
// inherit attributes from deceased one mo = P_SpawnMobj (x,y,z, mobj->type); mo->spawnpoint = mobj->spawnpoint; mo->angle = ANG45 * (mthing->angle/45);
if (mthing->options & MTF_AMBUSH) mo->flags |= MF_AMBUSH;
mo->reactiontime = 18;
// remove the old monster, P_RemoveMobj (mobj);
}
//
// P_MobjThinker
//
void P_MobjThinker (mobj_t* mobj)
{
// momentum movement if (mobj->momx
||mobj->momy
||(mobj->flags&MF_SKULLFLY) )
{
P_XYMovement (mobj);
// FIXME: decent NOP/NULL/Nil function pointer please. if (mobj->thinker.function.acv == (actionf_v) (-1))
return; |
// mobj was removed |
} |
|
if ( (mobj->z != mobj->floorz) |
|
|| mobj->momz ) |
|
{ |
|
P_ZMovement (mobj); |
|
// FIXME: decent NOP/NULL/Nil function pointer please.