Stop using dsUnknown, replace with concrete damage sources
authorWuzzy <Wuzzy2@mail.ru>
Wed, 31 Oct 2018 13:08:56 +0100
changeset 14061 128fbd36eee4
parent 14060 aeac678d7c79
child 14062 44f20c9e6861
Stop using dsUnknown, replace with concrete damage sources
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsUtils.pas
hedgewars/uTypes.pas
--- a/hedgewars/uGearsHandlersMess.pas	Tue Oct 30 23:57:57 2018 +0100
+++ b/hedgewars/uGearsHandlersMess.pas	Wed Oct 31 13:08:56 2018 +0100
@@ -5806,7 +5806,7 @@
                     dmg:= dmg div Gear^.Boom;
 
                     if dmg > 0 then
-                        ApplyDamage(tmp, CurrentHedgehog, dmg, dsUnknown);
+                        ApplyDamage(tmp, CurrentHedgehog, dmg, dsHammer);
                     end;
 		tmp^.dY:= _0_03 * Gear^.Boom
                 end;
--- a/hedgewars/uGearsUtils.pas	Tue Oct 30 23:57:57 2018 +0100
+++ b/hedgewars/uGearsUtils.pas	Wed Oct 31 13:08:56 2018 +0100
@@ -1394,7 +1394,7 @@
                 begin
                 if (Ammo^.Hedgehog^.Gear <> nil) then
                     Ammo^.Hedgehog^.Gear^.State:= Ammo^.Hedgehog^.Gear^.State and (not gstNotKickable);
-                ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch
+                ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsExplosion); // crank up damage for explosives + blowtorch
                 end;
 
             if (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.King or (Gear^.Hedgehog^.Effects[heFrozen] > 0)) then
--- a/hedgewars/uTypes.pas	Tue Oct 30 23:57:57 2018 +0100
+++ b/hedgewars/uTypes.pas	Wed Oct 31 13:08:56 2018 +0100
@@ -121,7 +121,7 @@
             vgtSmoothWindBar, vgtStraightShot, vgtNoPlaceWarn);
 
     // Damage can be caused by different sources
-    TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison);
+    TDamageSource = (dsUnknown, dsFall, dsBullet, dsExplosion, dsShove, dsPoison, dsHammer);
 
     // Available sounds
     TSound = (sndNone,