hedgewars/CCHandlers.inc
changeset 394 4c017ae1226a
parent 393 db01cc79f278
child 409 4f1841929ccc
--- a/hedgewars/CCHandlers.inc	Mon Feb 05 19:33:24 2007 +0000
+++ b/hedgewars/CCHandlers.inc	Mon Feb 05 20:26:13 2007 +0000
@@ -46,12 +46,14 @@
    end
 end;
 
+const TeamsCount: Longword = 0;
+
 procedure chAddTeam(var s: shortstring);
-const TeamsCount: Longword = 0;
 begin
 if isDeveloperMode then
    begin
    inc(TeamsCount);
+   ParseCommand('ammstore 93919294221912103', true);
    TryDo(TeamsCount <= 5, 'Too many teams', true);
    AddTeam
    end;
@@ -110,7 +112,7 @@
     c: LongInt;
     Gear: PGear;
 begin
-if (not isDeveloperMode)or(CurrentTeam=nil) then exit;
+if (not isDeveloperMode) or (CurrentTeam = nil) then exit;
 with CurrentTeam^ do
      begin
      SplitBySpace(id, s);
@@ -120,7 +122,7 @@
      val(s, Gear^.Health, c);
      TryDo(Gear^.Health > 0, 'Invalid hedgehog health', true);
      PHedgehog(Gear^.Hedgehog)^.Team:= CurrentTeam;
-     Hedgehogs[HedgehogsNumber].AmmoStore:= 0;
+     Hedgehogs[HedgehogsNumber].AmmoStore:= TeamsCount - 1;
      Hedgehogs[HedgehogsNumber].Gear:= Gear;
      inc(HedgehogsNumber)
      end