From 944c7d70cb9ee26deb2b06d5d6eadbce5b9091da Mon Sep 17 00:00:00 2001 From: Niam5 Date: Tue, 26 Mar 2024 18:36:31 -0700 Subject: [PATCH] Try to guard against bots access Eluna hooks Should stop crashes hopefully... --- src/game/Entities/CharacterHandler.cpp | 6 ++++++ src/game/Entities/Player.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/game/Entities/CharacterHandler.cpp b/src/game/Entities/CharacterHandler.cpp index 896c9ce0f2..3a2f367090 100644 --- a/src/game/Entities/CharacterHandler.cpp +++ b/src/game/Entities/CharacterHandler.cpp @@ -975,6 +975,9 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) } #ifdef BUILD_ELUNA // used by eluna +#ifdef ENABLE_PLAYERBOTS + if (pCurrChar->isRealPlayer()) +#endif if (pCurrChar->HasAtLoginFlag(AT_LOGIN_FIRST)) if (Eluna* e = sWorld.GetEluna()) e->OnFirstLogin(pCurrChar); @@ -1012,6 +1015,9 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder) #ifdef BUILD_ELUNA // used by eluna +#ifdef ENABLE_PLAYERBOTS + if (pCurrChar->isRealPlayer()) +#endif if (Eluna* e = sWorld.GetEluna()) e->OnLogin(pCurrChar); #endif diff --git a/src/game/Entities/Player.cpp b/src/game/Entities/Player.cpp index eb97defeb2..86ce26f884 100644 --- a/src/game/Entities/Player.cpp +++ b/src/game/Entities/Player.cpp @@ -2890,6 +2890,9 @@ void Player::GiveLevel(uint32 level) GetSession()->SetCurrentPlayerLevel(level); SendQuestGiverStatusMultiple(); #ifdef BUILD_ELUNA +#ifdef ENABLE_PLAYERBOTS + if(isRealPlayer()) +#endif if (Eluna* e = GetEluna()) e->OnLevelChanged(this, oldLevel); #endif @@ -21796,6 +21799,9 @@ void Player::LearnTalent(uint32 talentId, uint32 talentRank) DETAIL_LOG("TalentID: %u Rank: %u Spell: %u\n", talentId, talentRank, spellid); #ifdef BUILD_ELUNA +#ifdef ENABLE_PLAYERBOTS + if (isRealPlayer()) +#endif if (Eluna* e = GetEluna()) e->OnLearnTalents(this, talentId, talentRank, spellid); #endif