diff --git a/src/client/component/console.cpp b/src/client/component/console.cpp index 7ef5b857..00aa6fbc 100644 --- a/src/client/component/console.cpp +++ b/src/client/component/console.cpp @@ -7,7 +7,8 @@ #include #include -#define CONSOLE_BUFFER_SIZE 16384 +#define CONSOLE_BUFFER_SIZE 16384 +#define WINDOW_WIDTH 608 namespace console { @@ -85,7 +86,7 @@ namespace console return; } - RECT rect; + RECT rect{}; rect.left = 0; rect.right = 620; rect.top = 0; @@ -97,8 +98,8 @@ namespace console const auto sheight = GetDeviceCaps(dc, 10); ReleaseDC(GetDesktopWindow(), dc); - utils::hook::set(game::s_wcd::windowWidth, rect.right - rect.left + 1); - utils::hook::set(game::s_wcd::windowHeight, rect.bottom - rect.top + 1); + utils::hook::set(game::s_wcd::windowWidth, (rect.right - rect.left + 1)); + utils::hook::set(game::s_wcd::windowHeight, (rect.bottom - rect.top + 1)); utils::hook::set(game::s_wcd::hWnd, CreateWindowExA( 0, class_name, window_name, 0x80CA0000, (swidth - 600) / 2, (sheight - 450) / 2, @@ -129,18 +130,17 @@ namespace console // create the input line utils::hook::set(game::s_wcd::hwndInputLine, CreateWindowExA( - 0, "edit", nullptr, 0x50800080u, 6, 400, 608, 20, *game::s_wcd::hWnd, + 0, "edit", nullptr, 0x50800080u, 6, 400, WINDOW_WIDTH, 20, *game::s_wcd::hWnd, reinterpret_cast(0x65), h_instance, nullptr)); utils::hook::set(game::s_wcd::hwndBuffer, CreateWindowExA( - 0, "edit", nullptr, 0x50A00844u, 6, 70, 606, 324, *game::s_wcd::hWnd, + 0, "edit", nullptr, 0x50A00844u, 6, 70, WINDOW_WIDTH, 324, *game::s_wcd::hWnd, reinterpret_cast(0x64), h_instance, nullptr)); SendMessageA(*game::s_wcd::hwndBuffer, WM_SETFONT, reinterpret_cast(*game::s_wcd::hfBufferFont), 0); utils::hook::set(game::s_wcd::SysInputLineWndProc, reinterpret_cast(SetWindowLongPtrA( *game::s_wcd::hwndInputLine, -4, reinterpret_cast(input_line_wnd_proc)))); - SendMessageA(*game::s_wcd::hwndInputLine, WM_SETFONT, reinterpret_cast(*game::s_wcd::hfBufferFont), - 0); + SendMessageA(*game::s_wcd::hwndInputLine, WM_SETFONT, reinterpret_cast(*game::s_wcd::hfBufferFont), 0); SetFocus(*game::s_wcd::hwndInputLine); game::Con_GetTextCopy(text, 0x4000);