mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-22 20:41:25 +00:00
Use P_CheckMove
This commit is contained in:
parent
518de0ce10
commit
9dfa153e74
2 changed files with 9 additions and 21 deletions
|
@ -3333,10 +3333,8 @@ void A_SkullAttack(mobj_t *actor)
|
||||||
UINT32 oldflags = mobjinfo[MT_NULL].flags;
|
UINT32 oldflags = mobjinfo[MT_NULL].flags;
|
||||||
fixed_t oldradius = mobjinfo[MT_NULL].radius;
|
fixed_t oldradius = mobjinfo[MT_NULL].radius;
|
||||||
fixed_t oldheight = mobjinfo[MT_NULL].height;
|
fixed_t oldheight = mobjinfo[MT_NULL].height;
|
||||||
mobj_t *check;
|
|
||||||
INT32 i, j;
|
INT32 i, j;
|
||||||
static INT32 k;/* static for (at least) GCC 9.1 weirdness */
|
static INT32 k;/* static for (at least) GCC 9.1 weirdness */
|
||||||
boolean allow;
|
|
||||||
angle_t testang = 0;
|
angle_t testang = 0;
|
||||||
|
|
||||||
mobjinfo[MT_NULL].spawnstate = S_INVISIBLE;
|
mobjinfo[MT_NULL].spawnstate = S_INVISIBLE;
|
||||||
|
@ -3355,15 +3353,12 @@ void A_SkullAttack(mobj_t *actor)
|
||||||
j = 9;
|
j = 9;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define dostuff(q) check = P_SpawnMobjFromMobj(actor, 0, 0, 0, MT_NULL);\
|
#define dostuff(q) \
|
||||||
testang = actor->angle + ((i+(q))*ANG10);\
|
testang = actor->angle + ((i+(q))*ANG10);\
|
||||||
allow = (P_TryMove(check,\
|
if (P_CheckMove(actor,\
|
||||||
P_ReturnThrustX(check, testang, dist + 2*actor->radius),\
|
P_ReturnThrustX(actor, testang, dist + 2*actor->radius),\
|
||||||
P_ReturnThrustY(check, testang, dist + 2*actor->radius),\
|
P_ReturnThrustY(actor, testang, dist + 2*actor->radius),\
|
||||||
true));\
|
true)) break;
|
||||||
P_RemoveMobj(check);\
|
|
||||||
if (allow)\
|
|
||||||
break;
|
|
||||||
|
|
||||||
if (P_RandomChance(FRACUNIT/2)) // port priority 2?
|
if (P_RandomChance(FRACUNIT/2)) // port priority 2?
|
||||||
{
|
{
|
||||||
|
|
15
src/p_user.c
15
src/p_user.c
|
@ -6281,18 +6281,11 @@ static void P_NightsTransferPoints(player_t *player, fixed_t xspeed, fixed_t rad
|
||||||
if (player->exiting)
|
if (player->exiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!P_CheckMove(player->mo,
|
||||||
|
player->mo->x + player->mo->momx,
|
||||||
|
player->mo->y + player->mo->momy, true))
|
||||||
{
|
{
|
||||||
boolean notallowed;
|
return;
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue