Move HealthTag dY init into AddGear
authornemo
Mon, 15 Aug 2011 16:48:39 -0400
changeset 5576 bf30c60786a5
parent 5575 41ee1c71deb3
child 5578 153e32989646
Move HealthTag dY init into AddGear
hedgewars/VGSHandlers.inc
hedgewars/uVisualGears.pas
--- a/hedgewars/VGSHandlers.inc	Mon Aug 15 19:42:39 2011 +0200
+++ b/hedgewars/VGSHandlers.inc	Mon Aug 15 16:48:39 2011 -0400
@@ -515,17 +515,15 @@
 begin
 s:= '';
 
-Gear^.dY:= -0.08;
-
 str(Gear^.State, s);
 if Gear^.Hedgehog <> nil then
     Gear^.Tex:= RenderStringTex(s, Gear^.Hedgehog^.Team^.Clan^.Color, fnt16)
 else
     Gear^.Tex:= RenderStringTex(s, cWhiteColor, fnt16);
 
-if round(Gear^.Y) < cWaterLine then
-    Gear^.doStep:= @doStepHealthTagWork
-else
+Gear^.doStep:= @doStepHealthTagWork
+
+if (round(Gear^.Y) < cWaterLine) and (Frame = 0)  then
     Gear^.doStep:= @doStepHealthTagWorkUnderWater;
 
 Gear^.Y:= Gear^.Y - Gear^.Tex^.h;
--- a/hedgewars/uVisualGears.pas	Mon Aug 15 19:42:39 2011 +0200
+++ b/hedgewars/uVisualGears.pas	Mon Aug 15 16:48:39 2011 -0400
@@ -282,6 +282,7 @@
   vgtHealthTag: begin
                 Frame:= 0;
                 Timer:= 1500;
+                dY:= -0.08;
                 //gear^.Z:= 2002;
                 end;
   vgtSmokeTrace,