wiremod/wire

E2 :wirelink() broken backwards-compat

Fasteroid opened this issue · 2 comments

Using :wirelink() on an entity that doesn't have one by default now returns an invalid wirelink.
Seems to have been broken by #2891 since entity:wirelink() no longer creates a wirelink.

Before:

e2function wirelink entity:wirelink()
if not IsValid(this) then return self:throw("Invalid entity!", nil) end
if not isOwner(self, this) then return self:throw("You do not own this entity!", nil) end
if not this.extended then
WireLib.CreateWirelinkOutput( self.player, this, {true} )
end
return this
end

After:

e2function wirelink entity:wirelink()
if not IsValid(this) then return self:throw("Invalid entity!", nil) end
if not isOwner(self, this) then return self:throw("You do not own this entity!", nil) end
return this
end
__e2setcost(10)

Probably easy to fix if this tiny change is reverted.

Thanks for reporting this.

bruh