Skip to content

Commit

Permalink
Remove erroneous drain
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Papel committed Dec 18, 2023
1 parent efb67a9 commit 023e1be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/lobby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl Lobby {
unreachable!("LobbyState::Lobby was checked to be to LobbyState::Lobby in the previous line")
};

for (index, (arbitrary_player_id, lobby_player)) in players.drain().enumerate() {
for (index, (arbitrary_player_id, lobby_player)) in players.iter().map(|(index, tup)| (*index, tup.clone())).enumerate() {
player_indices.insert(arbitrary_player_id, GamePlayer { player_index: index as PlayerIndex, host: lobby_player.host });
game_players.push(lobby_player);
}
Expand Down Expand Up @@ -224,7 +224,7 @@ impl Lobby {


let roles: HashSet<_> = roles.drain(..).collect();
let roles: Vec<_> = roles.into_iter().filter(|e|*e!=RoleOutline::Any).map(|e|e.clone()).collect();
let roles: Vec<_> = roles.into_iter().filter(|e|*e!=RoleOutline::Any).collect();
settings.excluded_roles = roles.clone();
self.send_to_all(ToClientPacket::ExcludedRoles { roles });
}
Expand Down

1 comment on commit 023e1be

@vercel
Copy link

@vercel vercel bot commented on 023e1be Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

mafia-game – ./

mafia-game-itssammym.vercel.app
mafia-game.vercel.app
mafia-game-git-00x-main-itssammym.vercel.app

Please sign in to comment.