make those const

This commit is contained in:
Alug committed 2025-01-30 13:22:03 +01:00
1 parent 6e81cdcb01
commit c7a24199c7
4 files changed
+19 -21

No files matched your search

+9 -9
View File
@@ -2119,11 +2119,11 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
sec = &sectors[secnum];
FOFsector = false;
INT32 special = GETSECSPECIAL(sec->special, 2);
const INT32 secspecial = GETSECSPECIAL(sec->special, 2);
if (special == 3 || special == 5)
if (secspecial == 3 || secspecial == 5)
floortouch = true;
else if (special >= 1 && special <= 8)
else if (secspecial >= 1 && secspecial <= 8)
floortouch = false;
else
continue;
@@ -2255,7 +2255,7 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
continue;
if (!(players[i].mo->subsector->sector == sec
|| P_PlayerTouchingSectorSpecial(&players[i], 2, special) == sec))
|| P_PlayerTouchingSectorSpecial(&players[i], 2, secspecial) == sec))
continue;
if (floortouch == true && P_IsObjectOnRealGround(players[i].mo, sec))
@@ -2299,9 +2299,9 @@ void T_EachTimeThinker(levelspecthink_t *eachtime)
while ((affectPlayer = P_HavePlayersEnteredArea(playersArea, oldPlayersArea, inAndOut)) != -1)
{
INT32 special = GETSECSPECIAL(sec->special, 2);
const INT32 secspecial = GETSECSPECIAL(sec->special, 2);
if (special == 2 || special == 3)
if (secspecial == 2 || secspecial == 3)
{
for (i = 0; i < MAXPLAYERS; i++)
{
@@ -2920,12 +2920,12 @@ void EV_CrumbleChain(sector_t *sec, ffloor_t *rover)
fixed_t a, b, c;
mobjtype_t type = MT_ROCKCRUMBLE1;
const fixed_t spacing = 48*mapobjectscale;
INT32 special = GETSECSPECIAL(rover->master->frontsector->special, 3);
const INT32 secspecial = GETSECSPECIAL(rover->master->frontsector->special, 3);
// If the control sector has a special
// of Section3:7-15, use the custom debris.
if (special >= 8)
type = MT_ROCKCRUMBLE1+(special-7);
if (secspecial >= 8)
type = MT_ROCKCRUMBLE1+(secspecial-7);
// soundorg z height never gets set normally, so MEH.
sec->soundorg.z = sec->floorheight;
+4 -6
View File
@@ -2407,19 +2407,17 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
{
//All things are affected by their scale.
fixed_t maxstep = FixedMul(MAXSTEPMOVE, mapobjectscale);
INT32 special = 0;
const INT32 secspecial = (thing->player) ? GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) : 0;
if (thing->player)
{
special = GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1);
// If using type Section1:13, double the maxstep.
if (P_PlayerTouchingSectorSpecial(thing->player, 1, 13)
|| special == 13)
|| secspecial == 13)
maxstep <<= 1;
// If using type Section1:12, no maxstep. For ledges you don't want the player to climb! (see: Egg Zeppelin & SMK port walls)
else if (P_PlayerTouchingSectorSpecial(thing->player, 1, 12)
|| special == 12)
|| secspecial == 12)
maxstep = 0;
}
@@ -2465,7 +2463,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
else if (maxstep > 0 && !(
thing->player && (
P_PlayerTouchingSectorSpecial(thing->player, 1, 14)
|| special == 14)
|| secspecial == 14)
)) // Step down
{
// If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS
+2 -2
View File
@@ -1887,13 +1887,13 @@ boolean P_CheckDeathPitCollide(mobj_t *mo)
I_Assert(mo != NULL);
I_Assert(!P_MobjWasRemoved(mo));
INT32 special = GETSECSPECIAL(mo->subsector->sector->special, 1);
const INT32 secspecial = GETSECSPECIAL(mo->subsector->sector->special, 1);
if (((mo->z <= mo->subsector->sector->floorheight
&& !(mo->eflags & MFE_VERTICALFLIP) && (mo->subsector->sector->flags & SF_FLIPSPECIAL_FLOOR))
|| (mo->z + mo->height >= mo->subsector->sector->ceilingheight
&& (mo->eflags & MFE_VERTICALFLIP) && (mo->subsector->sector->flags & SF_FLIPSPECIAL_CEILING)))
&& (special == 6 || special == 7))
&& (secspecial == 6 || secspecial == 7))
return true;
return false;
+4 -4
View File
@@ -1427,14 +1427,14 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
}
else if (caller)
{
INT32 special = GETSECSPECIAL(caller->special, 2);
const INT32 secspecial = GETSECSPECIAL(caller->special, 2);
if (special == 6)
if (secspecial == 6)
{
if (!(ALL7EMERALDS(emeralds)))
return false;
}
else if (special == 7) // SRB2Kart: reusing for Race Lap executor
else if (secspecial == 7) // SRB2Kart: reusing for Race Lap executor
{
UINT8 lap;
@@ -1468,7 +1468,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller
// If we were not triggered by a sector type especially for the purpose,
// a Linedef Executor linedef trigger is not handling sector triggers properly, return.
else if ((!special || special > 7) && (specialtype > 322))
else if ((!secspecial || secspecial > 7) && (specialtype > 322))
{
CONS_Alert(CONS_WARNING,
M_GetText("Linedef executor trigger isn't handling sector triggers properly!\nspecialtype = %d, if you are not a dev, report this warning instance\nalong with the wad that caused it!\n"),