diff --git a/lua/entities/gmod_wire_expression2/core/e2lib.lua b/lua/entities/gmod_wire_expression2/core/e2lib.lua index 1dc22b8fc1..4530b57fd3 100644 --- a/lua/entities/gmod_wire_expression2/core/e2lib.lua +++ b/lua/entities/gmod_wire_expression2/core/e2lib.lua @@ -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 @@ -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 diff --git a/lua/entities/gmod_wire_expression2/core/player.lua b/lua/entities/gmod_wire_expression2/core/player.lua index 91c2c63006..7951ab7a56 100644 --- a/lua/entities/gmod_wire_expression2/core/player.lua +++ b/lua/entities/gmod_wire_expression2/core/player.lua @@ -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