From 03925c4fc7f037900819e9276ca92c8cffc8f5e2 Mon Sep 17 00:00:00 2001 From: Javidx9 Date: Wed, 13 Sep 2017 21:18:37 +0100 Subject: [PATCH] Update olcConsoleGameEngine.h Fixed ConstructConsole to return errors properly --- olcConsoleGameEngine.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/olcConsoleGameEngine.h b/olcConsoleGameEngine.h index 90c3f15..684958d 100644 --- a/olcConsoleGameEngine.h +++ b/olcConsoleGameEngine.h @@ -293,16 +293,16 @@ public: COORD buffer = { (short)m_nScreenWidth, (short)m_nScreenHeight }; if (!SetConsoleScreenBufferSize(m_hConsole, buffer)) - Error(L"SetConsoleScreenBufferSize"); + return Error(L"SetConsoleScreenBufferSize"); m_rectWindow = { 0, 0, (short)m_nScreenWidth - 1, (short)m_nScreenHeight - 1 }; if (!SetConsoleWindowInfo(m_hConsole, TRUE, &m_rectWindow)) - Error(L"SetConsoleWindowInfo"); + return Error(L"SetConsoleWindowInfo"); // Set flags to allow mouse input if (!SetConsoleMode(m_hConsoleIn, ENABLE_EXTENDED_FLAGS | ENABLE_WINDOW_INPUT | ENABLE_MOUSE_INPUT)) - Error(L"SetConsoleMode"); + return Error(L"SetConsoleMode"); m_bufScreen = new CHAR_INFO[m_nScreenWidth*m_nScreenHeight]; @@ -667,4 +667,4 @@ private: short *m_keyNewState; bool m_mouseOldState[5]; bool m_mouseNewState[5]; -}; \ No newline at end of file +};