make unplaced hogs a bit less interactive
authornemo
Tue, 26 Apr 2022 14:35:21 -0400
changeset 15841 e111e5acde64
parent 15840 8553c51a9ec8
child 15842 4172debdff61
make unplaced hogs a bit less interactive
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsHandlersMess.pas	Wed Apr 20 15:35:48 2022 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Tue Apr 26 14:35:21 2022 -0400
@@ -2201,7 +2201,7 @@
         for t:= 0 to Pred(TeamsCount) do
             with TeamsArray[t]^ do
                 for i:= 0 to cMaxHHIndex do
-                    if (Hedgehogs[i].Gear <> nil) and (Hedgehogs[i].Effects[heFrozen] = 0) then
+                    if (not Hedgehogs[i].Unplaced) and (Hedgehogs[i].Gear <> nil) and (Hedgehogs[i].Effects[heFrozen] = 0) and ((Hedgehogs[i].Gear^.State and gstInvisible) = 0) then
                         begin
                         tmpG:= Hedgehogs[i].Gear;
                         tX:=Gear^.X-tmpG^.X;
--- a/hedgewars/uGearsUtils.pas	Wed Apr 20 15:35:48 2022 +0200
+++ b/hedgewars/uGearsUtils.pas	Tue Apr 26 14:35:21 2022 -0400
@@ -1093,7 +1093,7 @@
                 with TeamsArray[j]^ do
                     for i:= 0 to cMaxHHIndex do
                         with Hedgehogs[i] do
-                            if (Gear <> nil) and (Gear <> exclude) then
+                            if (not Unplaced) and (Gear <> nil) and (Gear <> exclude) then
                                 begin
                                 // code duplication - could throw into an inline function I guess
                                 dX := X - Gear^.X;