hedgewars/uGearsHandlersRope.pas
changeset 12656 5e115ed19e27
parent 11836 dd18d8100afd
child 12697 cb6b70392459
--- a/hedgewars/uGearsHandlersRope.pas	Thu Oct 05 02:02:28 2017 +0200
+++ b/hedgewars/uGearsHandlersRope.pas	Thu Oct 05 02:54:17 2017 +0200
@@ -441,6 +441,17 @@
         end
     else if not CurrentTeam^.ExtDriven and (FollowGear <> nil) then FollowGear := HHGear;
 
+    // Destroy rope if it touched bouncy or world wrap world edge.
+    // TODO: Allow to shoot rope through the world wrap edge and rope normally.
+    if (WorldWrap(Gear) and (WorldEdge = weWrap)) or
+       ((WorldEdge = weBounce) and ((hwRound(Gear^.X) <= LeftX) or (hwRound(Gear^.X) >= RightX))) then
+        begin
+        HHGear^.State := HHGear^.State and (not (gstAttacking or gstHHJumping or gstHHHJump));
+        HHGear^.Message := HHGear^.Message and (not gmAttack);
+        DeleteGear(Gear);
+        exit()
+        end;
+
     DeleteCI(HHGear);
 
     if (HHGear^.State and gstMoving) <> 0 then