Rename ZOFFSET1 to ACTOR_FLOOR_OFFSET and use ACTOR_MAXFALLINGZVEL in several places where it should have been used

git-svn-id: https://svn.eduke32.com/eduke32@8637 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/duke3d/src/player.cpp
This commit is contained in:
terminx 2020-02-11 09:21:44 +00:00 committed by Christoph Oelckers
parent 46b62aa6aa
commit 376c29dba6
5 changed files with 23 additions and 23 deletions

View file

@ -1656,11 +1656,11 @@ ACTOR_STATIC void G_MoveFallers(void)
else if (EDUKE32_PREDICT_FALSE(G_CheckForSpaceCeiling(pSprite->sectnum)))
spriteGravity = g_spriteGravity / 6;
if (pSprite->z < (sector[sectNum].floorz-ZOFFSET))
if (pSprite->z < (sector[sectNum].floorz-ACTOR_FLOOR_OFFSET))
{
pSprite->zvel += spriteGravity;
if (pSprite->zvel > 6144)
pSprite->zvel = 6144;
if (pSprite->zvel > ACTOR_MAXFALLINGZVEL)
pSprite->zvel = ACTOR_MAXFALLINGZVEL;
pSprite->z += pSprite->zvel;
}
@ -2898,7 +2898,7 @@ ACTOR_STATIC void Proj_MoveCustom(int const spriteNum)
pSprite->zvel -= pProj->drop;
if (pProj->workslike & PROJECTILE_SPIT && pSprite->zvel < 6144)
if (pProj->workslike & PROJECTILE_SPIT && pSprite->zvel < ACTOR_MAXFALLINGZVEL)
pSprite->zvel += g_spriteGravity - 112;
A_GetZLimits(spriteNum);
@ -3227,7 +3227,7 @@ ACTOR_STATIC void G_MoveWeapons(void)
}
}
else if (pSprite->picnum == SPIT)
if (pSprite->zvel < 6144)
if (pSprite->zvel < ACTOR_MAXFALLINGZVEL)
pSprite->zvel += g_spriteGravity - 112;
if (moveSprite != 0)
@ -4121,7 +4121,7 @@ ACTOR_STATIC void G_MoveActors(void)
if (pData[3] > 0)
{
if (pSprite->zvel < 6144)
if (pSprite->zvel < ACTOR_MAXFALLINGZVEL)
pSprite->zvel += 192;
pSprite->z += pSprite->zvel;
@ -4815,7 +4815,7 @@ ACTOR_STATIC void G_MoveActors(void)
{
A_Fall(spriteNum);
if ((sector[sectNum].lotag != ST_1_ABOVE_WATER || actor[spriteNum].floorz != sector[sectNum].floorz) && pSprite->z >= actor[spriteNum].floorz-(ZOFFSET) && pSprite->yvel < 3)
if ((sector[sectNum].lotag != ST_1_ABOVE_WATER || actor[spriteNum].floorz != sector[sectNum].floorz) && pSprite->z >= actor[spriteNum].floorz-(ACTOR_FLOOR_OFFSET) && pSprite->yvel < 3)
{
if (pSprite->yvel > 0 || (pSprite->yvel == 0 && actor[spriteNum].floorz == sector[sectNum].floorz))
A_PlaySound(PIPEBOMB_BOUNCE,spriteNum);
@ -5467,7 +5467,7 @@ ACTOR_STATIC void G_MoveMisc(void) // STATNUM 5
}
}
if (pSprite->zvel < 6144)
if (pSprite->zvel < ACTOR_MAXFALLINGZVEL)
{
if (sector[sectNum].lotag == ST_2_UNDERWATER)
{
@ -5648,7 +5648,7 @@ ACTOR_STATIC void G_MoveMisc(void) // STATNUM 5
if (sectNum < 0)
DELETE_SPRITE_AND_CONTINUE(spriteNum);
if (pSprite->z == actor[spriteNum].floorz-(ZOFFSET) && pData[0] < 3)
if (pSprite->z == actor[spriteNum].floorz-(ACTOR_FLOOR_OFFSET) && pData[0] < 3)
{
pSprite->zvel = -((3-pData[0])<<8)-(krand()&511);
if (sector[sectNum].lotag == ST_2_UNDERWATER)

View file

@ -30,7 +30,7 @@ BEGIN_DUKE_NS
#define MAXSLEEPDIST 16384
#define SLEEPTIME 1536
#define ZOFFSET (1<<8)
#define ACTOR_FLOOR_OFFSET (1<<8)
#define ZOFFSET2 (16<<8)
#define ZOFFSET3 (8<<8)
#define ZOFFSET4 (12<<8)
@ -56,7 +56,7 @@ BEGIN_DUKE_NS
#define STAT_FALLER 12
#define STAT_DUMMYPLAYER 13
#define STAT_LIGHT 14
#define STAT_NETALLOC MAXSTATUS-1
#define STAT_NETALLOC (MAXSTATUS-1)
// Defines the motion characteristics of an actor

View file

@ -403,11 +403,11 @@ void VM_GetZRange(int const spriteNum, int32_t * const ceilhit, int32_t * const
int const ocstat = pSprite->cstat;
pSprite->cstat = 0;
pSprite->z -= ZOFFSET;
pSprite->z -= ACTOR_FLOOR_OFFSET;
getzrange(&pSprite->pos, pSprite->sectnum, &actor[spriteNum].ceilingz, ceilhit, &actor[spriteNum].floorz, florhit, wallDist, CLIPMASK0);
pSprite->z += ZOFFSET;
pSprite->z += ACTOR_FLOOR_OFFSET;
pSprite->cstat = ocstat;
}
@ -469,7 +469,7 @@ void A_Fall(int const spriteNum)
int fbunch = (sector[pSprite->sectnum].floorstat&512) ? -1 : yax_getbunch(pSprite->sectnum, YAX_FLOOR);
#endif
if (pSprite->z < actor[spriteNum].floorz-ZOFFSET
if (pSprite->z < actor[spriteNum].floorz-ACTOR_FLOOR_OFFSET
#ifdef YAX_ENABLE
|| fbunch >= 0
#endif
@ -477,7 +477,7 @@ void A_Fall(int const spriteNum)
{
if (sector[pSprite->sectnum].lotag == ST_2_UNDERWATER && pSprite->zvel > 3122)
pSprite->zvel = 3144;
pSprite->z += pSprite->zvel = min(6144, pSprite->zvel+spriteGravity);
pSprite->z += pSprite->zvel = min(ACTOR_MAXFALLINGZVEL, pSprite->zvel+spriteGravity);
}
#ifdef YAX_ENABLE
@ -485,9 +485,9 @@ void A_Fall(int const spriteNum)
setspritez(spriteNum, &pSprite->pos);
else
#endif
if (pSprite->z >= actor[spriteNum].floorz-ZOFFSET)
if (pSprite->z >= actor[spriteNum].floorz-ACTOR_FLOOR_OFFSET)
{
pSprite->z = actor[spriteNum].floorz-ZOFFSET;
pSprite->z = actor[spriteNum].floorz-ACTOR_FLOOR_OFFSET;
pSprite->zvel = 0;
}
}
@ -1019,7 +1019,7 @@ static void VM_Fall(int const spriteNum, spritetype * const pSprite)
A_GetZLimits(spriteNum);
if (pSprite->z < actor[spriteNum].floorz-ZOFFSET)
if (pSprite->z < actor[spriteNum].floorz-ACTOR_FLOOR_OFFSET)
{
// Free fall.
pSprite->zvel = min(pSprite->zvel+spriteGravity, ACTOR_MAXFALLINGZVEL);
@ -1030,15 +1030,15 @@ static void VM_Fall(int const spriteNum, spritetype * const pSprite)
setspritez(spriteNum, &pSprite->pos);
else
#endif
if (newZ > actor[spriteNum].floorz - ZOFFSET)
newZ = actor[spriteNum].floorz - ZOFFSET;
if (newZ > actor[spriteNum].floorz - ACTOR_FLOOR_OFFSET)
newZ = actor[spriteNum].floorz - ACTOR_FLOOR_OFFSET;
pSprite->z = newZ;
return;
}
// Preliminary new z position of the actor.
int newZ = actor[spriteNum].floorz - ZOFFSET;
int newZ = actor[spriteNum].floorz - ACTOR_FLOOR_OFFSET;
if (A_CheckEnemySprite(pSprite) || (pSprite->picnum == APLAYER && pSprite->owner >= 0))
{

View file

@ -5076,7 +5076,7 @@ void P_ProcessInput(int playerNum)
S_StopEnvSound(-1, pPlayer->i, CHAN_VOICE);
if ((sectorLotag != ST_1_ABOVE_WATER && sectorLotag != ST_2_UNDERWATER) &&
(pPlayer->on_ground == 0 && pPlayer->vel.z > (6144 >> 1)))
(pPlayer->on_ground == 0 && pPlayer->vel.z > (ACTOR_MAXFALLINGZVEL >> 1)))
pPlayer->hard_landing = pPlayer->vel.z>>10;
pPlayer->on_ground = 1;

View file

@ -40,7 +40,7 @@ extern int32_t g_mostConcurrentPlayers;
#define HORIZ_MAX 299
#define AUTO_AIM_ANGLE 48
#define PHEIGHT (38<<8)
#define PCROUCHHEIGHT ZOFFSET2
#define PCROUCHHEIGHT (16<<8)
#define PCROUCHINCREMENT (2048+768)
#define PMINHEIGHT (2048)