Skip to content

Commit

Permalink
Convert getregistry use to findmetatable
Browse files Browse the repository at this point in the history
  • Loading branch information
Vurv78 committed Jan 4, 2024
1 parent aa34b0f commit b8675eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lua/entities/gmod_wire_expression2/core/e2lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -915,7 +915,7 @@ hook.Add("InitPostEntity", "e2lib", function()

-- check for a CPPI compliant plugin
if SERVER and CPPI then
if debug.getregistry().Player.CPPIGetFriends then
if FindMetaTable("Player").CPPIGetFriends then
E2Lib.replace_function("isFriend", function(owner, player)
if owner == nil then return false end
if owner == player then return true end
Expand All @@ -934,7 +934,7 @@ hook.Add("InitPostEntity", "e2lib", function()
end)
end

if debug.getregistry().Entity.CPPIGetOwner then
if FindMetaTable("Entity").CPPIGetOwner then
local _getOwner = E2Lib.getOwner
E2Lib.replace_function("getOwner", function(self, entity)
if not IsValid(entity) then return end
Expand Down
2 changes: 1 addition & 1 deletion lua/entities/gmod_wire_expression2/core/player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ end

__e2setcost(2)

if CPPI and debug.getregistry().Player.CPPIGetFriends then
if CPPI and FindMetaTable("Player").CPPIGetFriends then

local function Trusts(ply, whom)
if ply == whom then return true end
Expand Down

0 comments on commit b8675eb

Please sign in to comment.