hedgewars/uIO.pas
changeset 2695 ed789a7ef68d
parent 2691 c0da3a98c01c
child 2699 249adefa9c1c
equal deleted inserted replaced
2694:dcd248e04f3d 2695:ed789a7ef68d
    63 
    63 
    64 	SendEmptyPacketTicks: LongWord = 0;
    64 	SendEmptyPacketTicks: LongWord = 0;
    65 
    65 
    66 
    66 
    67 function AddCmd(Time: Word; str: shortstring): PCmd;
    67 function AddCmd(Time: Word; str: shortstring): PCmd;
    68 var Result: PCmd;
    68 var command: PCmd;
    69 begin
    69 begin
    70 new(Result);
    70 new(command);
    71 FillChar(Result^, sizeof(TCmd), 0);
    71 FillChar(command^, sizeof(TCmd), 0);
    72 Result^.loTime:= Time;
    72 command^.loTime:= Time;
    73 Result^.str:= str;
    73 command^.str:= str;
    74 if Result^.cmd <> 'F' then dec(Result^.len, 2); // cut timestamp
    74 if command^.cmd <> 'F' then dec(command^.len, 2); // cut timestamp
    75 if headcmd = nil then
    75 if headcmd = nil then
    76    begin
    76    begin
    77    headcmd:= Result;
    77    headcmd:= command;
    78    lastcmd:= Result
    78    lastcmd:= command
    79    end else
    79    end else
    80    begin
    80    begin
    81    lastcmd^.Next:= Result;
    81    lastcmd^.Next:= command;
    82    lastcmd:= Result
    82    lastcmd:= command
    83    end;
    83    end;
    84 AddCmd:= Result
    84 AddCmd:= command;
    85 end;
    85 end;
    86 
    86 
    87 procedure RemoveCmd;
    87 procedure RemoveCmd;
    88 var tmp: PCmd;
    88 var tmp: PCmd;
    89 begin
    89 begin