コード例 #1
0
void CHalfLife2::SetHandleEntity(CBaseHandle &hndl, edict_t *pEnt)
{
	IServerEntity *pEntOther = pEnt->GetIServerEntity();

	if (pEntOther == NULL)
	{
		return;
	}

	hndl.Set(pEntOther);
}
コード例 #2
0
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);
}