Add support for proper rendering of gtPoisonCloud with Timer > 5000
authorWuzzy <Wuzzy2@mail.ru>
Sat, 26 Oct 2019 23:48:57 +0200
changeset 15486 d668fcb9307e
parent 15485 91c972f126b7
child 15487 91f0c5ec37b5
Add support for proper rendering of gtPoisonCloud with Timer > 5000
hedgewars/uGearsList.pas
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsList.pas	Sat Oct 26 22:44:15 2019 +0200
+++ b/hedgewars/uGearsList.pas	Sat Oct 26 23:48:57 2019 +0200
@@ -772,6 +772,7 @@
                 end;
  gtPoisonCloud: begin
                 if gear^.Timer = 0 then gear^.Timer:= 5000;
+                gear^.WDTimer:= gear^.Timer; // initial timer
                 gear^.dY:= int2hwfloat(-4 + longint(getRandom(8))) / 1000;
                 gear^.Tint:= $C0C000C0
                 end;
--- a/hedgewars/uGearsRender.pas	Sat Oct 26 22:44:15 2019 +0200
+++ b/hedgewars/uGearsRender.pas	Sat Oct 26 23:48:57 2019 +0200
@@ -1656,8 +1656,8 @@
      gtPoisonCloud: begin
                     if Gear^.Timer < 1020 then
                         Tint(Gear^.Tint and $FFFFFF00 or Gear^.Timer div 8)
-                    else if Gear^.Timer > 3980 then
-                        Tint(Gear^.Tint and $FFFFFF00 or (5000 - Gear^.Timer) div 8)
+                    else if (Gear^.Timer > Gear^.WDTimer - 1020) and (Gear^.WDTimer > 2040) then
+                        Tint(Gear^.Tint and $FFFFFF00 or (Gear^.WDTimer - Gear^.Timer) div 8)
                     else
                         Tint(Gear^.Tint);
                     DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 4 + Gear^.UID * 100) mod 360);