Skip to content

Commit

Permalink
Fix small load issue
Browse files Browse the repository at this point in the history
  • Loading branch information
crudelios committed Aug 2, 2024
1 parent d7033d2 commit 31456a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/game/file_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ static void get_version_data(savegame_version_data *version_data, savegame_versi
version_data->features.static_building_counts = version <= SAVE_GAME_LAST_GLOBAL_BUILDING_INFO;
version_data->features.visited_buildings = version > SAVE_GAME_LAST_GLOBAL_BUILDING_INFO;
version_data->features.custom_campaigns = version > SAVE_GAME_LAST_NO_CUSTOM_CAMPAIGNS;
version_data->features.dynamic_scenario_objects = version > SAVE_GAME_LAST_STATIC_SCENARIO_OBJECTS;
version_data->features.dynamic_scenario_objects = version > SAVE_GAME_LAST_STATIC_SCENARIO_ORIGINAL_DATA;
}

static void init_savegame_data(savegame_version_t version)
Expand Down
5 changes: 4 additions & 1 deletion src/scenario/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,9 @@ void scenario_request_load_state_old_version(buffer *list, int state_version, re
!array_expand(requests, MAX_ORIGINAL_REQUESTS)) {
log_error("Error creating requests array. The game will probably crash.", 0, 0);
}
for (size_t i = 0; i < MAX_ORIGINAL_REQUESTS; i++) {
request = array_advance(requests);
}
array_foreach(requests, request) {
request->year = buffer_read_i16(list);
}
Expand All @@ -403,7 +406,6 @@ void scenario_request_load_state_old_version(buffer *list, int state_version, re
array_foreach(requests, request) {
request->deadline_years = buffer_read_i16(list);
}
array_trim(requests);
} else if (section == REQUESTS_OLD_STATE_SECTIONS_CAN_COMPLY) {
array_foreach(requests, request) {
request->can_comply_dialog_shown = buffer_read_u8(list);
Expand Down Expand Up @@ -431,6 +433,7 @@ void scenario_request_load_state_old_version(buffer *list, int state_version, re
request->extension_disfavor = REQUESTS_DEFAULT_EXTENSION_DISFAVOUR;
request->ignored_disfavor = REQUESTS_DEFAULT_IGNORED_DISFAVOUR;
}
array_trim(requests);
}
}
}

0 comments on commit 31456a2

Please sign in to comment.