Skip to content

Commit

Permalink
add E2 to :hasInstance()
Browse files Browse the repository at this point in the history
  • Loading branch information
ax255 authored Aug 23, 2024
1 parent 40b81fb commit a527cd8
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lua/starfall/libs_sh/entities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,17 @@ function ents_methods:getQuotaMax()
end
end

--- Return if the entity has a starfall instance
--- Return if the entity has a starfall instance or E2 instance
-- @shared
-- @return boolean if has starfall instance
-- @return boolean if has starfall instance or E2 instance
function ents_methods:hasInstance()
local ent = getent(self)
return ent.Starfall and ent.instance~=nil

if ent.Starfall then
return ent.instance~=nil
elseif ent:GetClass()=="gmod_wire_expression2" then
return SERVER and not ent.error
end
end

if SERVER then
Expand Down

0 comments on commit a527cd8

Please sign in to comment.