hedgewars/uTeams.pas
changeset 10883 294ef49efdd2
parent 10665 b57c328c6794
child 10944 c4b3440eeac6
--- a/hedgewars/uTeams.pas	Tue Mar 31 23:14:09 2015 +0300
+++ b/hedgewars/uTeams.pas	Wed Apr 01 02:42:37 2015 +0200
@@ -549,10 +549,12 @@
     Gear: PGear;
 begin
 s:= '';
-if (not isDeveloperMode) or (CurrentTeam = nil) then
+if (not isDeveloperMode) then
     exit;
+TryDo((CurrentTeam <> nil), 'Can''t add hedgehogs yet, add a team first!', true);
 with CurrentTeam^ do
     begin
+    TryDo(HedgehogsNumber<=cMaxHHIndex, 'Can''t add hedgehog to "' + TeamName + '"! (already ' + intToStr(HedgehogsNumber) + ' hogs)', true);
     SplitBySpace(id, s);
     SwitchCurrentHedgehog(@Hedgehogs[HedgehogsNumber]);
     CurrentHedgehog^.BotLevel:= StrToInt(id);