okay, let's revert this for now 0.9.16
authorunc0rr
Sat, 17 Sep 2011 21:48:18 +0400
branch0.9.16
changeset 5956 39d8cdee4391
parent 5953 57af6f3abf4a (current diff)
parent 5954 2aead3f940b0 (diff)
child 5957 a6224655647c
okay, let's revert this for now
--- a/ChangeLog.txt	Sat Sep 17 19:43:45 2011 +0200
+++ b/ChangeLog.txt	Sat Sep 17 21:48:18 2011 +0400
@@ -52,7 +52,8 @@
  * Various bug/leak fixes
 
 Frontend/Menu and Netgame:
- + Drawing straight lines in drawn map mode
+ + Drawing straight lines in drawn map mode (hold down the control key when clicking, then move mouse to end point and release).
+ + Undo clear in drawn map mode
  + Autokick ignored players joining your room
  + Improved nick sorting in lobby and rooms. (not case-sensitive, letters first, friend @ top, ignored @ bottom)
  + Display player count in lobby
--- a/hedgewars/HHHandlers.inc	Sat Sep 17 19:43:45 2011 +0200
+++ b/hedgewars/HHHandlers.inc	Sat Sep 17 21:48:18 2011 +0400
@@ -1016,7 +1016,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepHedgehogFree(Gear: PGear);
-var prevState: Longword;
+var prevState, i: Longword;
 begin
 prevState:= Gear^.State;
 
@@ -1038,7 +1038,7 @@
         PrvInactive:= false;
         AllInactive:= false;
 
-        if (Gear^.State and gstHHGone) = 0 then
+        if not Gear^.Hedgehog^.Team^.hasGone then
             begin
             Gear^.Hedgehog^.Effects[hePoisoned] := false;
             if Gear^.Hedgehog^.Effects[heResurrectable] then begin
@@ -1052,8 +1052,21 @@
             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
@@ -1094,9 +1107,7 @@
 else
     begin
     with Gear^.Hedgehog^ do
-        if Team^.hasGone then 
-            TeamGoneEffect(Team^)
-        else
-            doStepHedgehogDriven(Gear)
+        if Team^.hasGone then TeamGoneEffect(Team^);
+    doStepHedgehogDriven(Gear)
     end;
 end;
--- a/hedgewars/uTeams.pas	Sat Sep 17 19:43:45 2011 +0200
+++ b/hedgewars/uTeams.pas	Sat Sep 17 21:48:18 2011 +0400
@@ -427,17 +427,11 @@
 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
+                Gear^.Damage:= Gear^.Health
                 end
-            end
 end;
 
 procedure chAddHH(var id: shortstring);