diff --git a/CMakeLists.txt b/CMakeLists.txt index 84da81a12..0f0f6b8df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use") set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE) project(Ship LANGUAGES C CXX - VERSION 5.1.3) -set(PROJECT_BUILD_NAME "BRADLEY DELTA" CACHE STRING "") + VERSION 5.1.4) +set(PROJECT_BUILD_NAME "BRADLEY ECHO" CACHE STRING "") set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "") set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh) diff --git a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp index 01c6937a5..48af4c34e 100644 --- a/soh/soh/Enhancements/crowd-control/CrowdControl.cpp +++ b/soh/soh/Enhancements/crowd-control/CrowdControl.cpp @@ -101,7 +101,7 @@ void CrowdControl::Disable() { void CrowdControl::ListenToServer() { while (isEnabled) { - while (!connected) { + while (!connected && isEnabled) { SPDLOG_TRACE("[CrowdControl] Attempting to make connection to server..."); tcpsock = SDLNet_TCP_Open(&ip); @@ -112,8 +112,10 @@ void CrowdControl::ListenToServer() { } } - auto socketSet = SDLNet_AllocSocketSet(1); - SDLNet_TCP_AddSocket(socketSet, tcpsock); + SDLNet_SocketSet socketSet = SDLNet_AllocSocketSet(1); + if (tcpsock) { + SDLNet_TCP_AddSocket(socketSet, tcpsock); + } // Listen to socket messages while (connected && tcpsock && isEnabled) { diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index e6217f88e..f7e3ab277 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -498,6 +498,11 @@ extern "C" void InitOTR() { #ifdef ENABLE_CROWD_CONTROL CrowdControl::Instance = new CrowdControl(); CrowdControl::Instance->Init(); + if (CVar_GetS32("gCrowdControl", 0)) { + CrowdControl::Instance->Enable(); + } else { + CrowdControl::Instance->Disable(); + } #endif }