Skip to content

Commit

Permalink
-Added some missed if defined which combined BUILD_DEPRECATED_PLAYERB…
Browse files Browse the repository at this point in the history
…OT and ENABLE_PLAYERBOTS
  • Loading branch information
mostlikely4r authored and davidonete committed Nov 14, 2024
1 parent 7a6b958 commit ba6f156
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/game/Server/WorldSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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())
{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 2 additions & 5 deletions src/game/Server/WorldSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -317,10 +317,7 @@ class WorldSession
void AssignAnticheat(std::unique_ptr<SessionAnticheatInterface>&& 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

Expand Down

0 comments on commit ba6f156

Please sign in to comment.