Restore hog on team gone
authornemo
Thu, 08 Sep 2011 13:01:20 -0400
changeset 5812 91d9de564ef5
parent 5811 2a9438e8adbf
child 5813 d5e9c22c59a2
Restore hog on team gone
hedgewars/uGears.pas
hedgewars/uTeams.pas
--- a/hedgewars/uGears.pas	Thu Sep 08 17:44:51 2011 +0200
+++ b/hedgewars/uGears.pas	Thu Sep 08 13:01:20 2011 -0400
@@ -43,6 +43,8 @@
 function  GetAmmo: TAmmoType;
 function  GetUtility: TAmmoType;
 procedure ResurrectHedgehog(gear: PGear);
+procedure HideHog(HH: PHedgehog);
+procedure RestoreHog(HH: PHedgehog);
 procedure ProcessGears;
 procedure EndTurnCleanup;
 procedure ApplyDamage(Gear: PGear; AttackerHog: PHedgehog; Damage: Longword; Source: TDamageSource);
--- a/hedgewars/uTeams.pas	Thu Sep 08 17:44:51 2011 +0200
+++ b/hedgewars/uTeams.pas	Thu Sep 08 13:01:20 2011 -0400
@@ -518,7 +518,7 @@
 end;
 
 procedure chTeamGone(var s:shortstring);
-var t: LongInt;
+var t, i: LongInt;
 begin
 t:= 0;
 while (t < cMaxTeams)
@@ -529,6 +529,9 @@
 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;