remove wiggle throttling in anticipation of a real collision fix 🥁
authoralfadur
Wed, 24 Jun 2020 19:50:58 +0300
changeset 15652 c9fec197335a
parent 15651 c8f672ae2371
child 15653 b2ed495a7fb1
remove wiggle throttling in anticipation of a real collision fix 🥁
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsRender.pas
--- a/hedgewars/uGearsHandlersMess.pas	Wed Jun 24 17:27:57 2020 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Wed Jun 24 19:50:58 2020 +0300
@@ -1943,17 +1943,6 @@
         HHGear^.State := HHGear^.State and (not gstNoDamage);
         end;
 
-    if HHGear^.dX.isNegative <> (Gear^.Tag = -1) then
-    begin
-        inc(Gear^.WDTimer);
-        if Gear^.WDTimer > 150 then
-        begin
-            Gear^.WDTimer := 0;
-            Gear^.Tag := - Gear^.Tag;
-        end
-    end else
-        Gear^.WDTimer := 0;
-
     if (TurnTimeLeft = 0) or (Gear^.Timer = 0)
     or ((HHGear^.Message and gmAttack) <> 0) then
         begin
@@ -1985,13 +1974,6 @@
     HHGear^.State := HHGear^.State or gstNotKickable;
     RefillProximityCache(Gear, 200);
 
-    //Throttle counter for direction changes
-    Gear^.WDTimer := 0;
-    if HHGear^.dX.isNegative then
-        Gear^.Tag := -1
-    else
-        Gear^.Tag := 1;
-
     Gear^.SoundChannel := LoopSound(sndBlowTorch);
     Gear^.doStep := @doStepBlowTorchWork
 end;
--- a/hedgewars/uGearsRender.pas	Wed Jun 24 17:27:57 2020 +0200
+++ b/hedgewars/uGearsRender.pas	Wed Jun 24 19:50:58 2020 +0300
@@ -315,14 +315,9 @@
     // render crosshair
     if (CrosshairGear <> nil) and (Gear = CrosshairGear) then
         begin
-        if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtBlowTorch) then
-            hogLR:= CurAmmoGear^.Tag
-        else
-            begin
-            hogLR:= 1;
-            if IsHogFacingLeft(Gear) then
-                hogLR:= -1
-            end;
+        hogLR:= 1;
+        if IsHogFacingLeft(Gear) then
+            hogLR:= -1;
         setTintAdd(true);
         Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
         DrawTextureRotated(CrosshairTexture,
@@ -421,8 +416,6 @@
         hogLR:= -1
     else
         hogLR:= 1;
-    if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtBlowTorch) then
-        hogLR:= CurAmmoGear^.Tag;
 
     if (Gear^.State and gstHHDeath) <> 0 then
         begin
@@ -669,7 +662,6 @@
                     end;
                 gtBlowTorch:
                     begin
-                    sign:= CurAmmoGear^.Tag;
                     DrawSpriteRotated(sprBlowTorch, ox + 8 * sign, oy - 2, sign, aangle);
                     DrawHedgehog(ox + 1, oy - 3,
                             sign,