From b366ff9b1c649ec953fe9cdc21759e4f747eb485 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Tue, 2 Jan 2024 18:15:21 -0600 Subject: [PATCH] script stabilization tweaks Con::EvalResult CodeBlock::exec - objectCreationStackIndex needs to be signed as we test if it goes sub-zero ConsoleValue Namespace::Entry::execute - compiler yells about returning a temp via std::move bool TorqueScriptRuntime::executeFile - report the name of the dso output file, not the source scxript input file --- Engine/source/console/consoleInternal.cpp | 2 +- Engine/source/console/torquescript/compiledEval.cpp | 2 +- Engine/source/console/torquescript/runtime.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Engine/source/console/consoleInternal.cpp b/Engine/source/console/consoleInternal.cpp index 65bcf3ae9..095649cac 100644 --- a/Engine/source/console/consoleInternal.cpp +++ b/Engine/source/console/consoleInternal.cpp @@ -1202,7 +1202,7 @@ ConsoleValue Namespace::Entry::execute(S32 argc, ConsoleValue *argv, SimObject * break; } - return std::move(result); + return result; } //----------------------------------------------------------------------------- diff --git a/Engine/source/console/torquescript/compiledEval.cpp b/Engine/source/console/torquescript/compiledEval.cpp index 257f85d0b..c87d22672 100644 --- a/Engine/source/console/torquescript/compiledEval.cpp +++ b/Engine/source/console/torquescript/compiledEval.cpp @@ -666,7 +666,7 @@ Con::EvalResult CodeBlock::exec(U32 ip, const char* functionName, Namespace* thi StringTableEntry fnNamespace, fnPackage; static const U32 objectCreationStackSize = 32; - U32 objectCreationStackIndex = 0; + S32 objectCreationStackIndex = 0; struct { SimObject* newObject; U32 failJump; diff --git a/Engine/source/console/torquescript/runtime.cpp b/Engine/source/console/torquescript/runtime.cpp index 1e13b4989..18e1f47ba 100644 --- a/Engine/source/console/torquescript/runtime.cpp +++ b/Engine/source/console/torquescript/runtime.cpp @@ -1,4 +1,4 @@ -#include "runtime.h" +#include "runtime.h" #include "codeBlock.h" #include "console/script.h" @@ -386,7 +386,7 @@ namespace TorqueScript // We're all compiled, so let's run it. #ifdef TORQUE_DEBUG - Con::printf("Loading compiled script %s.", scriptFileName); + Con::printf("Loading compiled script %s.", nameBuffer); #endif CodeBlock* code = new CodeBlock; code->read(scriptFileName, *compiledStream);