From ba6f156f26aedaa5d3271f9b2b14616614fa996a Mon Sep 17 00:00:00 2001 From: mostlikely4r Date: Sun, 10 Nov 2024 20:26:58 +0100 Subject: [PATCH] -Added some missed if defined which combined BUILD_DEPRECATED_PLAYERBOT and ENABLE_PLAYERBOTS --- src/game/Entities/Player.cpp | 6 +++--- src/game/Server/WorldSession.cpp | 10 +++++----- src/game/Server/WorldSession.h | 7 ++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index 95c1b95d32a..318309bd6bb 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -504,9 +504,9 @@ void TradeData::SetAccepted(bool state, bool crosssend /*= false*/) //== Player ==================================================== Player::Player(WorldSession* session): Unit(), m_taxiTracker(*this), m_mover(this), m_camera(this), m_achievementMgr(this), m_reputationMgr(this), m_launched(false) { -#ifdef BUILD_DEPRECATED_PLAYERBOT - m_playerbotAI = 0; - m_playerbotMgr = 0; +#if defined(BUILD_DEPRECATED_PLAYERBOT) || defined(ENABLE_PLAYERBOTS) + m_playerbotAI = nullptr; + m_playerbotMgr = nullptr; #endif m_speakTime = 0; m_speakCount = 0; diff --git a/src/game/Server/WorldSession.cpp b/src/game/Server/WorldSession.cpp index 324ec8da672..eb810c181dd 100644 --- a/src/game/Server/WorldSession.cpp +++ b/src/game/Server/WorldSession.cpp @@ -204,7 +204,7 @@ void WorldSession::SetExpansion(uint8 expansion) /// Send a packet to the client void WorldSession::SendPacket(WorldPacket const& packet) const { -#ifdef BUILD_DEPRECATED_PLAYERBOT +#if defined(BUILD_DEPRECATED_PLAYERBOT) || defined(ENABLE_PLAYERBOTS) // Send packet to bot AI if (GetPlayer()) { @@ -396,7 +396,7 @@ bool WorldSession::Update(uint32 /*diff*/) // lag can cause STATUS_LOGGEDIN opcodes to arrive after the player started a transfer -#ifdef BUILD_DEPRECATED_PLAYERBOT +#if defined(BUILD_DEPRECATED_PLAYERBOT) || defined(ENABLE_PLAYERBOTS) if (_player && _player->GetPlayerbotMgr()) _player->GetPlayerbotMgr()->HandleMasterIncomingPacket(*packet); #endif @@ -774,7 +774,7 @@ void WorldSession::LogoutPlayer() // GM ticket notification sTicketMgr.OnPlayerOnlineState(*_player, false); -#ifdef BUILD_DEPRECATED_PLAYERBOT +#if defined(BUILD_DEPRECATED_PLAYERBOT) || defined(ENABLE_PLAYERBOTS) // Remember player GUID for update SQL below uint32 guid = _player->GetGUIDLow(); #endif @@ -806,10 +806,10 @@ void WorldSession::LogoutPlayer() static SqlStatementID updChars; -#ifdef BUILD_DEPRECATED_PLAYERBOT +#if defined(BUILD_DEPRECATED_PLAYERBOT) || defined(ENABLE_PLAYERBOTS) // Set for only character instead of accountid // Different characters can be alive as bots - SqlStatement stmt = CharacterDatabase.CreateStatement(updChars, "UPDATE characters SET online = 0 WHERE guid = ?"); + stmt = CharacterDatabase.CreateStatement(updChars, "UPDATE characters SET online = 0 WHERE guid = ?"); stmt.PExecute(guid); #else ///- Since each account can only have one online character at any given time, ensure all characters for active account are marked as offline diff --git a/src/game/Server/WorldSession.h b/src/game/Server/WorldSession.h index 6c7a79f607d..0d6df8006eb 100644 --- a/src/game/Server/WorldSession.h +++ b/src/game/Server/WorldSession.h @@ -301,7 +301,7 @@ class WorldSession char const* GetPlayerName() const; std::string GetChatType(uint32 type); void SetSecurity(AccountTypes security) { _security = security; } -#ifdef BUILD_DEPRECATED_PLAYERBOT +#if defined(BUILD_DEPRECATED_PLAYERBOT) || defined(ENABLE_PLAYERBOTS) // Players connected without socket are bot const std::string GetRemoteAddress() const { return m_socket ? m_socket->GetRemoteAddress() : "disconnected/bot"; } #else @@ -317,10 +317,7 @@ class WorldSession void AssignAnticheat(std::unique_ptr&& anticheat); SessionAnticheatInterface* GetAnticheat() const { return m_anticheat.get(); } -#ifdef BUILD_DEPRECATED_PLAYERBOT - void SetNoAnticheat(); -#endif -#ifdef ENABLE_PLAYERBOTS +#if defined(BUILD_DEPRECATED_PLAYERBOT) || defined(ENABLE_PLAYERBOTS) void SetNoAnticheat(); #endif