MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / object

Method object

ogsr_engine/COMMON_AI/script_engine.cpp:691–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689}
690
691bool CScriptEngine::object(const char* identifier, int type)
692{
693#ifdef DEBUG
694 int start = lua_gettop(lua());
695#endif
696 lua_pushnil(lua());
697 while (lua_next(lua(), -2))
698 {
699 if (lua_type(lua(), -1) == type && !xr_strcmp(identifier, lua_tostring(lua(), -2)))
700 {
701 VERIFY(lua_gettop(lua()) >= 3);
702 lua_pop(lua(), 3);
703 VERIFY(lua_gettop(lua()) == start - 1);
704 return true;
705 }
706 lua_pop(lua(), 1);
707 }
708 VERIFY(lua_gettop(lua()) >= 1);
709 lua_pop(lua(), 1);
710 VERIFY(lua_gettop(lua()) == start - 1);
711 return false;
712}
713
714bool CScriptEngine::object(const char* namespace_name, const char* identifier, int type)
715{

Callers 4

function_objectMethod · 0.95
CALifeMonsterBrainMethod · 0.45
specific_characterMethod · 0.45

Calls 9

luaFunction · 0.85
lua_gettopFunction · 0.50
lua_pushnilFunction · 0.50
lua_nextFunction · 0.50
lua_typeFunction · 0.50
xr_strcmpFunction · 0.50
xr_strlenFunction · 0.50
namespace_loadedFunction · 0.50
objectFunction · 0.50

Tested by

no test coverage detected