Skip to content

Commit

Permalink
Inline Connected to avoid calling UpdateOutputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Denneisk committed Apr 9, 2024
1 parent bc614de commit 1eab9cf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lua/entities/gmod_wire_friendslist.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,15 @@ function ENT:UpdateFriendslist( friends_steamids )
end

local plys = player.GetHumans()
for i=1,#plys do
self:Connected( plys[i] )
for i = 1, #plys do
local ply = plys[i]
local steamid = ply:SteamID()

if self.friends_lookup[ply] then return end

if self.steamids_lookup[steamid] then
self.friends_lookup[ply] = true
end
end

self:UpdateOutputs()
Expand Down

0 comments on commit 1eab9cf

Please sign in to comment.