correctly use P_UnsetThingPosition, P_SetThingPosition + P_DelSeclist around MF_NOBLOCKMAP addition in the TNT explosion code

This commit is contained in:
Monster Iestyn 2019-06-30 22:22:12 +01:00
parent 658a3f2eea
commit 726b0f6c83
1 changed files with 14 additions and 1 deletions

View File

@ -13015,7 +13015,14 @@ static boolean PIT_TNTExplode(mobj_t *nearby)
nearby->momx = FixedMul(FixedDiv(dx, dm), explodethrust);
nearby->momy = FixedMul(FixedDiv(dy, dm), explodethrust);
nearby->momz = FixedMul(FixedDiv(dz, dm), explodethrust);
P_UnsetThingPosition(nearby);
if (sector_list)
{
P_DelSeclist(sector_list);
sector_list = NULL;
}
nearby->flags = MF_NOBLOCKMAP|MF_MISSILE;
P_SetThingPosition(nearby);
P_SetMobjState(nearby, nearby->info->missilestate);
}
}
@ -13059,8 +13066,14 @@ void A_TNTExplode(mobj_t *actor)
if (LUA_CallAction("A_TNTExplode", actor))
return;
#endif
P_UnsetThingPosition(actor);
if (sector_list)
{
P_DelSeclist(sector_list);
sector_list = NULL;
}
actor->flags = MF_NOCLIP|MF_NOGRAVITY|MF_NOBLOCKMAP;
P_SetThingPosition(actor);
actor->flags2 = MF2_EXPLOSION;
if (actor->info->deathsound)
S_StartSound(actor, actor->info->deathsound);