浏览代码

Fix console warning when calling void functions in console

Forgot to add this check when rewriting the interpreter.
Jeff Hutchinson 3 年之前
父节点
当前提交
73b023a4b7
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      Engine/source/console/compiledEval.cpp

+ 5 - 1
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++;