Skip to content

Commit a67cd48

Browse files
authored
Add back init code and don't send huds when requesting all (#3163)
1 parent 6f7f2c8 commit a67cd48

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,6 @@ if (SERVER) then
587587
end
588588
if not targets then
589589
targets = ents.FindByClass("gmod_wire_egp")
590-
table.Add( targets, ents.FindByClass("gmod_wire_egp_hud") )
591590
table.Add( targets, ents.FindByClass("gmod_wire_egp_emitter") )
592591

593592
if (#targets == 0) then return false, "There are no EGP screens on the map." end
@@ -660,6 +659,19 @@ if (SERVER) then
660659
return true, #targets
661660
end
662661
end
662+
663+
local function initspawn(ply)
664+
timer.Simple(10,function()
665+
if (ply and ply:IsValid()) then
666+
local bool, msg = EGP:SendDataStream( ply )
667+
if (bool == true) then
668+
ply:ChatPrint("[EGP] " .. tostring(msg) .. " EGP Screens found on the server. Sending objects now...")
669+
end
670+
end
671+
end)
672+
end
673+
674+
hook.Add("PlayerInitialSpawn","EGP_SpawnFunc",initspawn)
663675
else
664676
function EGP:ReceiveDataStream( decoded )
665677
local Ent = decoded.Ent

0 commit comments

Comments
 (0)