hedgewars/uGearsHandlersMess.pas
changeset 12742 d08afea02908
parent 12719 5a57acce9cae
child 12748 f45ffb4cf1e1
--- a/hedgewars/uGearsHandlersMess.pas	Sun Oct 22 00:48:38 2017 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Sun Oct 22 02:25:27 2017 +0200
@@ -994,11 +994,14 @@
 var
     t: hwFloat;
     gX,gY,i: LongInt;
-    uw, nuw: boolean;
+    uw, nuw, wrapped: boolean;
     flower: PVisualGear;
 
 begin
-    WorldWrap(Gear);
+    wrapped:= WorldWrap(Gear);
+    if wrapped then
+        HomingWrap(Gear);
+
     AllInactive := false;
     gX := hwRound(Gear^.X);
     gY := hwRound(Gear^.Y);
@@ -1116,6 +1119,9 @@
 
         Gear^.SoundChannel := LoopSound(sndBee);
         Gear^.Timer := 5000;
+
+        HomingWrap(Gear);
+
         // save initial speed in otherwise unused Friction variable
         Gear^.Friction := Distance(Gear^.dX, Gear^.dY);
         Gear^.doStep := @doStepBeeWork