hedgewars/uTeams.pas
changeset 1355 8e167aa3b2e4
parent 1354 a8dcdeb88a43
child 1356 77ab8735401d
--- a/hedgewars/uTeams.pas	Wed Oct 15 11:50:16 2008 +0000
+++ b/hedgewars/uTeams.pas	Wed Oct 15 11:54:06 2008 +0000
@@ -372,9 +372,18 @@
 	AddChatString('* '+ TeamName + ' is gone');
 	for i:= 0 to cMaxHHIndex do
 		with Hedgehogs[i] do
-			Gear^.State:= Gear^.State and not gstHHDriven;
+			if Gear <> nil then
+				begin
+				if Gear^.State and gstAttacking <> 0 then
+					AttackBar:= 0;
+					
+				Gear^.State:= Gear^.State and not gstHHDriven
+				end;
+
 	hasGone:= true
-	end
+	end;
+	
+RecountTeamHealth(TeamsArray[i])
 end;
 
 initialization