diff --git a/olcPixelGameEngine.h b/olcPixelGameEngine.h index 92dee603..0c4f02d6 100644 --- a/olcPixelGameEngine.h +++ b/olcPixelGameEngine.h @@ -3486,7 +3486,13 @@ namespace olc void PixelGameEngine::ConsoleCaptureStdOut(const bool bCapture) { - if(bCapture) + if (ssConsoleOutput.rdbuf() == std::cout.rdbuf() && bCapture == true) + return; + + if (ssConsoleOutput.rdbuf() != std::cout.rdbuf() && bCapture == false) + return; + + if (bCapture) sbufOldCout = std::cout.rdbuf(ssConsoleOutput.rdbuf()); else std::cout.rdbuf(sbufOldCout);