aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/mods
diff options
context:
space:
mode:
authorGlacir <122596880+Glacir@users.noreply.github.com>2023-04-19 21:43:46 +0800
committerGitHub <noreply@github.com>2023-04-19 09:43:46 -0400
commite1dcf7a6b685642659c4f857b9e7f4b5ad336422 (patch)
tree27788bf1593d602796d125751a74b4be9b539355 /NorthstarDLL/mods
parent4e341f156b05fafbaed9584bff8aecd2f2d54f15 (diff)
downloadNorthstarLauncher-e1dcf7a6b685642659c4f857b9e7f4b5ad336422.tar.gz
NorthstarLauncher-e1dcf7a6b685642659c4f857b9e7f4b5ad336422.zip
Fix incorrect script ConCommand argc (#446)
Diffstat (limited to 'NorthstarDLL/mods')
-rw-r--r--NorthstarDLL/mods/modmanager.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/NorthstarDLL/mods/modmanager.cpp b/NorthstarDLL/mods/modmanager.cpp
index 0f904bcd..8ac9ac54 100644
--- a/NorthstarDLL/mods/modmanager.cpp
+++ b/NorthstarDLL/mods/modmanager.cpp
@@ -303,11 +303,18 @@ template <ScriptContext context> auto ModConCommandCallback_Internal(std::string
{
if (g_pSquirrel<context>->m_pSQVM && g_pSquirrel<context>->m_pSQVM)
{
- std::vector<std::string> args;
- args.reserve(command.ArgC());
- for (int i = 1; i < command.ArgC(); i++)
- args.push_back(command.Arg(i));
- g_pSquirrel<context>->AsyncCall(name, args);
+ if (command.ArgC() == 1)
+ {
+ g_pSquirrel<context>->AsyncCall(name);
+ }
+ else
+ {
+ std::vector<std::string> args;
+ args.reserve(command.ArgC());
+ for (int i = 1; i < command.ArgC(); i++)
+ args.push_back(command.Arg(i));
+ g_pSquirrel<context>->AsyncCall(name, args);
+ }
}
else
{