2084: Fix antibot crash after map change r=def- a=heinrich5991



Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
bors[bot] 2020-03-14 20:01:57 +00:00 committed by GitHub
commit b6d6c8eed7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -1151,6 +1151,14 @@ target_link_libraries(${TARGET_SERVER} ${LIBS_SERVER})
list(APPEND TARGETS_OWN ${TARGET_SERVER}) list(APPEND TARGETS_OWN ${TARGET_SERVER})
list(APPEND TARGETS_LINK ${TARGET_SERVER}) list(APPEND TARGETS_LINK ${TARGET_SERVER})
if(ANTIBOT)
if(CMAKE_VERSION VERSION_LESS 3.14 AND (CMAKE_VERSION VERSION_GREATER 3.8 OR CMAKE_VERSION VERSION_EQUAL 3.8))
set_property(TARGET ${TARGET_SERVER} PROPERTY BUILD_RPATH "$ORIGIN")
else()
message(STATUS "Can't set BUILD_RPATH in CMake before 3.8, pass -Wl,-rpath,'$ORIGIN' manually if you wish to emulate this. Or just install a newer version of CMake...")
endif()
endif()
if(TARGET_OS AND TARGET_OS STREQUAL "mac") if(TARGET_OS AND TARGET_OS STREQUAL "mac")
set(SERVER_LAUNCHER_SRC src/osxlaunch/server.mm) set(SERVER_LAUNCHER_SRC src/osxlaunch/server.mm)
set(TARGET_SERVER_LAUNCHER ${TARGET_SERVER}-Launcher) set(TARGET_SERVER_LAUNCHER ${TARGET_SERVER}-Launcher)
@ -1679,6 +1687,9 @@ foreach(target ${TARGETS_OWN})
set_property(TARGET ${target} PROPERTY CXX_STANDARD 11) set_property(TARGET ${target} PROPERTY CXX_STANDARD 11)
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED ON) set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED ON)
endif() endif()
if(CMAKE_VERSION VERSION_GREATER 3.14 OR CMAKE_VERSION VERSION_EQUAL 3.14)
set_property(TARGET ${TARGET_SERVER} PROPERTY BUILD_RPATH_USE_ORIGIN TRUE)
endif()
if(MSVC) if(MSVC)
target_compile_options(${target} PRIVATE /wd4244) # Possible loss of data (float -> int, int -> float, etc.). target_compile_options(${target} PRIVATE /wd4244) # Possible loss of data (float -> int, int -> float, etc.).

View file

@ -2572,7 +2572,6 @@ void CGameContext::OnConsoleInit()
m_pConsole = Kernel()->RequestInterface<IConsole>(); m_pConsole = Kernel()->RequestInterface<IConsole>();
m_pEngine = Kernel()->RequestInterface<IEngine>(); m_pEngine = Kernel()->RequestInterface<IEngine>();
m_pStorage = Kernel()->RequestInterface<IStorage>(); m_pStorage = Kernel()->RequestInterface<IStorage>();
m_Antibot.Init(this);
m_ChatPrintCBIndex = Console()->RegisterPrintCallback(0, SendChatResponse, this); m_ChatPrintCBIndex = Console()->RegisterPrintCallback(0, SendChatResponse, this);
@ -2618,6 +2617,7 @@ void CGameContext::OnInit(/*class IKernel *pKernel*/)
m_pConsole = Kernel()->RequestInterface<IConsole>(); m_pConsole = Kernel()->RequestInterface<IConsole>();
m_pEngine = Kernel()->RequestInterface<IEngine>(); m_pEngine = Kernel()->RequestInterface<IEngine>();
m_pStorage = Kernel()->RequestInterface<IStorage>(); m_pStorage = Kernel()->RequestInterface<IStorage>();
m_Antibot.Init(this);
m_World.SetGameServer(this); m_World.SetGameServer(this);
m_Events.SetGameServer(this); m_Events.SetGameServer(this);