catch a replay system do_load edge case crash

This commit is contained in:
2025-02-06 11:47:12 -06:00
committed by Celtic Minstrel
parent a3ddff55aa
commit 3a5cc4ead4

View File

@@ -2804,6 +2804,13 @@ bool handle_scroll(const sf::Event& event) {
}
void do_load() {
// Edge case: Replay can be cut off before a file is chosen,
// or party selection can be canceled, and this will cause
// a crash trying to decode a party
if(replaying && !has_next_action("load_party")){
return;
}
fs::path file_to_load = nav_get_or_decode_party();
if(file_to_load.empty()) return;
if(!load_party(file_to_load, univ))