Beispiel #1
0
int CLuaFile::ProjectileGetSoundImpact(lua_State *L)
{
    lua_getglobal(L, "pLUA");
    CLuaFile *pSelf = (CLuaFile *)lua_touserdata(L, -1);
    lua_Debug Frame;
    lua_getstack(L, 1, &Frame);
    lua_getinfo(L, "nlSf", &Frame);

    if (!lua_isnumber(L, 1))
        return 0;

    CProjectile *pPrj = (CProjectile *)pSelf->m_pServer->m_World.GetEntityByID(lua_tointeger(L, 1));
    if (pPrj)
    {
        lua_pushinteger(L, pPrj->GetSoundImpact());
        return 1;
    }
    return 0;
}