Rehost save-world partial-year weighting inputs

This commit is contained in:
Jan Petykiewicz 2026-04-17 22:05:29 -07:00
commit b81b67d2b3
8 changed files with 119 additions and 2 deletions

View file

@ -743,6 +743,14 @@ fn project_save_slice_components(
absolute_counter_reconstructible_from_save: Some(
save_slice.world_finance_neighborhood_state.is_some(),
),
packed_year_word_raw_u16: save_slice
.world_finance_neighborhood_state
.as_ref()
.map(|state| state.packed_year_word_raw_u16),
partial_year_progress_raw_u8: save_slice
.world_finance_neighborhood_state
.as_ref()
.map(|state| state.partial_year_progress_raw_u8),
current_calendar_tuple_word_raw_u32: save_slice
.world_finance_neighborhood_state
.as_ref()
@ -5842,6 +5850,10 @@ mod tests {
world_finance_neighborhood_state: Some(crate::SmpLoadedWorldFinanceNeighborhoodState {
source_kind: "save-fixed-world-block".to_string(),
semantic_family: "world-finance-neighborhood".to_string(),
packed_year_word_raw_u16: 0x0201,
packed_year_word_raw_hex: "0x0201".to_string(),
partial_year_progress_raw_u8: 3,
partial_year_progress_raw_hex: "0x03".to_string(),
current_calendar_tuple_word_raw_u32: 1,
current_calendar_tuple_word_raw_hex: "0x00000001".to_string(),
current_calendar_tuple_word_2_raw_u32: 2,
@ -6045,6 +6057,14 @@ mod tests {
.absolute_counter_reconstructible_from_save,
Some(true)
);
assert_eq!(
import.state.world_restore.packed_year_word_raw_u16,
Some(0x0201)
);
assert_eq!(
import.state.world_restore.partial_year_progress_raw_u8,
Some(3)
);
assert_eq!(
import
.state