@@ -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