mirror of
https://github.com/wiremod/wire.git
synced 2025-03-04 03:03:04 -05:00
Mitigate some issues with reserved words (#3236)
* Add entity:getClass * Remove some common reserved words * lint
This commit is contained in:
parent
c4d0ca9855
commit
4262b11969
@ -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
|
||||
@ -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,
|
||||
}
|
||||
|
@ -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 ""
|
||||
|
Loading…
Reference in New Issue
Block a user