Skip to content

Commit

Permalink
Make debug save archives handle zzip maps.
Browse files Browse the repository at this point in the history
  • Loading branch information
akrieger committed Jan 17, 2025
1 parent ccb7e93 commit 50b8dc1
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/debug_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -371,11 +371,18 @@ bool _trim_mapbuffer( std::filesystem::path const &dep, rdi_t &iter,
return false;
}
// discard map buffer outside of current and adjacent segments
if( dep.parent_path().filename() == std::filesystem::u8path( "maps" ) &&
!segs.is_point_inside(
tripoint{ _from_map_string( dep.filename().string() ).xy(), 0 } ) ) {
iter.disable_recursion_pending();
return false;
if( dep.parent_path().filename() == std::filesystem::u8path( "maps" ) ) {
std::filesystem::path map_folder = dep.filename();
std::string map_coords;
if( map_folder.extension().string() == ".zzip" ) {
map_coords = map_folder.stem().string();
} else {
map_coords = map_folder.filename().string();
}
if( !segs.is_point_inside( tripoint{ _from_map_string( map_coords ).xy(), 0 } ) ) {
iter.disable_recursion_pending();
return false;
}
}
return true;
}
Expand Down

0 comments on commit 50b8dc1

Please sign in to comment.