From e891826df65aafdc3f43680d3d2e25a9b00ef67d Mon Sep 17 00:00:00 2001 From: Denneisk <20892685+Denneisk@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:17:49 -0500 Subject: [PATCH 1/3] Add entity:getClass --- lua/entities/gmod_wire_expression2/core/entity.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/entity.lua b/lua/entities/gmod_wire_expression2/core/entity.lua index 663ee1bb3b..478db90e48 100644 --- a/lua/entities/gmod_wire_expression2/core/entity.lua +++ b/lua/entities/gmod_wire_expression2/core/entity.lua @@ -104,11 +104,15 @@ e2function string entity:name() return this:GetName() or "" end -e2function string entity:type() +[nodiscard] +e2function string entity:getClass() if not IsValid(this) then return self:throw("Invalid entity!", "") end return this:GetClass() end +[deprecated = "Use getClass"] +e2function string entity:type() = e2function string entity:getClass() + e2function string entity:model() if not IsValid(this) then return self:throw("Invalid entity!", "") end return this:GetModel() or "" From 7b53d4356ee5d7e3ed7c4a830581a9b7502012d2 Mon Sep 17 00:00:00 2001 From: Denneisk <20892685+Denneisk@users.noreply.github.com> Date: Wed, 1 Jan 2025 13:18:23 -0500 Subject: [PATCH 2/3] Remove some common reserved words --- lua/entities/gmod_wire_expression2/core/e2lib.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/lua/entities/gmod_wire_expression2/core/e2lib.lua b/lua/entities/gmod_wire_expression2/core/e2lib.lua index e1db2c58d9..55c3f636e2 100644 --- a/lua/entities/gmod_wire_expression2/core/e2lib.lua +++ b/lua/entities/gmod_wire_expression2/core/e2lib.lua @@ -676,9 +676,7 @@ E2Lib.ReservedWord = { ["in"] = true, instanceof = true, interface = true, - match = true, macro = true, - mod = true, module = true, mut = true, namespace = true, @@ -701,7 +699,6 @@ E2Lib.ReservedWord = { typeof = true, undefined = true, union = true, - use = true, yield = true, var = true, } From 94ba1c65d74e429642c1d7838fccbb11c6630792 Mon Sep 17 00:00:00 2001 From: Denneisk <20892685+Denneisk@users.noreply.github.com> Date: Wed, 1 Jan 2025 18:32:00 +0000 Subject: [PATCH 3/3] lint --- lua/entities/gmod_wire_expression2/core/e2lib.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/e2lib.lua b/lua/entities/gmod_wire_expression2/core/e2lib.lua index 55c3f636e2..a4eeffdcbe 100644 --- a/lua/entities/gmod_wire_expression2/core/e2lib.lua +++ b/lua/entities/gmod_wire_expression2/core/e2lib.lua @@ -474,7 +474,7 @@ else function E2Lib.isOwner(self, entity) local owner = E2Lib.getOwner(self, entity) if not IsValid(owner) then return false end - + return E2Lib.isFriend(owner, self.player) end end