Skip to content

Commit

Permalink
Add back init code and don't send huds when requesting all (#3163)
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrb93 authored Oct 31, 2024
1 parent 6f7f2c8 commit a67cd48
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lua/entities/gmod_wire_egp/lib/egplib/transmitreceive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,6 @@ if (SERVER) then
end
if not targets then
targets = ents.FindByClass("gmod_wire_egp")
table.Add( targets, ents.FindByClass("gmod_wire_egp_hud") )
table.Add( targets, ents.FindByClass("gmod_wire_egp_emitter") )

if (#targets == 0) then return false, "There are no EGP screens on the map." end
Expand Down Expand Up @@ -660,6 +659,19 @@ if (SERVER) then
return true, #targets
end
end

local function initspawn(ply)
timer.Simple(10,function()
if (ply and ply:IsValid()) then
local bool, msg = EGP:SendDataStream( ply )
if (bool == true) then
ply:ChatPrint("[EGP] " .. tostring(msg) .. " EGP Screens found on the server. Sending objects now...")
end
end
end)
end

hook.Add("PlayerInitialSpawn","EGP_SpawnFunc",initspawn)
else
function EGP:ReceiveDataStream( decoded )
local Ent = decoded.Ent
Expand Down

0 comments on commit a67cd48

Please sign in to comment.