hedgewars/HHHandlers.inc
changeset 5818 d071162d550d
parent 5720 a962d0823f49
child 5820 c9fe3b376a84
--- a/hedgewars/HHHandlers.inc	Fri Sep 09 03:04:15 2011 +0200
+++ b/hedgewars/HHHandlers.inc	Thu Sep 08 21:18:44 2011 -0400
@@ -1012,7 +1012,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepHedgehogFree(Gear: PGear);
-var prevState: Longword;
+var prevState,i: Longword;
 begin
 prevState:= Gear^.State;
 
@@ -1050,6 +1050,19 @@
             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
+                            Gear^.State:= Gear^.State or gstHHGone;
+                            Gear^.doStep:= @doStepHedgehogGone
+                            end
+                        end;
+
             // Gone message
             AddCaption(Format(GetEventString(eidGone), Gear^.Hedgehog^.Name), cWhiteColor, capgrpMessage);
             end