]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Introduce a tertiary hittype, splash is already automatically given to AoE damage
authorMario <mario.mario@y7mail.com>
Thu, 1 Aug 2024 10:06:10 +0000 (20:06 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 1 Aug 2024 10:06:10 +0000 (20:06 +1000)
qcsrc/common/deathtypes/all.qh
qcsrc/common/weapons/weapon/electro.qc
qcsrc/server/damage.qc

index f4b49801872c8be06fff89cd4a04e08dca055312..48c94ad8467937a5aeba4174ff1cbed987eabb76 100644 (file)
@@ -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)
index 1630ebf1fe6803e152bed0b3a1c0841a43ef2f47..a71c8c5452447c3612f6c97937379f13a71f6ac3 100644 (file)
@@ -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)
index 9b101d456e717bfd6d01899c66d6a80c9ddd0b0c..ba639d9ec443575078a8fd304fb531699b2828f4 100644 (file)
@@ -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;