mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
[Crash] Fix crash with uninitialized item instance, and Bot timeout (#3296)
This commit is contained in:
+4
-5
@@ -3002,24 +3002,23 @@ void Mob::AddToHateList(Mob* other, int64 hate /*= 0*/, int64 damage /*= 0*/, bo
|
||||
|
||||
// if other is a bot, add the bots client to the hate list
|
||||
if (RuleB(Bots, Enabled)) {
|
||||
while (other->IsBot()) {
|
||||
|
||||
if (other->IsBot()) {
|
||||
auto other_ = other->CastToBot();
|
||||
|
||||
if (!other_ || !other_->GetBotOwner()) {
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
auto owner_ = other_->GetBotOwner()->CastToClient();
|
||||
if (!owner_ || owner_->IsDead() ||
|
||||
!owner_->InZone()) { // added isdead and inzone checks to avoid issues in AddAutoXTarget(...) below
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
if (owner_->GetFeigned()) {
|
||||
AddFeignMemory(owner_);
|
||||
}
|
||||
else if (!hate_list.IsEntOnHateList(owner_)) {
|
||||
|
||||
hate_list.AddEntToHateList(owner_, 0, 0, false, true);
|
||||
owner_->AddAutoXTarget(this); // this was being called on dead/out-of-zone clients
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user