From de81850dd9f471fa897206d099dc3b8615b9cf81 Mon Sep 17 00:00:00 2001 From: Kinglykrab Date: Thu, 18 Jun 2015 23:42:59 -0400 Subject: [PATCH] Fixed possible bot crashes due to nullptr conflict. --- zone/attack.cpp | 2 +- zone/mob_ai.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index a229f197e..ffdb0ec41 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -4249,7 +4249,7 @@ void Mob::TryCriticalHit(Mob *defender, uint16 skill, int32 &damage, ExtraAttack } #ifdef BOTS - if (this->IsPet() && this->GetOwner()->IsBot()) { + if (this->IsPet() && this->GetOwner() && this->GetOwner()->IsBot()) { this->TryPetCriticalHit(defender,skill,damage); return; } diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 650ba350c..045c2cb75 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1105,7 +1105,7 @@ void Mob::AI_Process() { } #ifdef BOTS - if (IsPet() && GetOwner()->IsBot() && target == GetOwner()) + if (IsPet() && GetOwner() && GetOwner()->IsBot() && target == GetOwner()) { // this blocks all pet attacks against owner..bot pet test (copied above check) RemoveFromHateList(this);