hedgewars/uTeams.pas
changeset 10883 294ef49efdd2
parent 10665 b57c328c6794
child 10944 c4b3440eeac6
equal deleted inserted replaced
10882:ed7717f659ae 10883:294ef49efdd2
   547 procedure chAddHH(var id: shortstring);
   547 procedure chAddHH(var id: shortstring);
   548 var s: shortstring;
   548 var s: shortstring;
   549     Gear: PGear;
   549     Gear: PGear;
   550 begin
   550 begin
   551 s:= '';
   551 s:= '';
   552 if (not isDeveloperMode) or (CurrentTeam = nil) then
   552 if (not isDeveloperMode) then
   553     exit;
   553     exit;
       
   554 TryDo((CurrentTeam <> nil), 'Can''t add hedgehogs yet, add a team first!', true);
   554 with CurrentTeam^ do
   555 with CurrentTeam^ do
   555     begin
   556     begin
       
   557     TryDo(HedgehogsNumber<=cMaxHHIndex, 'Can''t add hedgehog to "' + TeamName + '"! (already ' + intToStr(HedgehogsNumber) + ' hogs)', true);
   556     SplitBySpace(id, s);
   558     SplitBySpace(id, s);
   557     SwitchCurrentHedgehog(@Hedgehogs[HedgehogsNumber]);
   559     SwitchCurrentHedgehog(@Hedgehogs[HedgehogsNumber]);
   558     CurrentHedgehog^.BotLevel:= StrToInt(id);
   560     CurrentHedgehog^.BotLevel:= StrToInt(id);
   559     CurrentHedgehog^.Team:= CurrentTeam;
   561     CurrentHedgehog^.Team:= CurrentTeam;
   560     Gear:= AddGear(0, 0, gtHedgehog, 0, _0, _0, 0);
   562     Gear:= AddGear(0, 0, gtHedgehog, 0, _0, _0, 0);