diff options
author | metamuffin <metamuffin@disroot.org> | 2024-06-05 01:01:20 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-06-05 01:01:20 +0200 |
commit | 0c36907e9296373dbc23e059c083db8e376ff79e (patch) | |
tree | 31f287d916034973a5e830c61bc87b8d46d4d172 | |
parent | 407a90d3b91afbc02fb7209c6928f4b29027a63f (diff) | |
download | gpn-tron-rust-0c36907e9296373dbc23e059c083db8e376ff79e.tar gpn-tron-rust-0c36907e9296373dbc23e059c083db8e376ff79e.tar.bz2 gpn-tron-rust-0c36907e9296373dbc23e059c083db8e376ff79e.tar.zst |
spawning bug because i used ids the wrong way
-rw-r--r-- | src/game/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/game/mod.rs b/src/game/mod.rs index 3eab9de..2905716 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -25,8 +25,8 @@ impl Game { pub fn new(players: Vec<(u32, String)>) -> Self { let mut map = Map::new(players.len() * 2, players.len() * 2); let mut heads = HashMap::new(); - for (p, name) in players { - let pos = IVec2::ONE * p as i32 * 2; + for (i, (p, name)) in players.into_iter().enumerate() { + let pos = IVec2::ONE * i as i32 * 2; map[pos] = Some(p); heads.insert(p, (Direction::Up, pos, name)); } |