add fast int to object lookup.

This commit is contained in:
Jeff Hutchinson 2021-05-01 02:55:24 -04:00
parent ab4c0f0361
commit db047275f1

View file

@ -1824,7 +1824,7 @@ ConsoleValue CodeBlock::exec(U32 ip, const char* functionName, Namespace* thisNa
// Optimization: If we're an integer, we can lookup the value by SimObjectId
const ConsoleValue& simObjectLookupValue = callArgv[1];
if (simObjectLookupValue.getType() == ConsoleValueType::cvInteger)
gEvalState.thisObject = Sim::findObject(static_cast<SimObjectId>(simObjectLookupValue.getInt()));
gEvalState.thisObject = Sim::findObject(static_cast<SimObjectId>(simObjectLookupValue.getFastInt()));
else
{
SimObject *foundObject = Sim::findObject(simObjectLookupValue.getString());