rearrange fall damage a bit so invulnerability still causes dust
authornemo
Fri, 26 Feb 2010 00:03:57 +0000
changeset 2871 eec42a0b7014
parent 2870 1358cc003e4d
child 2872 6e911d72263a
rearrange fall damage a bit so invulnerability still causes dust
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Thu Feb 25 23:28:26 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Fri Feb 26 00:03:57 2010 +0000
@@ -93,23 +93,24 @@
 	i: LongInt;
 	particle: PVisualGear;
 begin
-if(Gear^.Invulnerable) then exit;
 if _0_4 < Gear^.dY then
 	begin
 	dmg:= ModifyDamage(1 + hwRound((hwAbs(Gear^.dY) - _0_4) * 70), Gear);
     if dmg < 1 then exit;
 
+	for i:= min(12, (3 + dmg div 10)) downto 0 do begin
+		particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
+        if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX / 5);
+		end;
+
+    if(Gear^.Invulnerable) then exit;
+
 	if _0_6 < Gear^.dY then
 		PlaySound(sndOw4, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack)
 	else
 		PlaySound(sndOw1, PHedgehog(Gear^.Hedgehog)^.Team^.voicepack);
 
-	for i:= min(12, (3 + dmg div 10)) downto 0 do begin
-		particle := AddVisualGear(hwRound(Gear^.X) - 5 + Random(10), hwRound(Gear^.Y) + 12, vgtDust);
-        if particle <> nil then particle^.dX := particle^.dX + (Gear^.dX / 5);
-		end;
-		
-  ApplyDamage(Gear, dmg);
+    ApplyDamage(Gear, dmg);
 	end
 end;