From 42363fd73a609179c52e15ac656a9b0cd3ad7607 Mon Sep 17 00:00:00 2001 From: terminx Date: Tue, 19 Mar 2019 17:09:51 +0000 Subject: [PATCH] Replace hard-coded literal "777" for player crack_time member with preprocessor define git-svn-id: https://svn.eduke32.com/eduke32@7430 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/player.cpp | 16 ++++++++-------- source/duke3d/src/player.h | 2 ++ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index ffc5ac7b3..903beb773 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -1579,7 +1579,7 @@ int A_ShootWithZvel(int const spriteNum, int const projecTile, int const forceZv startPos = *(vec3_t *)pPlayer; startPos.z += pPlayer->pyoff + ZOFFSET6; shootAng = fix16_to_int(pPlayer->q16ang); - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; } else { @@ -3147,7 +3147,7 @@ static int32_t P_DoCounters(int playerNum) if (--pPlayer->crack_time == 0) { pPlayer->knuckle_incs = 1; - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; } } @@ -3903,7 +3903,7 @@ static void P_ProcessWeapon(int playerNum) else if ((playerBits & (1 << 2)) && (*weaponFrame) == 0 && pPlayer->fist_incs == 0 && pPlayer->last_weapon == -1 && (pPlayer->weapon_pos == 0 || pPlayer->holster_weapon == 1)) { - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; if (pPlayer->holster_weapon == 1) { @@ -4496,7 +4496,7 @@ static void P_DoJetpack(int const playerNum, int const playerBits, int const pla if (VM_OnEvent(EVENT_SOARUP, pPlayer->i, playerNum) == 0) { pPlayer->pos.z -= zAdjust; - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; } } @@ -4505,7 +4505,7 @@ static void P_DoJetpack(int const playerNum, int const playerBits, int const pla if (VM_OnEvent(EVENT_SOARDOWN, pPlayer->i, playerNum) == 0) { pPlayer->pos.z += zAdjust; - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; } } @@ -5069,7 +5069,7 @@ void P_ProcessInput(int playerNum) if (pPlayer->jumping_toggle == 0) { pPlayer->pos.z += PCROUCHINCREMENT; - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; } } } @@ -5152,7 +5152,7 @@ void P_ProcessInput(int playerNum) : fix16_mul(inputAng, fix16_from_int(ksgn(velocityModifier))); pPlayer->q16ang += pPlayer->q16angvel; pPlayer->q16ang &= 0x7FFFFFF; - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; } if (pPlayer->spritebridge == 0) @@ -5203,7 +5203,7 @@ void P_ProcessInput(int playerNum) if (pPlayer->vel.x || pPlayer->vel.y || g_player[playerNum].inputBits->fvel || g_player[playerNum].inputBits->svel) { - pPlayer->crack_time = 777; + pPlayer->crack_time = PCRACKTIME; #ifndef EDUKE32_STANDALONE if (!IONMAIDEN) diff --git a/source/duke3d/src/player.h b/source/duke3d/src/player.h index 31a8f03ea..97d230f65 100644 --- a/source/duke3d/src/player.h +++ b/source/duke3d/src/player.h @@ -45,6 +45,8 @@ extern int32_t g_mostConcurrentPlayers; #define PCROUCHINCREMENT (2048+768) #define PMINHEIGHT (2048) +#define PCRACKTIME 777 + #define TRIPBOMB_TRIPWIRE 0x00000001 #define TRIPBOMB_TIMER 0x00000002