fix(@projects/@magic-civilization): 🐛 fix deterministic player order in kills processing
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
4963ee6906
commit
295480c48f
1 changed files with 2 additions and 1 deletions
|
|
@ -1349,7 +1349,8 @@ impl TurnProcessor {
|
|||
|
||||
// Remove killed units in reverse order per player to keep indices valid.
|
||||
// Credit strategic resources back to the owning player on death.
|
||||
let mut kills_by_player: HashMap<usize, Vec<usize>> = HashMap::new();
|
||||
// BTreeMap ensures players are processed in deterministic index order.
|
||||
let mut kills_by_player: std::collections::BTreeMap<usize, Vec<usize>> = std::collections::BTreeMap::new();
|
||||
for &(pi, ui) in &killed {
|
||||
kills_by_player.entry(pi).or_default().push(ui);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue