There. Push this back on to unc0rr. This effect can still desync, 'cause it always could, but at least now the two are linked w/o argument I think.
authornemo
Thu, 08 Sep 2011 21:18:44 -0400
changeset 5818 d071162d550d
parent 5816 ceb522b0f7d5
child 5820 c9fe3b376a84
There. Push this back on to unc0rr. This effect can still desync, 'cause it always could, but at least now the two are linked w/o argument I think.
hedgewars/HHHandlers.inc
hedgewars/uTeams.pas
--- 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
--- a/hedgewars/uTeams.pas	Fri Sep 09 03:04:15 2011 +0200
+++ b/hedgewars/uTeams.pas	Thu Sep 08 21:18:44 2011 -0400
@@ -529,9 +529,6 @@
 with TeamsArray[t]^ do
     begin
     AddChatString('** '+ TeamName + ' is gone');
-    for i:= 0 to cMaxHHIndex do
-        if Hedgehogs[i].GearHidden <> nil then
-            RestoreHog(@Hedgehogs[i]);
     hasGone:= true
     end;