master
Dominik Madarász 2024-06-21 15:21:22 +02:00
parent c1464c55e1
commit 3290fcbdef
1 changed files with 9 additions and 4 deletions

View File

@ -106,7 +106,7 @@ public:
void OnLogin(Player* player) override
{
if (player->GetSession()->IsBot())
if (!player->GetSession() || player->GetSession()->IsBot())
{
return;
}
@ -129,7 +129,7 @@ public:
void SaveData(Player* player)
{
if (player->GetSession()->IsBot())
if (!player->GetSession() || player->GetSession()->IsBot())
{
return;
}
@ -188,7 +188,12 @@ public:
void OnSpellCast(Player* player, Spell* spell, bool /*skipCheck*/) override
{
if (!NeedsEnabled || !spell->m_CastItem || player->GetSession()->IsBot())
if (!NeedsEnabled || !player || !player->GetSession())
{
return;
}
if (!spell->m_CastItem || player->GetSession()->IsBot())
{
return;
}
@ -225,7 +230,7 @@ public:
void OnBeforeUpdate(Player* player, uint32 /* p_time */) override
{
if (!NeedsEnabled || !player->IsInWorld() || !player->IsAlive() || player->GetSession()->IsBot())
if (!NeedsEnabled || !player->IsInWorld() || !player->IsAlive() || !player->GetSession() || player->GetSession()->IsBot())
{
return;
}