zombiesurvival-evolved/gamemodes/zombiesurvival/gamemode/perf/shared/rewrite_weapon_index.lua
William Moodhe e9da54c2f9 ZS updates for 2014-2018
Too many changes to list.
2018-05-01 18:32:59 -04:00

23 lines
462 B
Lua

local M_Weapon = FindMetaTable("Weapon")
local M_Entity = FindMetaTable("Entity")
local E_GetTable = M_Entity.GetTable
local E_GetOwner = M_Entity.GetOwner
local val
local wt
function M_Weapon:__index(key)
val = M_Weapon[key]
if val ~= nil then return val end
val = M_Entity[key]
if val ~= nil then return val end
-- Deprecated, don't use
if key == "Owner" then return E_GetOwner(self) end
wt = E_GetTable(self)
if wt then
return wt[key]
end
end