Fix minigun bullets hitting shooter when it hits hog on other side of world wrap
authoralfadur
Thu, 12 Apr 2018 01:51:38 +0200
changeset 13318 9071600f7b22
parent 13317 ab3fe9f302d5
child 13319 78f097923bcb
Fix minigun bullets hitting shooter when it hits hog on other side of world wrap
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsHandlersMess.pas	Thu Apr 12 00:40:10 2018 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Thu Apr 12 01:51:38 2018 +0200
@@ -1358,6 +1358,9 @@
             Gear^.Elasticity:= Gear^.X;
             Gear^.Friction:= Gear^.Y;
             SpawnBulletTrail(Gear, Gear^.X, Gear^.Y, false);
+
+            // bullets can now hurt the hog that fired them
+            if WorldEdge <> weSea then Gear^.Data:= nil;
             end;
         x := hwRound(Gear^.X);
         y := hwRound(Gear^.Y);
--- a/hedgewars/uGearsUtils.pas	Thu Apr 12 00:40:10 2018 +0200
+++ b/hedgewars/uGearsUtils.pas	Thu Apr 12 01:51:38 2018 +0200
@@ -1636,9 +1636,6 @@
 if (hwRound(Gear^.X) < LongInt(leftX)) or
    (hwRound(Gear^.X) > LongInt(rightX)) then
     begin
-    // bullets can now hurt the hog that fired them
-    if (WorldEdge <> weSea) and (Gear^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet]) then
-        Gear^.Data:= nil;
     if WorldEdge = weWrap then
         begin
         if (hwRound(Gear^.X) < LongInt(leftX)) then