From ef816018ba83f43d72ba70e41fade1fd792587ab Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 1 Aug 2024 20:06:10 +1000 Subject: [PATCH] Introduce a tertiary hittype, splash is already automatically given to AoE damage --- qcsrc/common/deathtypes/all.qh | 5 +++-- qcsrc/common/weapons/weapon/electro.qc | 2 +- qcsrc/server/damage.qc | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qcsrc/common/deathtypes/all.qh b/qcsrc/common/deathtypes/all.qh index f4b498018..48c94ad84 100644 --- a/qcsrc/common/deathtypes/all.qh +++ b/qcsrc/common/deathtypes/all.qh @@ -28,9 +28,10 @@ const int HITTYPE_SPLASH = BITS(1) << 9; const int HITTYPE_BOUNCE = BITS(1) << 10; const int HITTYPE_ARMORPIERCE = BITS(1) << 11; const int HITTYPE_SOUND = BITS(1) << 12; -const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_ARMORPIERCE | HITTYPE_SOUND; +const int HITTYPE_TERTIARY = BITS(1) << 13; +const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_ARMORPIERCE | HITTYPE_SOUND | HITTYPE_TERTIARY; // normal deaths begin -const int DT_FIRST = BIT(13); +const int DT_FIRST = BIT(14); #define DEATH_ISSPECIAL(t) (t >= DT_FIRST) #define DEATH_IS(t, dt) (DEATH_ISSPECIAL(t) && (REGISTRY_GET(Deathtypes, t - DT_FIRST)) == dt) diff --git a/qcsrc/common/weapons/weapon/electro.qc b/qcsrc/common/weapons/weapon/electro.qc index 1630ebf1f..a71c8c545 100644 --- a/qcsrc/common/weapons/weapon/electro.qc +++ b/qcsrc/common/weapons/weapon/electro.qc @@ -65,7 +65,7 @@ void W_Electro_ExplodeComboThink(entity this) float edgedamage = this.dmg_edge * PHYS_INPUT_TIMELENGTH; RadiusDamage(this, this.realowner, damage, edgedamage, this.dmg_radius, NULL, NULL, 0, this.projectiledeathtype, this.weaponentity_fld, NULL); - this.projectiledeathtype |= HITTYPE_SPLASH; // ensure it doesn't spam its effect + this.projectiledeathtype |= HITTYPE_TERTIARY; // ensure it doesn't spam its effect } void W_Electro_ExplodeCombo(entity this) diff --git a/qcsrc/server/damage.qc b/qcsrc/server/damage.qc index 9b101d456..ba639d9ec 100644 --- a/qcsrc/server/damage.qc +++ b/qcsrc/server/damage.qc @@ -895,7 +895,7 @@ float RadiusDamageForSource (entity inflictor, vector inflictororigin, vector in total_damage_to_creatures = 0; - if(deathtype != (WEP_HOOK.m_id | HITTYPE_SECONDARY | HITTYPE_BOUNCE) && deathtype != (WEP_ELECTRO.m_id | HITTYPE_BOUNCE | HITTYPE_SPLASH)) // only send damage over time bombs once + if(deathtype != (WEP_HOOK.m_id | HITTYPE_SECONDARY | HITTYPE_BOUNCE) && deathtype != (WEP_ELECTRO.m_id | HITTYPE_BOUNCE | HITTYPE_TERTIARY)) // only send damage over time bombs once if(!(deathtype & HITTYPE_SOUND)) // do not send radial sound damage (bandwidth hog) { force = inflictorvelocity; -- 2.39.2