Skip to content

Commit e7efcb4

Browse files
committed
Fix.
1 parent 0eb8bf6 commit e7efcb4

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

LuaMenu/widgets/api_command_buffering.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ local bufferBypass = {
3333
BattlePoll = true,
3434
BattlePollOutcome = true,
3535
UpdateUserBattleStatus = true,
36+
User = true,
3637
}
3738

3839
local CMD_PER_UPDATE = 14

LuaMenu/widgets/api_ingame_interface.lua

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,12 @@ local oldUsers = false
296296

297297
local function IsNewUserList(newUsers)
298298
if not oldUsers then
299-
oldUsers = newUsers
299+
oldUsers = Spring.Utilities.ShallowCopy(newUsers)
300300
return true
301301
end
302-
Spring.Echo("Checking users", #newUsers, #oldUsers)
303302
for i = 1, math.max(#newUsers, #oldUsers) do
304-
Spring.Echo(newUsers[i], oldUsers[i])
305303
if newUsers[i] ~= oldUsers[i] then
306-
oldUsers = newUsers
304+
oldUsers = Spring.Utilities.ShallowCopy(newUsers)
307305
return true
308306
end
309307
end
@@ -320,15 +318,16 @@ local function PlayersUpdate(listeners, updatedBattleID)
320318
end
321319
local battle = lobby:GetBattle(lobby:GetMyBattleID()) or {}
322320
local newPlayerCount = (lobby:GetBattlePlayerCount(updatedBattleID) or "??")
323-
if newPlayerCount == oldPlayerCount then
321+
local haveNewUsers = IsNewUserList(battle.users)
322+
if newPlayerCount == oldPlayerCount and not haveNewUsers then
324323
return
325324
end
326325
oldPlayerCount = newPlayerCount
327326
--Spring.Echo(LOBBY_CHAT_UPDATE .. " Players waiting " .. (lobby:GetBattlePlayerCount(updatedBattleID) or "??") .. "/" .. (battle.maxPlayers or "??"))
328327
if Spring.SendLuaUIMsg then
329328
if battle.users and #battle.users > 0 then
330329
Spring.SendLuaUIMsg(LOBBY_CHAT_UPDATE .. "Players waiting: " .. newPlayerCount .. "/" .. (battle.maxPlayers or "??"))
331-
if IsNewUserList(battle.users) then
330+
if haveNewUsers then
332331
local userString = ""
333332
for i = 1, (#battle.users) - 1 do
334333
userString = userString .. (battle.users[i] or "??") .. ", "

0 commit comments

Comments
 (0)