]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hittype for sound-based attacks that cause bleeding to come from ears instead...
authorMario <mario@smbclan.net>
Sat, 27 Jul 2019 03:52:14 +0000 (13:52 +1000)
committerMario <mario@smbclan.net>
Sat, 27 Jul 2019 03:52:14 +0000 (13:52 +1000)
qcsrc/common/deathtypes/all.qh
qcsrc/common/weapons/weapon/tuba.qc
qcsrc/server/player.qc

index beb8e3e912221911705429fe210042762ed51cb0..2169c8bd762bd3abe5e708e1f24e1b8b99333740 100644 (file)
@@ -26,9 +26,8 @@ const int HITTYPE_SECONDARY = BITS(1) << 8;
 const int HITTYPE_SPLASH = BITS(1) << 9;
 const int HITTYPE_BOUNCE = BITS(1) << 10;
 const int HITTYPE_ARMORPIERCE = BITS(1) << 11;
-// unused yet
-const int HITTYPE_RESERVED = BITS(1) << 12;
-const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_ARMORPIERCE | HITTYPE_RESERVED;
+const int HITTYPE_SOUND = BITS(1) << 12;
+const int DEATH_HITTYPEMASK = HITTYPE_SECONDARY | HITTYPE_SPLASH | HITTYPE_BOUNCE | HITTYPE_ARMORPIERCE | HITTYPE_SOUND;
 // normal deaths begin
 const int DT_FIRST = BIT(13);
 
index eb780808932fcd471d96d4727f6aa9cf6aae87a0..bf5fa0c98f271a2c012a49c7807c55c438fa4794 100644 (file)
@@ -268,7 +268,7 @@ void W_Tuba_NoteOn(entity actor, .entity weaponentity, float hittype)
        vector o;
        float n = W_Tuba_GetNote(actor, hittype);
 
-       hittype = 0;
+       hittype = HITTYPE_SOUND;
        if(actor.(weaponentity).tuba_instrument & 1)
                hittype |= HITTYPE_SECONDARY;
        if(actor.(weaponentity).tuba_instrument & 2)
index b8d3c903c541cab860c1f596bf118037d534d017..c39f59e7213d3edad4bcbab165b01e7e091ccff5 100644 (file)
@@ -329,9 +329,8 @@ void PlayerDamage(entity this, entity inflictor, entity attacker, float damage,
                if (time < this.spawnshieldtime && autocvar_g_spawnshield_blockdamage < 1)
                        damage *= 1 - max(0, autocvar_g_spawnshield_blockdamage);
 
-               if(DEATH_ISWEAPON(deathtype, WEP_TUBA))
+               if(deathtype & HITTYPE_SOUND) // sound based attacks cause bleeding from the ears
                {
-                       // tuba causes blood to come out of the ears
                        vector ear1, ear2;
                        vector d;
                        float f;