Skip to content

Commit 0368192

Browse files
authored
Merge pull request #50 from WofWca/baseq3e-fix-gibbing-after-match-end
fix: allow gibbing after `intermissionQueued` CVAR
2 parents ffac628 + d039846 commit 0368192

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Unofficial Quake III Arena gamecode patch
1111
* fixed spawn system
1212
* fixed in-game crosshair proportions
1313
* fixed UI mouse sensitivity for high-resolution
14+
* fixed not being able to gib after match end (right before showing the scores)
1415
* fixed shotgun not gibbing unless aiming at the feet
1516
* fixed server browser + faster scanning
1617
* fixed grappling hook muzzle position visuals

code/game/g_combat.c

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,29 @@ void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker,
816816
// the intermission has allready been qualified for, so don't
817817
// allow any extra scoring
818818
if ( level.intermissionQueued ) {
819+
820+
// With a special exception for gibbing bodies.
821+
// This was introduced in https://github.com/ec-/baseq3a/pull/50.
822+
if (targ->die == body_die) {
823+
// Note that this also affects the situation where the last frag
824+
// is done with the shotgun. Because each pellet calls `G_Damage`
825+
// separately. That is, if we don't do this,
826+
// the shotgun will never gib if it's the last frag.
827+
//
828+
// Note that this does not check for friendly fire, quad,
829+
// battlesuit, handicap, armor, etc.
830+
// We could simply continue normal execution of G_Damage
831+
// instead of returning, but let's play it safe
832+
// and only do what's necessary.
833+
834+
targ->health = targ->health - damage;
835+
if ( targ->health <= 0 ) {
836+
// `body_die` doesn't use any of its arguments (except `targ`),
837+
// so it's fine if they're `NULL`.
838+
targ->die (targ, inflictor, attacker, damage, mod);
839+
}
840+
}
841+
819842
return;
820843
}
821844
#ifdef MISSIONPACK

0 commit comments

Comments
 (0)