From 02cbb36474ca9a8af5cb637f8fb666bfedd59c7c Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Tue, 19 Apr 2022 22:47:58 +0200 Subject: [PATCH] Improved script commands Quotes are no longer needed --- r5dev/vstdlib/completion.cpp | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/r5dev/vstdlib/completion.cpp b/r5dev/vstdlib/completion.cpp index a69d09cf..541544c7 100644 --- a/r5dev/vstdlib/completion.cpp +++ b/r5dev/vstdlib/completion.cpp @@ -799,12 +799,15 @@ _SQVM_ServerScript_f_CompletionFunc */ void _SQVM_ServerScript_f_CompletionFunc(const CCommand& args) { - if (args.ArgC() < 2) + if (args.ArgC() >= 2) { - return; + string svBuf; + for (int i = 1; i < args.ArgC(); i++) + { + svBuf.append(args.Arg(i)); + } + SQVM_Execute(svBuf.c_str(), SQCONTEXT::SERVER); } - - SQVM_Execute(args.Arg(1), SQCONTEXT::SERVER); } #ifndef DEDICATED @@ -818,12 +821,15 @@ _SQVM_ClientScript_f_CompletionFunc */ void _SQVM_ClientScript_f_CompletionFunc(const CCommand& args) { - if (args.ArgC() < 2) + if (args.ArgC() >= 2) { - return; + string svBuf; + for (int i = 1; i < args.ArgC(); i++) + { + svBuf.append(args.Arg(i)); + } + SQVM_Execute(svBuf.c_str(), SQCONTEXT::CLIENT); } - - SQVM_Execute(args.Arg(1), SQCONTEXT::CLIENT); } /* @@ -836,12 +842,15 @@ _SQVM_UIScript_f_CompletionFunc */ void _SQVM_UIScript_f_CompletionFunc(const CCommand& args) { - if (args.ArgC() < 2) + if (args.ArgC() >= 2) { - return; + string svBuf; + for (int i = 1; i < args.ArgC(); i++) + { + svBuf.append(args.Arg(i)); + } + SQVM_Execute(svBuf.c_str(), SQCONTEXT::UI); } - - SQVM_Execute(args.Arg(1), SQCONTEXT::UI); } /*