MCPcopy Create free account
hub / github.com/EQEmu/EQEmu / HasFunction

Method HasFunction

zone/lua_parser.cpp:1290–1308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1288}
1289
1290bool LuaParser::HasFunction(std::string subname, std::string package_name) {
1291 //std::transform(subname.begin(), subname.end(), subname.begin(), ::tolower);
1292
1293 auto iter = loaded_.find(package_name);
1294 if(iter == loaded_.end()) {
1295 return false;
1296 }
1297
1298 lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
1299 lua_getfield(L, -1, subname.c_str());
1300
1301 if(lua_isfunction(L, -1)) {
1302 lua_pop(L, 2);
1303 return true;
1304 }
1305
1306 lua_pop(L, 2);
1307 return false;
1308}
1309
1310bool LuaParser::HasEncounterSub(const std::string& package_name, QuestEventID evt)
1311{

Callers 1

InitMethod · 0.80

Calls 3

findMethod · 0.45
endMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected