]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
detect headshots for minstanex again
authorRudolf Polzer <divverent@xonotic.org>
Tue, 17 Apr 2012 09:36:30 +0000 (11:36 +0200)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 17 Apr 2012 09:36:30 +0000 (11:36 +0200)
qcsrc/server/g_damage.qc
qcsrc/server/w_minstanex.qc

index 7477e8e730577f7dedca8d3c7eeaaa25b9c6c31c..1fd0734a617f0a11a9074c4f7c1b571b7a6a1e69 100644 (file)
@@ -806,7 +806,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                if(targ.takedamage == DAMAGE_AIM)
                if(targ != attacker)
                {
-                       if(damage_headshotbonus > 0)
+                       if(damage_headshotbonus)
                        {
                                if(targ.classname == "player")
                                {
@@ -827,7 +827,8 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                                        deathtype |= HITTYPE_HEADSHOT;
                                }
                                if(deathtype & HITTYPE_HEADSHOT)
-                                       damage *= 1 + damage_headshotbonus;
+                                       if(damage_headshotbonus > 0)
+                                               damage *= 1 + damage_headshotbonus;
                        }
 
                        entity victim;
index aa85079052a933081b0b11e20b737c1919196628..1f1137e4b845b151321d1501c5dbdca9e325b2fd 100644 (file)
@@ -15,7 +15,9 @@ void W_MinstaNex_Attack (void)
        yoda = 0;
        damage_goodhits = 0;
        headshot = 0;
+       damage_headshotbonus = -1; // no extra damage, just count
        FireRailgunBullet (w_shotorg, w_shotorg + w_shotdir * MAX_SHOT_DISTANCE, 10000, 800, 0, 0, 0, 0, WEP_MINSTANEX);
+       damage_headshotbonus = 0;
 
        if(g_minstagib)
        {