Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion code/game/g_combat.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,26 @@ void player_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int

self->s.loopSound = 0;

self->r.maxs[2] = -8;
if (!g_shotgunGibFix.integer) {
// Executing this line causes a bug where the shotgun doesn't gib
// unless you aim at the feet.
// See https://github.com/ioquake/ioq3/issues/794.
//
// Note that without this line (when `g_shotgunGibFix` is enabled),
// when shooting at two players standing
// behind each other, the second target will take less damage,
// because the dead body of the first player will absorb the pellets
// until it gets gibbed (that is, up to 4 pellets,
// see `GIB_HEALTH` and `DEFAULT_SHOTGUN_DAMAGE`).
//
// The purpose and the effect of this line is not entirely clear.
// Maybe it's to transition the player hitbox
// into the "lying down dead" state, make it shorter.
// But this is already handled in `PM_CheckDuck`,
// so maybe it's just leftover code.
// So let's keep this line for now, but put behind a cvar.
self->r.maxs[2] = -8;
}

// don't allow respawn until the death anim is done
// g_forcerespawn may force spawning at some later time
Expand Down
1 change: 1 addition & 0 deletions code/game/g_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ extern vmCvar_t g_votecustom;
extern vmCvar_t g_warmup;
extern vmCvar_t g_doWarmup;
extern vmCvar_t g_blood;
extern vmCvar_t g_shotgunGibFix;
extern vmCvar_t g_allowVote;
extern vmCvar_t g_teamAutoJoin;
extern vmCvar_t g_teamForceBalance;
Expand Down
2 changes: 2 additions & 0 deletions code/game/g_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ vmCvar_t g_restarted;
vmCvar_t g_logfile;
vmCvar_t g_logfileSync;
vmCvar_t g_blood;
vmCvar_t g_shotgunGibFix;
vmCvar_t g_podiumDist;
vmCvar_t g_podiumDrop;
vmCvar_t g_allowVote;
Expand Down Expand Up @@ -261,6 +262,7 @@ static cvarTable_t gameCvarTable[] = {
{ &g_motd, "g_motd", "", 0, 0, qfalse },
{ &g_motdfile, "g_motdfile", "motd.cfg", 0, 0, qfalse },
{ &g_blood, "com_blood", "1", 0, 0, qfalse },
{ &g_shotgunGibFix, "g_shotgunGibFix", "1", CVAR_ARCHIVE, 0, qfalse },

{ &g_podiumDist, "g_podiumDist", "80", 0, 0, qfalse },
{ &g_podiumDrop, "g_podiumDrop", "70", 0, 0, qfalse },
Expand Down