MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / LenCollection

Method LenCollection

MonaServer/sources/Script.cpp:340–352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340int Script::LenCollection(lua_State* pState) {
341 // 1 table
342 if(lua_getmetatable(pState, 1)) {
343 lua_getfield(pState, -1, "|count");
344 if (lua_isnumber(pState, -1)) {
345 lua_replace(pState, -2);
346 return 1;
347 }
348 lua_pop(pState, 2);
349 }
350 lua_pushnumber(pState,lua_objlen(pState, 1));
351 return 1;
352}
353
354int Script::CollectionToString(lua_State* pState) {
355 // 1 - table

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected