mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Merge #2084
2084: Fix antibot crash after map change r=def- a=heinrich5991 Co-authored-by: heinrich5991 <heinrich5991@gmail.com>
This commit is contained in:
commit
b6d6c8eed7
|
@ -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.).
|
||||||
|
|
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue