From 6bebc4c160af5cd370dc5d253fd334538baa33b3 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Fri, 6 Nov 2020 15:50:03 +0100 Subject: [PATCH] Fix lua imports, fix linux backspace behaviour in console --- CMakeLists.txt | 4 +++- src/Console.cpp | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 62aa27c..ac906ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,9 @@ add_executable(BeamMP-Server ${source_files}) target_include_directories(BeamMP-Server PUBLIC $ ${Boost_INCLUDE_DIRS}) if (UNIX) - target_link_libraries(BeamMP-Server curl lua5.3 krb5 z pthread stdc++fs ${Boost_LINK_DIRS}) + find_package(Lua 5.3 REQUIRED) + target_include_directories(BeamMP-Server PRIVATE ${LUA_INCLUDE_DIR}) + target_link_libraries(BeamMP-Server curl krb5 z pthread stdc++fs ${Boost_LINK_DIRS} ${LUA_LIBRARIES}) elseif (WIN32) include(FindLua) find_package(CURL CONFIG REQUIRED) diff --git a/src/Console.cpp b/src/Console.cpp index bfc2853..20cb838 100644 --- a/src/Console.cpp +++ b/src/Console.cpp @@ -116,14 +116,17 @@ void SetupConsole() { HandleInput(CInputBuff); CInputBuff.clear(); } - } else if (In == 8) { + } else if (In == 8 || In == 127) { if (!CInputBuff.empty()) CInputBuff.pop_back(); } else if (In == 4) { CInputBuff = "exit"; HandleInput(CInputBuff); CInputBuff.clear(); + } else if (!isprint(In)) { + // ignore } else { + // info(std::to_string(In)); CInputBuff += char(In); } }