cleanup stuff a bit for unused gametypes

wish could just remove all of this but gotta keep it for compat reasons ig
This commit is contained in:
alufolie91 committed 2026-07-02 18:34:06 +02:00
1 parent 7a309bc0b8
commit e445669521
11 files changed
+106 -91

No files matched your search

+1 -1
View File
@@ -3449,7 +3449,7 @@ void CL_ClearPlayer(INT32 playernum)
if (players[playernum].mo)
{
// Don't leave a NiGHTS ghost!
if (UNLIKELY((players[playernum].pflags & PF_NIGHTSMODE) && players[playernum].mo->tracer))
if (nightsplayer(&players[playernum]) && players[playernum].mo->tracer)
P_RemoveMobj(players[playernum].mo->tracer);
P_RemoveMobj(players[playernum].mo);
}
+2 -2
View File
@@ -716,7 +716,7 @@ void G_WriteGhostTic(mobj_t *ghost, INT32 playernum)
if (!(demoflags & DF_GHOST))
return; // No ghost data to write.
if (ghost->player && ghost->player->pflags & PF_NIGHTSMODE && ghost->tracer)
if (ghost->player && nightsplayer(ghost->player) && ghost->tracer)
{
// We're talking about the NiGHTS thing, not the normal platforming thing!
ziptic |= GZT_NIGHTS;
@@ -979,7 +979,7 @@ void G_ConsGhostTic(INT32 playernum)
if (ziptic & GZT_NIGHTS)
{
if (!testmo || !testmo->player || !(testmo->player->pflags & PF_NIGHTSMODE) || !testmo->tracer)
if (!testmo || !testmo->player || !nightsplayer(testmo->player) || !testmo->tracer)
nightsfail = true;
else
testmo = testmo->tracer;
+4 -3
View File
@@ -228,10 +228,11 @@ void G_SaveGameData(boolean force);
void G_SaveGame(UINT32 slot);
#define G_GametypeHasTeams() (G_IsGameType(GT_TEAMMATCH) || G_IsGameType(GT_CTF))
#define G_RaceGametype() (G_IsGameType(GT_RACE))
#define G_BattleGametype() (G_IsGameType(GT_MATCH))
#define G_RaceGametype() (G_IsGameType(GT_RACE))
#define G_TagGametype() (G_IsGameType(GT_TAG) || G_IsGameType(GT_HIDEANDSEEK))
#define G_GametypeHasTeams() (UNLIKELY(G_IsGameType(GT_TEAMMATCH) || G_IsGameType(GT_CTF)))
#define G_TagGametype() (UNLIKELY(G_IsGameType(GT_TAG) || G_IsGameType(GT_HIDEANDSEEK)))
FUNCINLINE static ATTRINLINE boolean G_IsGameType(int type)
{
+3 -3
View File
@@ -766,7 +766,7 @@ boolean OP_FreezeObjectplace(void)
if (!objectplacing)
return false;
if ((maptol & TOL_NIGHTS) && (players[consoleplayer].pflags & PF_NIGHTSMODE))
if (nightsmode && nightsplayer(&players[consoleplayer]))
return false;
return true;
@@ -1049,7 +1049,7 @@ void Command_ObjectPlace_f(void)
{
objectplacing = true;
if ((players[0].pflags & PF_NIGHTSMODE))
if (nightsplayer(&players[0]))
return;
if (!COM_CheckParm("-silent"))
@@ -1120,7 +1120,7 @@ void Command_ObjectPlace_f(void)
// Don't touch the NiGHTS Objectplace stuff.
// ... or if the mo mysteriously vanished.
if (!players[0].mo || (players[0].pflags & PF_NIGHTSMODE))
if (!players[0].mo || nightsplayer(&players[0]))
return;
// If still in dummy state, get out of it.
+6 -5
View File
@@ -250,7 +250,8 @@ boolean P_Move(mobj_t *actor, fixed_t speed)
I_Assert(movedir < NUMDIRS);
tryx = actor->x + FixedMul(speed*xspeed[movedir], actor->scale);
if (UNLIKELY(twodlevel || actor->flags2 & MF2_TWOD))
if (twodmo(actor))
tryy = actor->y;
else
tryy = actor->y + FixedMul(speed*yspeed[movedir], actor->scale);
@@ -328,7 +329,7 @@ void P_NewChaseDir(mobj_t *actor)
else
d[1] = DI_NODIR;
if (UNLIKELY(twodlevel || actor->flags2 & MF2_TWOD))
if (twodmo(actor))
d[2] = DI_NODIR;
if (deltay < -FixedMul(10*FRACUNIT, actor->scale))
d[2] = DI_SOUTH;
@@ -2762,10 +2763,10 @@ void A_Invincibility(void *thing)
{
S_StopMusic();
if (UNLIKELY(mariomode))
if (mariomode)
G_GhostAddColor((INT32) (player - players), GHC_INVINCIBLE);
S_ChangeMusicInternal((UNLIKELY(mariomode)) ? "minvnc" : "invinc", false);
S_ChangeMusicInternal(mariomode ? "minvnc" : "invinc", false);
}
}
@@ -4359,7 +4360,7 @@ void A_MouseThink(void *thing)
|| (actor->eflags & MFE_VERTICALFLIP && actor->z + actor->height == actor->ceilingz))
&& !actor->reactiontime)
{
if (UNLIKELY(twodlevel || actor->flags2 & MF2_TWOD))
if (twodmo(actor))
{
if (P_RandomChance(FRACUNIT/2))
actor->angle += ANGLE_180;
+13 -13
View File
@@ -589,7 +589,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->momx = special->momy = special->momz = 0;
P_GivePlayerRings(player, 1);
if (UNLIKELY((maptol & TOL_NIGHTS) && special->type != MT_FLINGRING))
if (nightsmode && special->type != MT_FLINGRING)
P_DoNightsScore(player);
break;
@@ -601,7 +601,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->momx = special->momy = 0;
P_GivePlayerRings(player, 1);
if (UNLIKELY((maptol & TOL_NIGHTS) && special->type != MT_FLINGCOIN))
if (nightsmode && special->type != MT_FLINGCOIN)
P_DoNightsScore(player);
break;
case MT_BLUEBALL:
@@ -617,7 +617,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else
special->scalespeed = 4*FRACUNIT/5;
if (UNLIKELY(maptol & TOL_NIGHTS))
if (nightsmode)
P_DoNightsScore(player);
break;
case MT_AUTOPICKUP:
@@ -831,7 +831,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
{
S_StartSound(toucher, special->info->seesound);
if (UNLIKELY(player->pflags & PF_NIGHTSMODE))
if (nightsplayer(player))
{
player->bumpertime = TICRATE/2;
if (special->threshold > 0)
@@ -1131,7 +1131,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
S_StartSound(toucher, special->info->painsound);
return;
}
else if (UNLIKELY((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) || (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
else if ((nightsplayer(player) && (player->pflags & PF_DRILLING)) || (player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING))
|| player->powers[pw_invulnerability] || player->powers[pw_super]) // Do you possess the ability to subdue the object?
{
// Shatter the shield!
@@ -2360,11 +2360,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (player->exiting)
return false;
if (UNLIKELY(!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)))
if (UNLIKELY(!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && nightsmode))
return false;
}
if (UNLIKELY(player->pflags & PF_NIGHTSMODE)) // NiGHTS damage handling
if (nightsplayer(player)) // NiGHTS damage handling
{
if (!force)
{
@@ -2609,7 +2609,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
ns = FixedMul(((i*FRACUNIT)/16)+2*FRACUNIT, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
if (!twodmo(player->mo))
mo->momy = FixedMul(FINESINE(fa),ns);
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
@@ -2633,7 +2633,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
ns = FixedMul(momxy, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
if (!twodmo(player->mo))
mo->momy = FixedMul(FINESINE(fa),ns);
ns = momz;
@@ -2740,7 +2740,7 @@ void P_PlayerWeaponPanelBurst(player_t *player)
ns = FixedMul(3*FRACUNIT, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
if (!twodmo(player->mo))
mo->momy = FixedMul(FINESINE(fa),ns);
P_SetObjectMomZ(mo, 4*FRACUNIT, false);
@@ -2824,7 +2824,7 @@ void P_PlayerWeaponAmmoBurst(player_t *player)
ns = FixedMul(2*FRACUNIT, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa), ns);
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
if (!twodmo(player->mo))
mo->momy = FixedMul(FINESINE(fa),ns);
P_SetObjectMomZ(mo, 3*FRACUNIT, false);
@@ -2940,7 +2940,7 @@ void P_PlayerEmeraldBurst(player_t *player, boolean toss)
momx = FixedMul(FINECOSINE(fa), ns);
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
if (!twodmo(player->mo))
momy = FixedMul(FINESINE(fa),ns);
else
momy = 0;
@@ -2997,7 +2997,7 @@ void P_PlayerFlagBurst(player_t *player, boolean toss)
{
angle_t fa = P_RandomByte()*FINEANGLES/256;
flag->momx = FixedMul(FINECOSINE(fa), FixedMul(6*FRACUNIT, player->mo->scale));
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
if (!twodmo(player->mo))
flag->momy = FixedMul(FINESINE(fa), FixedMul(6*FRACUNIT, player->mo->scale));
}
+6 -2
View File
@@ -59,8 +59,12 @@ extern "C" {
#define AIMINGTOSLOPE(aiming) FINESINE((aiming>>ANGLETOFINESHIFT) & FINEMASK)
#define mariomode (maptol & TOL_MARIO)
#define twodlevel (maptol & TOL_2D)
// unused modes, kept for compat
#define nightsmode (UNLIKELY(maptol & TOL_NIGHTS))
#define nightsplayer(player) (UNLIKELY((player)->pflags & PF_NIGHTSMODE))
#define mariomode (UNLIKELY(maptol & TOL_MARIO))
#define twodlevel (UNLIKELY(maptol & TOL_2D))
#define twodmo(mobj) (UNLIKELY(twodlevel || ((mobj)->flags2 & MF2_TWOD)))
//
// P_TICK
+23 -12
View File
@@ -136,14 +136,17 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (object->eflags & MFE_SPRUNG) // Object was already sprung this tic
return false;
// Spectators don't trigger springs.
if (object->player && object->player->spectator)
return false;
if (UNLIKELY(object->player && (object->player->pflags & PF_NIGHTSMODE)))
if (object->player)
{
/*Someone want to make these work like bumpers?*/
return false;
// Spectators don't trigger springs.
if (object->player->spectator)
return false;
if (nightsplayer(object->player))
{
/*Someone want to make these work like bumpers?*/
return false;
}
}
object->standingslope = NULL; // Okay, now we can't return - no launching off at silly angles for you.
@@ -160,10 +163,15 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (spring->eflags & MFE_VERTICALFLIP)
vertispeed *= -1;
// Vertical springs teleport you on TOP of them.
if (vertispeed > 0)
{
object->z = spring->z + spring->height + 1;
}
else if (vertispeed < 0)
{
object->z = spring->z - object->height - 1;
}
else
{
// Horizontal springs teleport you in FRONT of them.
@@ -215,7 +223,9 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (object->player)
{
if (spring->flags & MF_ENEMY) // Spring shells
{
P_SetTarget(&spring->target, object);
}
if (horizspeed && object->player->cmd.forwardmove == 0 && object->player->cmd.sidemove == 0)
{
@@ -350,12 +360,13 @@ static boolean PIT_CheckThing(mobj_t *thing)
}
#endif
if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING))
if ((thing->flags & MF_NOCLIPTHING) || !(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)))
return true;
// Don't collide with your buddies while NiGHTS-flying.
if (UNLIKELY(tmthing->player && thing->player && (maptol & TOL_NIGHTS)
&& ((tmthing->player->pflags & PF_NIGHTSMODE) || (thing->player->pflags & PF_NIGHTSMODE))))
if (nightsmode &&
tmthing->player && thing->player &&
(nightsplayer(tmthing->player) || nightsplayer(thing->player)))
return true;
blockdist = thing->radius + tmthing->radius;
@@ -3294,7 +3305,7 @@ stairstep:
if (bestslideline != NULL)
P_HitSlideLine(bestslideline); // clip the moves
if (UNLIKELY((twodlevel || (mo->flags2 & MF2_TWOD)) && mo->player))
if (twodmo(mo) && mo->player)
{
mo->momx = tmxmove;
tmymove = 0;
@@ -4200,7 +4211,7 @@ void P_CreateSecNodeList(mobj_t *thing, fixed_t x, fixed_t y)
* Must clear tmthing at tic end, as it might contain a pointer to a removed thinker, or the level might have ended/been ended and we clear the objects it was pointing too. Hopefully we don't need to carry this between tics for sync. */
void P_MapStart(void)
{
if (UNLIKELY(tmthing))
if (tmthing)
I_Error("P_MapStart: tmthing set!");
}
+31 -33
View File
@@ -172,7 +172,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
do
{
if (UNLIKELY(state == S_NULL))
if (state == S_NULL)
{ // Bad SOC!
CONS_Alert(CONS_ERROR, "Cannot remove player mobj by setting its state to S_NULL.\n");
//P_RemoveMobj(mobj);
@@ -905,7 +905,7 @@ static void P_PlayerFlip(mobj_t *mo)
G_GhostAddFlip((INT32) (mo->player - players));
// Flip aiming to match!
if (UNLIKELY(mo->player->pflags & PF_NIGHTSMODE)) // NiGHTS doesn't use flipcam
if (nightsplayer(mo->player)) // NiGHTS doesn't use flipcam
{
if (mo->tracer)
mo->tracer->eflags ^= MFE_VERTICALFLIP;
@@ -998,7 +998,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
if (mo->player)
{
if (UNLIKELY(mo->player->climbing || (mo->player->pflags & PF_NIGHTSMODE)))
if (UNLIKELY(mo->player->climbing || nightsplayer(mo->player)))
return 0;
if (!(mo->flags2 & MF2_OBJECTFLIP) != !(mo->player->powers[pw_gravityboots])) // negated to turn numeric into bool - would be double negated, but not needed if both would be
@@ -1177,7 +1177,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy)
}
else if (abs(player->rmomx) < mo->scale
&& abs(player->rmomy) < mo->scale
&& (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING))
&& (!(player->cmd.forwardmove && !twodmo(mo)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING))
&& !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2))
)
{
@@ -1619,7 +1619,7 @@ void P_XYMovement(mobj_t *mo)
// Check the gravity status.
P_CheckGravity(mo, false);
if (UNLIKELY(player && !moved && player->pflags & PF_NIGHTSMODE && mo->target))
if (player && !moved && nightsplayer(player) && mo->target)
{
angle_t fa;
@@ -1669,11 +1669,14 @@ void P_XYMovement(mobj_t *mo)
if (mo->flags & MF_MISSILE || mo->flags2 & MF2_SKULLFLY || mo->type == MT_SHELL || mo->type == MT_VULTURE)
return; // no friction for missiles ever
if (player && player->homing) // no friction for homing
return;
if (player)
{
if (player->homing) // no friction for homing
return;
if (UNLIKELY(player && player->pflags & PF_NIGHTSMODE))
return; // no friction for NiGHTS players
if (nightsplayer(player))
return; // no friction for NiGHTS players
}
if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
&& (mo->standingslope && abs(mo->standingslope->zdelta) > FRACUNIT>>8)) // Special exception for tumbleweeds on slopes
@@ -2221,7 +2224,7 @@ static boolean P_ZMovement(mobj_t *mo)
|| mo->type == MT_CANNONBALLDECOR
|| mo->type == MT_FALLINGROCK)
{
if (UNLIKELY(maptol & TOL_NIGHTS))
if (nightsmode)
mom.z = -FixedDiv(mom.z, 10*FRACUNIT);
else
mom.z = -FixedMul(mom.z, FixedDiv(17*FRACUNIT,20*FRACUNIT));
@@ -2359,11 +2362,9 @@ static boolean P_ZMovement(mobj_t *mo)
{
if (mo->flags2 & MF2_SKULLFLY) // the skull slammed into something
mo->momz = -mo->momz;
else
// Flags bounce
if (UNLIKELY(mo->type == MT_REDFLAG || mo->type == MT_BLUEFLAG))
else if (UNLIKELY(mo->type == MT_REDFLAG || mo->type == MT_BLUEFLAG)) // Flags bounce
{
if (UNLIKELY(maptol & TOL_NIGHTS))
if (nightsmode)
mo->momz = -FixedDiv(mo->momz, 10*FRACUNIT);
else
mo->momz = -FixedMul(mo->momz, FixedDiv(17*FRACUNIT,20*FRACUNIT));
@@ -2429,7 +2430,7 @@ static void P_PlayerZMovement(mobj_t *mo)
else
mo->z = mo->floorz;
if (UNLIKELY(mo->player->pflags & PF_NIGHTSMODE))
if (nightsplayer(mo->player))
{
// bounce off floor if you were flying towards it
if ((mo->eflags & MFE_VERTICALFLIP && mo->player->flyangle > 0 && mo->player->flyangle < 180)
@@ -2620,7 +2621,7 @@ nightsdone:
else
mo->z = mo->ceilingz - mo->height;
if (UNLIKELY(mo->player->pflags & PF_NIGHTSMODE))
if (nightsplayer(mo->player))
{
// bounce off ceiling if you were flying towards it
if ((mo->eflags & MFE_VERTICALFLIP && mo->player->flyangle > 180 && mo->player->flyangle <= 359)
@@ -2665,7 +2666,7 @@ nightsdone:
}
// hit the ceiling
if (UNLIKELY(mariomode))
if (mariomode)
S_StartSound(mo, sfx_mario1);
if (!mo->player->climbing)
@@ -3223,7 +3224,7 @@ void P_CalcChasePostImg(player_t *player, camera_t *thiscam)
player_flipcam = cv_flipcam[pnum].value;
}
const boolean flipcam = (player_flipcam && player->mo->eflags & MFE_VERTICALFLIP && LIKELY(!(player->pflags & PF_NIGHTSMODE)));
const boolean flipcam = (player_flipcam && player->mo->eflags & MFE_VERTICALFLIP && !nightsplayer(player));
UINT8 postimgtype = 0;
if (encoremode)
@@ -3406,7 +3407,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
P_CheckPosition(mobj, mobj->x, mobj->y);
goto animonly;
}
else if (UNLIKELY(mobj->player->pflags & PF_MACESPIN))
else if (mobj->player->pflags & PF_MACESPIN)
{
P_CheckPosition(mobj, mobj->x, mobj->y);
goto animonly;
@@ -3520,7 +3521,7 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
}
else
{
if (LIKELY(!(mobj->player->pflags & PF_NIGHTSMODE))) // "jumping" is used for drilling
if (!nightsplayer(mobj->player)) // "jumping" is used for drilling
mobj->player->jumping = 0;
mobj->player->pflags &= ~PF_JUMPED;
@@ -8552,7 +8553,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
if (mobj->tracer && mobj->tracer->player)
{
if (LIKELY(!(mobj->tracer->player->pflags & PF_NIGHTSMODE)))
if (!nightsplayer(mobj->tracer->player))
{
mobj->flags &= ~MF_NOGRAVITY;
mobj->flags2 &= ~MF2_DONTDRAW;
@@ -8576,7 +8577,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
P_SetTarget(&mobj->target, NULL);
}
if (UNLIKELY(mobj->tracer->player->pflags & PF_NIGHTSMODE))
if (nightsplayer(mobj->tracer->player))
{
if (mobj->tracer->player->bonustime)
{
@@ -9078,7 +9079,7 @@ void P_MobjThinker(mobj_t *mobj)
const sector_t *sec1 = mobj->subsector ? mobj->subsector->sector : NULL;
// 970 allows ANY mobj to trigger a linedef exec
if (UNLIKELY(!mobj->islocal && sec1 && GETSECSPECIAL(sec1->special, 2) == 8)) // BEWARE: islocal does not exist in vanilla
if (!mobj->islocal && sec1 && GETSECSPECIAL(sec1->special, 2) == 8) // BEWARE: islocal does not exist in vanilla
{
sector_t *sec2;
sec2 = P_ThingOnSpecial3DFloor(mobj);
@@ -9144,7 +9145,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->flags2 & MF2_FIRING && mobj->target && mobj->health > 0)
P_FiringThink(mobj);
if (UNLIKELY(mobj->flags & MF_AMBIENT))
if (mobj->flags & MF_AMBIENT)
{
if (leveltime % mobj->health)
return;
@@ -9208,8 +9209,8 @@ void P_MobjThinker(mobj_t *mobj)
P_ButteredSlope(mobj);
}
if (UNLIKELY(mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health
&& P_CheckDeathPitCollide(mobj))) // extra pit check in case these didn't have momz
if (mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->health
&& P_CheckDeathPitCollide(mobj)) // extra pit check in case these didn't have momz
{
P_KillMobj(mobj, NULL, NULL);
return;
@@ -9218,10 +9219,7 @@ void P_MobjThinker(mobj_t *mobj)
// Crush enemies!
if (mobj->ceilingz - mobj->floorz < mobj->height)
{
if (UNLIKELY((
(mobj->flags & (MF_ENEMY|MF_BOSS)
&& mobj->flags & MF_SHOOTABLE)
|| mobj->type == MT_EGGSHIELD))
if (((mobj->flags & (MF_ENEMY|MF_BOSS) && mobj->flags & MF_SHOOTABLE) || mobj->type == MT_EGGSHIELD)
&& !(mobj->flags & MF_NOCLIPHEIGHT)
&& mobj->health > 0)
{
@@ -9243,7 +9241,7 @@ void P_MobjThinker(mobj_t *mobj)
if (P_MobjWasRemoved(mobj))
return;
if (UNLIKELY(P_WeaponOrPanel(mobj->type)))
if (P_WeaponOrPanel(mobj->type))
{
if (mobj->health == 0) // Fading tile
{
@@ -10131,14 +10129,14 @@ void P_RemoveMobj(mobj_t *mobj)
}
}
// Rings only, please!
else if (UNLIKELY(mobj->spawnpoint &&
else if (mobj->spawnpoint &&
!(mobj->flags2 & MF2_DONTRESPAWN) &&
(mobj->type == MT_RING
|| mobj->type == MT_COIN
|| mobj->type == MT_BLUEBALL
|| mobj->type == MT_REDTEAMRING
|| mobj->type == MT_BLUETEAMRING
|| P_WeaponOrPanel(mobj->type))))
|| P_WeaponOrPanel(mobj->type)))
{
itemrespawnque[iquehead] = mobj->spawnpoint;
itemrespawntime[iquehead] = leveltime;
+3 -3
View File
@@ -3880,7 +3880,7 @@ DoneSection2:
player->kartstuff[k_lapanimation] = 80;
if (UNLIKELY(player->pflags & PF_NIGHTSMODE))
if (nightsplayer(player))
player->drillmeter += 48*20;
if (netgame && player->laps >= (UINT8)cv_numlaps.value)
@@ -7126,7 +7126,7 @@ static inline boolean PIT_PushThing(mobj_t *thing)
return false;
// Allow this to affect pushable objects at some point?
if (thing->player && (!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) || UNLIKELY(thing->player->pflags & PF_NIGHTSMODE)))
if (thing->player && (!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) || nightsplayer(thing->player)))
{
INT32 dist;
INT32 speed;
@@ -7156,7 +7156,7 @@ static inline boolean PIT_PushThing(mobj_t *thing)
// Written with bits and pieces of P_HomingAttack
if ((speed > 0) && (P_CheckSight(thing, tmpusher->source)))
{
if (LIKELY(!(thing->player->pflags & PF_NIGHTSMODE)))
if (!nightsplayer(thing->player))
{
// only push wrt Z if health & 1 (mapthing has ambush flag)
if (tmpusher->source->health & 1)
+14 -14
View File
@@ -74,7 +74,7 @@ void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move)
mo->momx += FixedMul(move, FINECOSINE(angle));
if (LIKELY(!(twodlevel || (mo->flags2 & MF2_TWOD))))
if (!twodmo(mo))
mo->momy += FixedMul(move, FINESINE(angle));
}
@@ -90,7 +90,7 @@ void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move)
mo->momx = FixedMul(move, FINECOSINE(angle));
if (LIKELY(!(twodlevel || (mo->flags2 & MF2_TWOD))))
if (!twodmo(mo))
mo->momy = FixedMul(move,FINESINE(angle));
}
@@ -475,7 +475,7 @@ void P_PlayLivesJingle(player_t *player)
if (UNLIKELY(use1upSound))
S_StartSound(NULL, sfx_oneup);
else if (UNLIKELY(mariomode))
else if (mariomode)
S_StartSound(NULL, sfx_marioa);
else
{
@@ -503,7 +503,7 @@ void P_PlayRinglossSound(mobj_t *source, mobj_t *damager)
S_StartSound(NULL, sfx);
}
else
S_StartSound(source, UNLIKELY(mariomode) ? sfx_mario8 : sfx_khurt1 + key);
S_StartSound(source, mariomode ? sfx_mario8 : sfx_khurt1 + key);
}
else
S_StartSound(source, sfx_slip);
@@ -1725,7 +1725,7 @@ static void P_DoBubbleBreath(player_t *player)
else
zh = player->mo->z + FixedDiv(player->mo->height,5*(FRACUNIT/4));
if (!(player->mo->eflags & MFE_UNDERWATER) || player->spectator || ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && !(player->pflags & PF_NIGHTSMODE)))
if (!(player->mo->eflags & MFE_UNDERWATER) || player->spectator || ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL && !nightsplayer(player)))
return;
if (P_RandomChance(FRACUNIT/16))
@@ -2298,7 +2298,7 @@ static void P_MovePlayer(player_t *player)
P_3dMovement(player);
}
if (UNLIKELY(maptol & TOL_2D)) // psure this doesent even work at all
if (twodlevel) // psure this doesent even work at all
runspd = FixedMul(runspd, 2*FRACUNIT/3);
/////////////////////////
@@ -2748,8 +2748,8 @@ boolean P_LookForEnemies(player_t *player)
if (modist > FixedMul(RING_DIST, player->mo->scale))
continue; // out of range
if (UNLIKELY((twodlevel || player->mo->flags2 & MF2_TWOD)
&& abs(player->mo->y-mo->y) > player->mo->radius))
if (twodmo(player->mo) && abs(player->mo->y-mo->y) > player->mo->radius)
continue; // not in your 2d plane
if (closestmo && modist > P_AproxDistance(P_AproxDistance(player->mo->x-closestmo->x,
@@ -3508,7 +3508,7 @@ static boolean P_CheckNoclipCameraPosition(player_t *player, camera_t *thiscam,
boolean cameranoclip;
mobj_t *mo = player->mo;
cameranoclip = ((player->pflags & (PF_NOCLIP|PF_NIGHTSMODE))
cameranoclip = (nightsplayer(player)
|| (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)) // Noclipping player camera noclips too!!
|| (leveltime < introtime)); // Kart intro cam
@@ -4097,7 +4097,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
angle -= (angle - thiscam->pitch)/2;
}
if (player->playerstate != PST_DEAD && LIKELY(!((player->pflags & PF_NIGHTSMODE) && player->exiting)))
if (player->playerstate != PST_DEAD && !(nightsplayer(player) && player->exiting))
angle += (focusaiming < ANGLE_180 ? focusaiming/2 : InvAngle(InvAngle(focusaiming)/2)); // overcomplicated version of '((signed)focusaiming)/2;'
if (!camstill && !timeover) // Keep the view still...
@@ -4174,7 +4174,7 @@ boolean P_SpectatorJoinGame(player_t *player)
// Team changing in Team Match and CTF
// Pressing fire assigns you to a team that needs players if allowed.
// Partial code reproduction from p_tick.c autobalance code.
else if (UNLIKELY(G_GametypeHasTeams()))
else if (G_GametypeHasTeams())
{
INT32 changeto = 0;
INT32 z, numplayersred = 0, numplayersblue = 0;
@@ -4871,7 +4871,7 @@ void P_PlayerThink(player_t *player)
// Even if not NiGHTS, pull in nearby objects when walking around as John Q. Elliot.
if (UNLIKELY(!objectplacing && !((netgame || multiplayer) && player->spectator)
&& maptol & TOL_NIGHTS && (!(player->pflags & PF_NIGHTSMODE) || player->powers[pw_nights_helper])))
&& nightsmode && (!nightsplayer(player) || player->powers[pw_nights_helper])))
{
thinker_t *th;
mobj_t *mo2;
@@ -4973,7 +4973,7 @@ void P_PlayerThink(player_t *player)
#endif
// check for use
if (LIKELY(!(player->pflags & PF_NIGHTSMODE)))
if (!nightsplayer(player))
{
if (cmd->buttons & BT_BRAKE)
player->pflags |= PF_USEDOWN;
@@ -5164,7 +5164,7 @@ void P_PlayerAfterThink(player_t *player)
}
}
if (UNLIKELY(player->pflags & PF_NIGHTSMODE))
if (nightsplayer(player))
{
player->powers[pw_gravityboots] = 0;
}