Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert debug.getregistry().Meta to FindMetaTable("Meta") #2968

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -220,7 +220,7 @@
local new_signature = string.format("%s(%s)", funcname, table.concat(args, ","))
if thistype then new_signature = thistype .. ":" .. new_signature end

return (not rets or rets == "") and (new_signature) or (E2Lib.typeName(rets) .. "=" .. new_signature)

Check warning on line 223 in lua/entities/gmod_wire_expression2/core/e2lib.lua

View workflow job for this annotation

GitHub Actions / lint

"Unnecessary parentheses"

Unnecessary parentheses
end

-- ------------------------ various entity checkers ----------------------------
Expand Down Expand Up @@ -915,7 +915,7 @@

-- 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 @@
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 Expand Up @@ -1207,7 +1207,7 @@
local status, tree, dvars = E2Lib.Parser.Execute(tokens)
if not status then return false, tree end

local status, script, inst = E2Lib.Compiler.Execute(tree, directives, dvars, {})

Check warning on line 1210 in lua/entities/gmod_wire_expression2/core/e2lib.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: inst
if not status then return false, script end

local ctx = RuntimeContext.builder()
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 @@

__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 Expand Up @@ -543,7 +543,7 @@

else

e2function array entity:friends()

Check warning on line 546 in lua/entities/gmod_wire_expression2/core/player.lua

View workflow job for this annotation

GitHub Actions / lint

"Unused variable"

Unused variable: this
return {}
end

Expand Down
Loading