hedgewars/uCommandHandlers.pas
changeset 14530 ec0afe1c6024
parent 14522 d0441c7e9000
child 14677 93429d8f6b3f
--- a/hedgewars/uCommandHandlers.pas	Wed Jan 09 19:10:11 2019 +0100
+++ b/hedgewars/uCommandHandlers.pas	Wed Jan 09 19:39:48 2019 +0100
@@ -478,6 +478,11 @@
     if CheckNoTeamOrHH then
         exit;
 
+    (* Use "~" (ASCII character 126) as synonym for NUL byte (=amNothing).
+    This is done to allow to add "setweap ~" in QTfrontend/binds.cpp because
+    the NUL byte would terminate the strings in C++ otherwise. *)
+    if (s[1] = '~') then
+        s[1]:= #0;
     if checkFails((s[0] = #1) and (s[1] <= char(High(TAmmoType))), 'Malformed /setweap', true) then exit;
 
     if not isExternalSource then