From 74a272022eb9c0d4638ebc2e0bbe21c9cec1c103 Mon Sep 17 00:00:00 2001 From: WofWca Date: Mon, 26 Jan 2026 13:18:34 +0400 Subject: [PATCH] fix: look at explosion on suicide, fix FF for mine 1. When killing self with a missile, look at the explosion instead of looking at the center of the world. 2. Make proximity mines not damage teammates, even with `g_friendlyFire 1`. This makes sense since proximity mines already don't damage self. I have checked through all the usages of `inflictor` inside of `G_Damage`: - `player_die() -> Team_FragBonuses`: unused. - `player_die -> LookAtKiller`: used, and it's the point of this commit. - `targ->use`: none of the `use` functions utilize `inflictor`. - `mod == MOD_PROXIMITY_MINE`: also fixes a bug. --- code/game/g_combat.c | 4 ++-- code/game/g_local.h | 2 +- code/game/g_missile.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/game/g_combat.c b/code/game/g_combat.c index 47138f7c..fdfc2689 100644 --- a/code/game/g_combat.c +++ b/code/game/g_combat.c @@ -1135,7 +1135,7 @@ qboolean CanDamage( gentity_t *targ, vec3_t origin ) G_RadiusDamage ============ */ -qboolean G_RadiusDamage ( vec3_t origin, gentity_t *attacker, float damage, float radius, +qboolean G_RadiusDamage ( gentity_t *self, vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, int mod) { float points, dist; gentity_t *ent; @@ -1192,7 +1192,7 @@ qboolean G_RadiusDamage ( vec3_t origin, gentity_t *attacker, float damage, floa // push the center of mass higher than the origin so players // get knocked into the air more dir[2] += 24; - G_Damage (ent, NULL, attacker, dir, origin, (int)points, DAMAGE_RADIUS, mod); + G_Damage (ent, self, attacker, dir, origin, (int)points, DAMAGE_RADIUS, mod); } } diff --git a/code/game/g_local.h b/code/game/g_local.h index 7c8b9a4f..368982bb 100644 --- a/code/game/g_local.h +++ b/code/game/g_local.h @@ -527,7 +527,7 @@ const char *BuildShaderStateConfig( void ); // qboolean CanDamage (gentity_t *targ, vec3_t origin); void G_Damage (gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod); -qboolean G_RadiusDamage (vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, int mod); +qboolean G_RadiusDamage (gentity_t *self, vec3_t origin, gentity_t *attacker, float damage, float radius, gentity_t *ignore, int mod); int G_InvulnerabilityEffect( gentity_t *targ, vec3_t dir, vec3_t point, vec3_t impactpoint, vec3_t bouncedir ); void body_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath ); void TossClientItems( gentity_t *self ); diff --git a/code/game/g_missile.c b/code/game/g_missile.c index 8f3418d2..ce198bac 100644 --- a/code/game/g_missile.c +++ b/code/game/g_missile.c @@ -63,7 +63,7 @@ void G_ExplodeMissile( gentity_t *ent ) { // splash damage if ( ent->splashDamage ) { - if( G_RadiusDamage( ent->r.currentOrigin, ent->parent, ent->splashDamage, ent->splashRadius, ent + if( G_RadiusDamage( ent, ent->r.currentOrigin, ent->parent, ent->splashDamage, ent->splashRadius, ent , ent->splashMethodOfDeath ) ) { g_entities[ent->r.ownerNum].client->accuracy_hits++; } @@ -409,7 +409,7 @@ void G_MissileImpact( gentity_t *ent, trace_t *trace ) { // splash damage (doesn't apply to person directly hit) if ( ent->splashDamage ) { - if( G_RadiusDamage( trace->endpos, ent->parent, ent->splashDamage, ent->splashRadius, + if( G_RadiusDamage( ent, trace->endpos, ent->parent, ent->splashDamage, ent->splashRadius, other, ent->splashMethodOfDeath ) ) { if( !hitClient ) { g_entities[ent->r.ownerNum].client->accuracy_hits++;