void CHalfLife2::SetHandleEntity(CBaseHandle &hndl, edict_t *pEnt) { IServerEntity *pEntOther = pEnt->GetIServerEntity(); if (pEntOther == NULL) { return; } hndl.Set(pEntOther); }
LUA_API void lua_pushweapon (lua_State *L, lua_CBaseCombatWeapon *pWeapon) { CBaseHandle *hWeapon = (CBaseHandle *)lua_newuserdata(L, sizeof(CBaseHandle)); hWeapon->Set((CBaseEntity *)pWeapon); luaL_getmetatable(L, "CBaseCombatWeapon"); lua_setmetatable(L, -2); }