From e59a60582353eb21718d3c39ff7bc347dee61811 Mon Sep 17 00:00:00 2001 From: "Laurent Alonso(fr)" Date: Fri, 1 May 2020 11:02:35 +0200 Subject: [PATCH] map: try to correct the disappearing problem in outdoor maps --- src/fileio/fileio.hpp | 2 +- src/game/boe.fileio.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fileio/fileio.hpp b/src/fileio/fileio.hpp index 66c40e48..766b235d 100644 --- a/src/fileio/fileio.hpp +++ b/src/fileio/fileio.hpp @@ -44,7 +44,7 @@ template void writeArray(std::ostream& to, const T& array, int width, int height) { using int_type = decltype(typename array_value_type::type() + 1); for(int y = 0; y < height; y++) { - to << array[0][y]; + to << int_type(array[0][y]); for(int x = 1; x < width; x++) to << '\t' << int_type(array[x][y]); to << '\n'; diff --git a/src/game/boe.fileio.cpp b/src/game/boe.fileio.cpp index 7705064c..c5f582a7 100644 --- a/src/game/boe.fileio.cpp +++ b/src/game/boe.fileio.cpp @@ -93,6 +93,9 @@ void finish_load_party(){ overall_mode = town_restore ? MODE_TOWN : MODE_OUTDOORS; stat_screen_mode = MODE_INVEN; + // build_outdoors call add_outdoor_maps, so we must update them first + // checkme: true for actual files, unsure for a legacy saved file + save_outdoor_maps(); build_outdoors(); erase_out_specials();