Skip to content

Commit

Permalink
fixed a single person being set a s the pacmice twice on dual pacmice…
Browse files Browse the repository at this point in the history
… maps
  • Loading branch information
Pshy0 committed Aug 21, 2023
1 parent ea043c8 commit df740c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/pshy/games/pacmice.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,16 @@ local function CountMiceAlive()
end



local popped_best_players = {}
--- Pop the best player's score.
local function PopBestScorePlayer()
local best_player_name = nil
for player_name in pairs(tfm.get.room.playerList) do
if not best_player_name or scores.scores[player_name] > scores.scores[best_player_name] then
if not popped_best_players[player_name] and (not best_player_name or scores.scores[player_name] > scores.scores[best_player_name]) then
best_player_name = player_name
end
end
popped_best_players[best_player_name] = true
return best_player_name
end

Expand Down Expand Up @@ -431,6 +432,7 @@ end
--- TFM event eventNewGame()
-- Make the next pacmouse.
function eventNewGame()
popped_best_players = {}
-- more accurate intervals
loopmore.SetInterval(250)
-- misc
Expand Down

0 comments on commit df740c3

Please sign in to comment.