From a61b8d11d09916319e6ed21e7d71bb82138edcc5 Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 17 Sep 2023 21:38:48 -0700 Subject: [PATCH] Revert "use osyncstream for writing to gamelog.txt" This reverts commit 4695b8c86d0358d0278c0f4f6c7d1d4e73aa825b. --- library/modules/Gui.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/library/modules/Gui.cpp b/library/modules/Gui.cpp index a191cc130..9eee284ac 100644 --- a/library/modules/Gui.cpp +++ b/library/modules/Gui.cpp @@ -28,11 +28,7 @@ distribution. #include #include #include -#include - -using std::map; -using std::string; -using std::vector; +using namespace std; #include "modules/Gui.h" #include "MemAccess.h" @@ -1401,10 +1397,8 @@ DFHACK_EXPORT void Gui::writeToGamelog(std::string message) return; std::ofstream fseed("gamelog.txt", std::ios::out | std::ios::app); - if(fseed.is_open()) { - std::osyncstream wrapped_fseed(fseed); - wrapped_fseed << message << std::endl; - } + if(fseed.is_open()) + fseed << message << std::endl; fseed.close(); } @@ -1546,7 +1540,7 @@ DFHACK_EXPORT int Gui::makeAnnouncement(df::announcement_type type, df::announce if (flags.bits.D_DISPLAY) { world->status.display_timer = ANNOUNCE_DISPLAY_TIME; - Gui::writeToGamelog('x' + std::to_string(repeat_count + 1)); + Gui::writeToGamelog('x' + to_string(repeat_count + 1)); } return -1; } @@ -1808,7 +1802,7 @@ bool Gui::autoDFAnnouncement(df::report_init r, string message) if (a_flags.bits.D_DISPLAY) { world->status.display_timer = r.display_timer; - Gui::writeToGamelog('x' + std::to_string(repeat_count + 1)); + Gui::writeToGamelog('x' + to_string(repeat_count + 1)); } DEBUG(gui).print("Announcement succeeded as repeat:\n%s\n", message.c_str()); return true;