Skip to content

Commit

Permalink
implemented feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mexikoedi committed Sep 13, 2024
1 parent aeec9f8 commit f10bd97
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions gamemodes/terrortown/gamemode/client/cl_player_ext.lua
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ end
net.Receive("TTT_Equipment", UpdateEquipment)

-- Deletes old avatars and caches new ones
local function CacheAllPlayerAvatars()
local plys = player.GetAll()
local function CacheAllPlayerAvatars(ply)
local plys = IsPlayer(ply) and {ply} or player.GetAll()

for i = 1, #plys do
local plyid64 = plys[i]:SteamID64()
Expand Down Expand Up @@ -291,7 +291,7 @@ function GM:SetupMove(ply, mv, cmd)
end

-- Cache avatars for all players currently on the server
CacheAllPlayerAvatars()
CacheAllPlayerAvatars(ply)
end

net.Receive("TTT2NotifyPlayerReadyOnClients", function()
Expand All @@ -308,8 +308,8 @@ net.Receive("TTT2NotifyPlayerReadyOnClients", function()
-- stylua: ignore
hook.Run("TTT2PlayerReady", ply)

-- Cache avatars for all players currently on the server (with the new player included)
CacheAllPlayerAvatars()
-- Cache avatar of the new player
CacheAllPlayerAvatars(ply)
end)

---
Expand Down

0 comments on commit f10bd97

Please sign in to comment.