Use P_CheckMove

This commit is contained in:
James R 2022-02-01 03:40:26 -08:00
parent 518de0ce10
commit 9dfa153e74
2 changed files with 9 additions and 21 deletions

View file

@ -3333,10 +3333,8 @@ void A_SkullAttack(mobj_t *actor)
UINT32 oldflags = mobjinfo[MT_NULL].flags;
fixed_t oldradius = mobjinfo[MT_NULL].radius;
fixed_t oldheight = mobjinfo[MT_NULL].height;
mobj_t *check;
INT32 i, j;
static INT32 k;/* static for (at least) GCC 9.1 weirdness */
boolean allow;
angle_t testang = 0;
mobjinfo[MT_NULL].spawnstate = S_INVISIBLE;
@ -3355,15 +3353,12 @@ void A_SkullAttack(mobj_t *actor)
j = 9;
}
#define dostuff(q) check = P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_NULL);\
#define dostuff(q) \
testang = actor->angle + ((i+(q))*ANG10);\
allow = (P_TryMove(check,\
P_ReturnThrustX(check, testang, dist + 2*actor->radius),\
P_ReturnThrustY(check, testang, dist + 2*actor->radius),\
true));\
P_RemoveMobj(check);\
if (allow)\
break;
if (P_CheckMove(actor,\
P_ReturnThrustX(actor, testang, dist + 2*actor->radius),\
P_ReturnThrustY(actor, testang, dist + 2*actor->radius),\
true)) break;
if (P_RandomChance(FRACUNIT/2)) // port priority 2?
{

View file

@ -6281,18 +6281,11 @@ static void P_NightsTransferPoints(player_t *player, fixed_t xspeed, fixed_t rad
if (player->exiting)
return;
if (!P_CheckMove(player->mo,
player->mo->x + player->mo->momx,
player->mo->y + player->mo->momy, true))
{
boolean notallowed;
mobj_t *hack = P_SpawnMobjFromMobj(player->mo, 0, 0, 0, MT_NULL);
hack->flags = MF_NOGRAVITY;
hack->radius = player->mo->radius;
hack->height = player->mo->height;
hack->z = player->mo->z;
P_SetThingPosition(hack);
notallowed = (!(P_TryMove(hack, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, true)));
P_RemoveMobj(hack);
if (notallowed)
return;
return;
}
{