Merge pull request #701 from JeffProgrammer/console-warn-void-fix

Fix console warning when calling void functions in console
This commit is contained in:
Brian Roberts 2021-12-08 22:10:46 -06:00 committed by GitHub
commit bd876e427a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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++;