]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/weapons/tracing.qc
Add an announcement for the headshot
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / tracing.qc
index b1dbd5d596ef11ceee774920c046633ed4207536..508f91be7821c808a90625da29c821de83a63043 100644 (file)
@@ -364,6 +364,7 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
 
        WarpZone_trace_forent = this;
 
+       bool headshot = false; // indicates that one of the hit targets was a headshot
        for (;;)
        {
                WarpZone_TraceBox_ThroughZone(start, '0 0 0', '0 0 0', end, false, WarpZone_trace_forent, NULL, fireBullet_trace_callback);
@@ -414,7 +415,7 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
                        if(headshot_multiplier && Headshot(hit, this, start, end))
                        {
                                damage *= headshot_multiplier;
-                               // TODO: sound/announcement
+                               headshot = true;
                        }
                        bool gooddamage = accuracy_isgooddamage(this, hit);
                        Damage(hit, this, this, damage * damage_fraction, dtype, weaponentity, start, force * dir * damage_fraction);
@@ -475,6 +476,9 @@ void fireBullet_antilag(entity this, .entity weaponentity, vector start, vector
                        Damage_DamageInfo(start, 0, 0, 0, max(1, force) * normalize(dir) * -damage_fraction, dtype, 0, this);
        }
 
+       if(headshot)
+               Send_Notification(NOTIF_ONE, this, MSG_ANNCE, ANNCE_HEADSHOT);
+
        if(lag)
                antilag_restore_all(this);