- Fix counting damage given to mines
authorunc0rr
Tue, 01 Apr 2008 16:11:07 +0000
changeset 831 5cfd1096be5f
parent 830 f07267032194
child 832 6803d70875f3
- Fix counting damage given to mines - Use damaging ammo info to produce 'missed' sound only if damage should take place
hedgewars/uGears.pas
hedgewars/uStats.pas
--- a/hedgewars/uGears.pas	Tue Apr 01 16:05:19 2008 +0000
+++ b/hedgewars/uGears.pas	Tue Apr 01 16:11:07 2008 +0000
@@ -776,9 +776,11 @@
                           if (Mask and EXPLNoDamage) = 0 then
                              begin
                              inc(Gear^.Damage, dmg);
-                             uStats.HedgehogDamaged(Gear, dmg);
                              if Gear^.Kind = gtHedgehog then
+                                begin
+                                uStats.HedgehogDamaged(Gear, dmg);
                                 AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), dmg, Gear)
+                                end
                              end;
                           if ((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog) then
                              begin
--- a/hedgewars/uStats.pas	Tue Apr 01 16:05:19 2008 +0000
+++ b/hedgewars/uStats.pas	Tue Apr 01 16:11:07 2008 +0000
@@ -65,7 +65,7 @@
 else if CurrentHedgehog^.stats.StepDamageRecv > 0 then PlaySound(sndStupid, false)
 else if DamageClan <> 0 then
 else if DamageGiven <> 0 then
-else PlaySound(sndMissed, false);
+else if AmmoDamagingUsed then PlaySound(sndMissed, false);
 
 Gear:= GearsList;
 while Gear <> nil do