Use P_CheckMove

(cherry picked from commit 9dfa153e7497403d874e980868b7aa6d15595286)
This commit is contained in:
James R 2022-02-01 03:40:26 -08:00
parent ba1b6bb253
commit 72342338b1

View file

@ -3141,10 +3141,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;
@ -3163,15 +3161,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?
{