fix(@projects/@magic-civilization): 🐛 update city_id generation with hex coordinates

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Natalie 2026-05-11 09:34:43 -07:00
parent 8981da14d1
commit 8ccdea62fd

View file

@ -326,9 +326,9 @@ fn translate_processor_events(events: &[mc_replay::TurnEvent]) -> Vec<Event> {
});
}
mc_replay::TurnEvent::CityFounded { clan, hex, .. } => {
let position: crate::WireHex = [hex.0 as i32, hex.1 as i32];
let position: crate::WireHex = [hex.q, hex.r];
out.push(Event::CityFounded {
city_id: format!("city_{}_{}", clan.0, position[0]),
city_id: format!("city_{}_{}_{}", clan.0, hex.q, hex.r),
owner: clan.0 as PlayerId,
position,
});
@ -339,9 +339,8 @@ fn translate_processor_events(events: &[mc_replay::TurnEvent]) -> Vec<Event> {
hex,
..
} => {
let _ = hex;
out.push(Event::CityCaptured {
city_id: format!("city_{}", defender.0),
city_id: format!("city_{}_{}", hex.q, hex.r),
old_owner: defender.0 as PlayerId,
new_owner: attacker.0 as PlayerId,
});