hedgewars/uTeams.pas
changeset 4401 9cb6990af584
parent 4398 36d7e4b6ca81
child 4403 0dfe26f48ec1
equal deleted inserted replaced
4400:b190572290a0 4401:9cb6990af584
   499 CurrentHedgehog^.Gear^.X:= int2hwFloat(t);
   499 CurrentHedgehog^.Gear^.X:= int2hwFloat(t);
   500 val(y, t);
   500 val(y, t);
   501 CurrentHedgehog^.Gear^.Y:= int2hwFloat(t)
   501 CurrentHedgehog^.Gear^.Y:= int2hwFloat(t)
   502 end;
   502 end;
   503 
   503 
       
   504 procedure chBind(var id: shortstring);
       
   505 var s: shortstring;
       
   506     b: LongInt;
       
   507 begin
       
   508 s:= '';
       
   509 if CurrentTeam = nil then exit;
       
   510 SplitBySpace(id, s);
       
   511 if s[1]='"' then Delete(s, 1, 1);
       
   512 if s[byte(s[0])]='"' then Delete(s, byte(s[0]), 1);
       
   513 b:= KeyNameToCode(id);
       
   514 if b = 0 then OutError(errmsgUnknownVariable + ' "' + id + '"', false)
       
   515         else CurrentTeam^.Binds[b]:= s
       
   516 end;
       
   517 
   504 procedure initModule;
   518 procedure initModule;
   505 begin
   519 begin
   506     RegisterVariable('addhh', vtCommand, @chAddHH, false);
   520     RegisterVariable('addhh', vtCommand, @chAddHH, false);
   507     RegisterVariable('addteam', vtCommand, @chAddTeam, false);
   521     RegisterVariable('addteam', vtCommand, @chAddTeam, false);
   508     RegisterVariable('hhcoords', vtCommand, @chSetHHCoords  , false);
   522     RegisterVariable('hhcoords', vtCommand, @chSetHHCoords, false);
       
   523     RegisterVariable('bind', vtCommand, @chBind, true );
   509 
   524 
   510     CurrentTeam:= nil;
   525     CurrentTeam:= nil;
   511     PreviousTeam:= nil;
   526     PreviousTeam:= nil;
   512     CurrentHedgehog:= nil;
   527     CurrentHedgehog:= nil;
   513     TeamsCount:= 0;
   528     TeamsCount:= 0;