diff --git a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua index 25f9142f07..8087fde4ae 100644 --- a/lua/entities/gmod_wire_expression2/core/egpfunctions.lua +++ b/lua/entities/gmod_wire_expression2/core/egpfunctions.lua @@ -1158,6 +1158,7 @@ e2function void wirelink:egpHudToggle() antispam[self.player] = CurTime() + 0.1 timer.Simple(0, function() + if not EGP:ValidEGP(this) then return end EGP.EGPHudConnect(this, not (this.Users ~= nil and this.Users[self.player] ~= nil), self.player) end) end @@ -1168,10 +1169,15 @@ e2function void wirelink:egpHudEnable(enable) antispam[self.player] = CurTime() + 0.1 timer.Simple(0, function() + if not EGP:ValidEGP(this) then return end EGP.EGPHudConnect(this, enable ~= 0, self.player) end) end +registerCallback("destruct", function(self) + antispam[self.player] = nil +end) + e2function array wirelink:egpConnectedUsers() if not EGP:ValidEGP(this) then return self:throw("Invalid wirelink!", {}) end if not this.Users then return {} end