hedgewars/uCommandHandlers.pas
changeset 14530 ec0afe1c6024
parent 14522 d0441c7e9000
child 14677 93429d8f6b3f
equal deleted inserted replaced
14529:db646b3c0b95 14530:ec0afe1c6024
   476 procedure chSetWeapon(var s: shortstring);
   476 procedure chSetWeapon(var s: shortstring);
   477 begin
   477 begin
   478     if CheckNoTeamOrHH then
   478     if CheckNoTeamOrHH then
   479         exit;
   479         exit;
   480 
   480 
       
   481     (* Use "~" (ASCII character 126) as synonym for NUL byte (=amNothing).
       
   482     This is done to allow to add "setweap ~" in QTfrontend/binds.cpp because
       
   483     the NUL byte would terminate the strings in C++ otherwise. *)
       
   484     if (s[1] = '~') then
       
   485         s[1]:= #0;
   481     if checkFails((s[0] = #1) and (s[1] <= char(High(TAmmoType))), 'Malformed /setweap', true) then exit;
   486     if checkFails((s[0] = #1) and (s[1] <= char(High(TAmmoType))), 'Malformed /setweap', true) then exit;
   482 
   487 
   483     if not isExternalSource then
   488     if not isExternalSource then
   484         SendIPC('w' + s);
   489         SendIPC('w' + s);
   485 
   490