From e1dcf7a6b685642659c4f857b9e7f4b5ad336422 Mon Sep 17 00:00:00 2001 From: Glacir <122596880+Glacir@users.noreply.github.com> Date: Wed, 19 Apr 2023 21:43:46 +0800 Subject: Fix incorrect script ConCommand argc (#446) --- NorthstarDLL/mods/modmanager.cpp | 17 ++++++++++++----- 1 file 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 auto ModConCommandCallback_Internal(std::string { if (g_pSquirrel->m_pSQVM && g_pSquirrel->m_pSQVM) { - std::vector args; - args.reserve(command.ArgC()); - for (int i = 1; i < command.ArgC(); i++) - args.push_back(command.Arg(i)); - g_pSquirrel->AsyncCall(name, args); + if (command.ArgC() == 1) + { + g_pSquirrel->AsyncCall(name); + } + else + { + std::vector args; + args.reserve(command.ArgC()); + for (int i = 1; i < command.ArgC(); i++) + args.push_back(command.Arg(i)); + g_pSquirrel->AsyncCall(name, args); + } } else { -- cgit v1.2.3