vgtHealthTag now supports setting FrameTicks <> 0 to disable automatic water handling
authorWuzzy <Wuzzy2@mail.ru>
Tue, 22 Jan 2019 07:12:02 +0100
changeset 14662 b390479f24c1
parent 14661 db05d9bf7466
child 14663 93a7b78259fb
vgtHealthTag now supports setting FrameTicks <> 0 to disable automatic water handling
hedgewars/uVisualGearsHandlers.pas
hedgewars/uVisualGearsList.pas
--- a/hedgewars/uVisualGearsHandlers.pas	Mon Jan 21 23:50:56 2019 +0100
+++ b/hedgewars/uVisualGearsHandlers.pas	Tue Jan 22 07:12:02 2019 +0100
@@ -706,8 +706,10 @@
 if round(Gear^.Y) - 10 < cWaterLine then
     DeleteVisualGear(Gear)
 else
-    Gear^.Y:= Gear^.Y - 0.08 * Steps;
-
+    begin
+    Gear^.X:= Gear^.X + Gear^.dX * Steps;
+    Gear^.Y:= Gear^.Y + Gear^.dY * Steps;
+    end;
 end;
 
 procedure doStepHealthTag(Gear: PVisualGear; Steps: Longword);
@@ -722,7 +724,7 @@
 
 Gear^.doStep:= @doStepHealthTagWork;
 
-if (round(Gear^.Y) > cWaterLine) and (Gear^.Frame = 0)  then
+if (round(Gear^.Y) > cWaterLine) and (Gear^.Frame = 0) and (Gear^.FrameTicks = 0) then
     Gear^.doStep:= @doStepHealthTagWorkUnderWater;
 
 Gear^.Y:= Gear^.Y - Gear^.Tex^.h;
--- a/hedgewars/uVisualGearsList.pas	Mon Jan 21 23:50:56 2019 +0100
+++ b/hedgewars/uVisualGearsList.pas	Tue Jan 22 07:12:02 2019 +0100
@@ -274,6 +274,7 @@
   vgtHealthTag:
                 begin
                 Frame:= 0;
+                FrameTicks:= 0;
                 Timer:= 1500;
                 dY:= -0.08;
                 dX:= 0;