diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c28440..7f902d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,8 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wzero-as-null-pointer-constant -Weffc++ -Wunknown-pragmas") if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror") + set(CMAKE_CXX_FLAGS "-O2 -finline-functions") + set(CMAKE_SHARED_LINKER_FLAGS "-s") endif() endif() diff --git a/src/main.cpp b/src/main.cpp index 2405f31..3cf1446 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -90,7 +90,7 @@ enum class ModuleFunctions LastElement = MODEL_INDEXF }; #define MODULE_CHECKS "module_checks" -bool moduleFunctions[(std::size_t)ModuleFunctions::LastElement]; +bool moduleFunctions[(std::size_t)ModuleFunctions::LastElement + 1]; void loadConfiguration(); C_DLLEXPORT int Meta_Query(const char * /*ifvers */, plugin_info_t **pPlugInfo, mutil_funcs_t *pMetaUtilFuncs) @@ -192,7 +192,7 @@ void loadConfiguration() const std::string logPrefix = "[Ultimate Unprecacher] "; std::time_t curTime = std::time(nullptr); auto localTime = std::localtime(&curTime); - SERVER_PRINT((*mapName + str_put_time(localTime, " %H:%M:%S - ") + str + "\n" ).c_str()); + SERVER_PRINT((logPrefix + *mapName + str_put_time(localTime, " %H:%M:%S - ") + str + "\n" ).c_str()); }); module->getLoggerRef()->setFileFunction([&](const std::string &str)