summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 08f2917)
raw | patch | inline | side by side (parent: 08f2917)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 8 Apr 2019 15:00:17 +0000 (18:00 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 8 Apr 2019 15:00:17 +0000 (18:00 +0300) |
src/game/g_console.pas | patch | blob | history |
diff --git a/src/game/g_console.pas b/src/game/g_console.pas
index 59174bf3b66b96ae71fbc637e92b984657e93662..f1b82c341a4f04d3e07c2184717cd89eee6defcb 100644 (file)
--- a/src/game/g_console.pas
+++ b/src/game/g_console.pas
case cmd of
'bind':
// bind <key> [down [up]]
- if Length(p) >= 2 then
+ if (Length(p) >= 2) and (Length(p) <= 4) then
begin
i := 0;
key := LowerCase(p[1]);
begin
if Length(p) = 2 then
g_Console_Add('"' + e_KeyNames[i] + '" = "' + GetCommandString(gInputBinds[i].down) + '" "' + GetCommandString(gInputBinds[i].up) + '"')
- else if Length(p) >= 4 then
- g_Console_BindKey(i, p[2], p[3])
- else
+ else if Length(p) = 3 then
g_Console_BindKey(i, p[2], '')
+ else (* len = 4 *)
+ g_Console_BindKey(i, p[2], p[3])
end
+ else
+ g_Console_Add('bind: "' + p[1] + '" is not a key')
end
else
- g_Console_Add('bind <key> <down action> [up action]');
+ begin
+ g_Console_Add('bind <key> <down action> [up action]')
+ end;
'bindlist':
for i := 0 to e_MaxInputKeys - 1 do
if (gInputBinds[i].down <> nil) or (gInputBinds[i].up <> nil) then
while (i < e_MaxInputKeys) and (key <> LowerCase(e_KeyNames[i])) do inc(i);
if i < e_MaxInputKeys then
g_Console_BindKey(i, '')
+ else
+ g_Console_Add('unbind: "' + p[1] + '" is not a key')
end
else
g_Console_Add('unbind <key>');