MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / ParticleGetn

Method ParticleGetn

LuaSTGPlus/GameObjectPool.cpp:1341–1359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1339}
1340
1341int GameObjectPool::ParticleGetn(lua_State* L)LNOEXCEPT
1342{
1343 if (!lua_istable(L, 1))
1344 return luaL_error(L, "invalid lstg object for 'ParticleFire'.");
1345 lua_rawgeti(L, 1, 2); // t(object) ??? id
1346 size_t id = (size_t)luaL_checkinteger(L, -1);
1347 lua_pop(L, 1);
1348
1349 GameObject* p = m_ObjectPool.Data(id);
1350 if (!p)
1351 return luaL_error(L, "invalid lstg object for 'ParticleFire'.");
1352 if (!p->res || p->res->GetType() != ResourceType::Particle)
1353 {
1354 lua_pushinteger(L, 0);
1355 return 1;
1356 }
1357 lua_pushinteger(L, (int)p->ps->GetAliveCount());
1358 return 1;
1359}
1360
1361int GameObjectPool::ParticleGetEmission(lua_State* L)LNOEXCEPT
1362{

Callers

nothing calls this directly

Calls 3

DataMethod · 0.80
GetTypeMethod · 0.80
GetAliveCountMethod · 0.80

Tested by

no test coverage detected