From 73b023a4b716162b9a1edff0f1634b5571747179 Mon Sep 17 00:00:00 2001 From: Jeff Hutchinson Date: Wed, 8 Dec 2021 21:00:50 -0500 Subject: [PATCH] Fix console warning when calling void functions in console Forgot to add this check when rewriting the interpreter. --- Engine/source/console/compiledEval.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Engine/source/console/compiledEval.cpp b/Engine/source/console/compiledEval.cpp index 0b2e66b4b..c439f57bf 100644 --- a/Engine/source/console/compiledEval.cpp +++ b/Engine/source/console/compiledEval.cpp @@ -2022,7 +2022,11 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa break; } - Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", getFileLine(ip - 4), fnName, functionName); + if (Con::getBoolVariable("$Con::warnVoidAssignment", true)) + { + Con::warnf(ConsoleLogEntry::General, "%s: Call to %s in %s uses result of void function call.", getFileLine(ip - 4), fnName, functionName); + } + stack[_STK + 1].setEmptyString(); _STK++;