From 5e882a8a0a921f54f4a33d4c688b24974b19ce15 Mon Sep 17 00:00:00 2001 From: Freakyy Date: Sun, 24 May 2015 10:24:17 +0200 Subject: [PATCH] Final final commit for 1.1.1 Fixed console input/output --- build/GTALua/addons/_empty_addon/main.lua | 9 +++++---- src/GTALua/UTIL/UTIL.cpp | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build/GTALua/addons/_empty_addon/main.lua b/build/GTALua/addons/_empty_addon/main.lua index 0ab1ca8..f8528b2 100644 --- a/build/GTALua/addons/_empty_addon/main.lua +++ b/build/GTALua/addons/_empty_addon/main.lua @@ -1,11 +1,12 @@ -- --- Check out "Getting started" on the Wiki! --- http://freeschi.com/w/index.php/Main_Page --- http://freeschi.com/w/index.php/Getting_Started --- http://freeschi.com/w/index.php/API +-- Check out our the Wiki! +-- http://wiki.gtalua.com/index.php/Main_Page +-- http://wiki.gtalua.com/index.php/Getting_Started +-- http://wiki.gtalua.com/index.php/API -- -- Please rename empty_addon! +-- I recommend matching thread name & folder name! empty_addon = ScriptThread("empty_addon") -- Run diff --git a/src/GTALua/UTIL/UTIL.cpp b/src/GTALua/UTIL/UTIL.cpp index 18adb27..34cdbff 100644 --- a/src/GTALua/UTIL/UTIL.cpp +++ b/src/GTALua/UTIL/UTIL.cpp @@ -13,8 +13,6 @@ void UTIL::Attach_Console(bool bAutomatic, int x, int y) // Console AllocConsole(); AttachConsole(GetCurrentProcessId()); - freopen("CON", "w", stdout); - freopen("CONIN$", "r", stdin); // Console Window HWND hConsole = GetConsoleWindow(); @@ -40,6 +38,10 @@ void UTIL::Attach_Console(bool bAutomatic, int x, int y) // Update Position SetWindowPos(hConsole, NULL, x, y, rect.right - rect.left, rect.bottom - rect.top, 0); } + + // Input/Output + freopen("CON", "w", stdout); + freopen("CONIN$", "r", stdin); } // =================================================================================