Skip to content

Commit

Permalink
Try to guard against bots access Eluna hooks
Browse files Browse the repository at this point in the history
Should stop crashes hopefully...
  • Loading branch information
Niam5 committed Apr 8, 2024
1 parent 94ea9e2 commit 83e7bac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/game/Entities/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 83e7bac

Please sign in to comment.