From b8675ebfbca623f7f77490c41d5c5a8e2689c436 Mon Sep 17 00:00:00 2001 From: Vurv <56230599+Vurv78@users.noreply.github.com> Date: Thu, 4 Jan 2024 13:44:28 -0800 Subject: [PATCH] Convert getregistry use to findmetatable --- lua/entities/gmod_wire_expression2/core/e2lib.lua | 4 ++-- lua/entities/gmod_wire_expression2/core/player.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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