From 1ae3d65ebcb0ac5b139d1b64670374726fb2a4aa Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 14 Jan 2014 22:28:03 +0300 Subject: show full screenshot path in chat if creating screenshot. --- src/game.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/game.cpp b/src/game.cpp index e22b79715..11bc81910 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -541,26 +541,24 @@ bool Game::saveScreenshot(SDL_Surface *const screenshot) do { screenshotCount++; - filenameSuffix.str(""); filename.str(""); filename << screenshotDirectory << "/"; - filenameSuffix << screenShortStr << screenshotCount << ".png"; - filename << filenameSuffix.str(); + filename << screenShortStr << screenshotCount << ".png"; testExists.open(filename.str().c_str(), std::ios::in); found = !testExists.is_open(); testExists.close(); } while (!found); - const bool success = ImageWriter::writePNG(screenshot, filename.str()); - + const std::string fileNameStr = filename.str(); + const bool success = ImageWriter::writePNG(screenshot, fileNameStr); if (success) { if (localChatTab) { // TRANSLATORS: save file message std::string str = strprintf(_("Screenshot saved as %s"), - filenameSuffix.str().c_str()); + fileNameStr.c_str()); localChatTab->chatLog(str, BY_SERVER); } } -- cgit v1.2.3-70-g09d2