Skip to content

Commit 38c4180

Browse files
WofWcatimangus
authored andcommitted
refactor: #define DEAD_HEIGHT -8
From the research conducted in #794 we can probably conclude that the `self->r.maxs[2] = -8;` in `player_die()` is related to `pm->maxs[2] = -8;` in `PM_CheckDuck()`. Let's make this clear with a named constant.
1 parent 3041ec3 commit 38c4180

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

code/game/bg_pmove.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ static void PM_CheckDuck (void)
12751275

12761276
if (pm->ps->pm_type == PM_DEAD)
12771277
{
1278-
pm->maxs[2] = -8;
1278+
pm->maxs[2] = DEAD_HEIGHT;
12791279
pm->ps->viewheight = DEAD_VIEWHEIGHT;
12801280
return;
12811281
}

code/game/bg_public.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
5252
#define DEFAULT_VIEWHEIGHT 26
5353
#define CROUCH_HEIGHT 16
5454
#define CROUCH_VIEWHEIGHT 12
55+
#define DEAD_HEIGHT -8
5556
#define DEAD_VIEWHEIGHT -16
5657

5758
//

code/game/g_combat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int
601601

602602
self->s.loopSound = 0;
603603

604-
self->r.maxs[2] = -8;
604+
self->r.maxs[2] = DEAD_HEIGHT;
605605

606606
// don't allow respawn until the death anim is done
607607
// g_forcerespawn may force spawning at some later time

0 commit comments

Comments
 (0)