hedgewars/uTeams.pas
changeset 5812 91d9de564ef5
parent 5638 e35ba2a400d8
child 5818 d071162d550d
equal deleted inserted replaced
5811:2a9438e8adbf 5812:91d9de564ef5
   516 if b = 0 then OutError(errmsgUnknownVariable + ' "' + id + '"', false)
   516 if b = 0 then OutError(errmsgUnknownVariable + ' "' + id + '"', false)
   517         else CurrentTeam^.Binds[b]:= s
   517         else CurrentTeam^.Binds[b]:= s
   518 end;
   518 end;
   519 
   519 
   520 procedure chTeamGone(var s:shortstring);
   520 procedure chTeamGone(var s:shortstring);
   521 var t: LongInt;
   521 var t, i: LongInt;
   522 begin
   522 begin
   523 t:= 0;
   523 t:= 0;
   524 while (t < cMaxTeams)
   524 while (t < cMaxTeams)
   525     and (TeamsArray[t] <> nil)
   525     and (TeamsArray[t] <> nil)
   526     and (TeamsArray[t]^.TeamName <> s) do inc(t);
   526     and (TeamsArray[t]^.TeamName <> s) do inc(t);
   527 if (t = cMaxTeams) or (TeamsArray[t] = nil) then exit;
   527 if (t = cMaxTeams) or (TeamsArray[t] = nil) then exit;
   528 
   528 
   529 with TeamsArray[t]^ do
   529 with TeamsArray[t]^ do
   530     begin
   530     begin
   531     AddChatString('** '+ TeamName + ' is gone');
   531     AddChatString('** '+ TeamName + ' is gone');
       
   532     for i:= 0 to cMaxHHIndex do
       
   533         if Hedgehogs[i].GearHidden <> nil then
       
   534             RestoreHog(@Hedgehogs[i]);
   532     hasGone:= true
   535     hasGone:= true
   533     end;
   536     end;
   534 
   537 
   535 RecountTeamHealth(TeamsArray[t])
   538 RecountTeamHealth(TeamsArray[t])
   536 end;
   539 end;