Fix sheepluva's merge
authorunc0rr
Thu, 22 Sep 2011 17:19:39 +0400
changeset 5991 c3b7064d9226
parent 5990 578978418fe5
child 5992 a311b8461ec9
Fix sheepluva's merge
hedgewars/HHHandlers.inc
hedgewars/uTeams.pas
--- a/hedgewars/HHHandlers.inc	Thu Sep 22 14:02:44 2011 +0200
+++ b/hedgewars/HHHandlers.inc	Thu Sep 22 17:19:39 2011 +0400
@@ -1039,7 +1039,7 @@
         PrvInactive:= false;
         AllInactive:= false;
 
-        if not Gear^.Hedgehog^.Team^.hasGone then
+        if (Gear^.State and gstHHGone) = 0 then
             begin
             Gear^.Hedgehog^.Effects[hePoisoned] := false;
             if Gear^.Hedgehog^.Effects[heResurrectable] then begin
@@ -1054,21 +1054,9 @@
             end
         else
             begin
-            Gear^.State:= (Gear^.State or gstHHGone) and not gstAnimation;
+            Gear^.State:= Gear^.State and not gstAnimation;
             Gear^.doStep:= @doStepHedgehogGone;
 
-            with Gear^.Hedgehog^.Team^ do
-                for i:= 0 to cMaxHHIndex do
-                    if Hedgehogs[i].GearHidden <> nil then
-                        begin
-                        RestoreHog(@Hedgehogs[i]);
-                        if Hedgehogs[i].Gear <> nil then 
-                            begin
-                            Hedgehogs[i].Gear^.State:= Gear^.State or gstHHGone;
-                            Hedgehogs[i].Gear^.doStep:= @doStepHedgehogGone
-                            end
-                        end;
-
             // Gone message
             AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
             end
--- a/hedgewars/uTeams.pas	Thu Sep 22 14:02:44 2011 +0200
+++ b/hedgewars/uTeams.pas	Thu Sep 22 17:19:39 2011 +0400
@@ -427,12 +427,17 @@
 with Team do
     for i:= 0 to cMaxHHIndex do
         with Hedgehogs[i] do
+            begin
+            if Hedgehogs[i].GearHidden <> nil then
+                RestoreHog(@Hedgehogs[i]);
+
             if Gear <> nil then
                 begin
                 Gear^.Invulnerable:= false;
                 Gear^.Damage:= Gear^.Health;
                 Gear^.State:= (Gear^.State or gstHHGone) and not gstHHDriven
                 end
+            end
 end;
 
 procedure chAddHH(var id: shortstring);