hedgewars/HHHandlers.inc
changeset 5829 3ec95dc2b249
parent 5820 c9fe3b376a84
child 5830 ea4d1fe665d7
--- a/hedgewars/HHHandlers.inc	Fri Sep 09 15:52:59 2011 +0200
+++ b/hedgewars/HHHandlers.inc	Fri Sep 09 22:04:40 2011 +0400
@@ -1034,7 +1034,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
@@ -1048,21 +1048,8 @@
             end
         else
             begin
-            Gear^.State:= Gear^.State or gstHHGone;
             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
@@ -1103,7 +1090,9 @@
 else
     begin
     with Gear^.Hedgehog^ do
-        if Team^.hasGone then TeamGoneEffect(Team^);
-    doStepHedgehogDriven(Gear)
+        if Team^.hasGone then 
+            TeamGoneEffect(Team^)
+        else
+            doStepHedgehogDriven(Gear)
     end;
 end;