From e31f094962c823ed38be11adeaad5a1764fe4b64 Mon Sep 17 00:00:00 2001 From: charles <128108973+OldFoolAgain@users.noreply.github.com> Date: Tue, 29 Aug 2023 08:56:35 -0400 Subject: [PATCH] Update regions.cpp --- source/regions.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/source/regions.cpp b/source/regions.cpp index c8641c31f..530d3fc0d 100644 --- a/source/regions.cpp +++ b/source/regions.cpp @@ -771,8 +771,32 @@ auto CMapHandler::SaveTest() ->void { } } startSave(streamData); + } + } + Console << "\b\b\b\b" << static_cast( 100 ) << "%"; + auto filename = basePath + "overflow.wsc"s; + auto writeDestination = std::ofstream( filename.c_str() ); - } + if( writeDestination.is_open() ) { + overFlow.SaveToDisk( writeDestination ); + writeDestination.close(); + } + else { + Console.Error( oldstrutil::format( "Failed to open %s for writing", filename.c_str() )); + return; + } + + Console << "\b\b\b\b"; + Console.PrintDone(); + + const auto e_t = static_cast(GetClock()); + Console.Print( oldstrutil::format( "World saved in %.02fsec\n", ( static_cast( e_t - s_t )) / 1000.0f )); + + i = 0; + for( auto wIter = mapWorlds.begin(); wIter != mapWorlds.end(); ++wIter ) + { + ( *wIter )->SaveResources( i ); + ++i; } }