mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Fix for conditional zone crashes caused by post-bot owner death hate aggregation (irongut_av)
This commit is contained in:
parent
487e994f89
commit
8499c3e65d
@ -2695,16 +2695,24 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
|
|||||||
|
|
||||||
#ifdef BOTS
|
#ifdef BOTS
|
||||||
// if other is a bot, add the bots client to the hate list
|
// if other is a bot, add the bots client to the hate list
|
||||||
if (other->IsBot()) {
|
while (other->IsBot()) {
|
||||||
if (other->CastToBot()->GetBotOwner() && other->CastToBot()->GetBotOwner()->CastToClient()->GetFeigned()) {
|
auto other_ = other->CastToBot();
|
||||||
AddFeignMemory(other->CastToBot()->GetBotOwner()->CastToClient());
|
if (!other_ || !other_->GetBotOwner())
|
||||||
|
break;
|
||||||
|
|
||||||
|
auto owner_ = other_->GetBotOwner()->CastToClient();
|
||||||
|
if (!owner_ || owner_->IsDead() || !owner_->InZone()) // added isdead and inzone checks to avoid issues in AddAutoXTarget(...) below
|
||||||
|
break;
|
||||||
|
|
||||||
|
if (owner_->GetFeigned()) {
|
||||||
|
AddFeignMemory(owner_);
|
||||||
}
|
}
|
||||||
else {
|
else if (!hate_list.IsEntOnHateList(owner_)) {
|
||||||
if (!hate_list.IsEntOnHateList(other->CastToBot()->GetBotOwner())) {
|
hate_list.AddEntToHateList(owner_, 0, 0, false, true);
|
||||||
hate_list.AddEntToHateList(other->CastToBot()->GetBotOwner(), 0, 0, false, true);
|
owner_->AddAutoXTarget(this); // this was being called on dead/out-of-zone clients
|
||||||
other->CastToBot()->GetBotOwner()->CastToClient()->AddAutoXTarget(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
#endif //BOTS
|
#endif //BOTS
|
||||||
|
|
||||||
@ -2716,6 +2724,7 @@ void Mob::AddToHateList(Mob* other, uint32 hate /*= 0*/, int32 damage /*= 0*/, b
|
|||||||
else {
|
else {
|
||||||
if (!hate_list.IsEntOnHateList(other->CastToMerc()->GetMercOwner()))
|
if (!hate_list.IsEntOnHateList(other->CastToMerc()->GetMercOwner()))
|
||||||
hate_list.AddEntToHateList(other->CastToMerc()->GetMercOwner(), 0, 0, false, true);
|
hate_list.AddEntToHateList(other->CastToMerc()->GetMercOwner(), 0, 0, false, true);
|
||||||
|
// if mercs are reworked to include adding 'this' to owner's xtarget list, this should reflect bots code above
|
||||||
}
|
}
|
||||||
} //MERC
|
} //MERC
|
||||||
|
|
||||||
@ -5473,4 +5482,4 @@ int32 Mob::GetHPRegen() const
|
|||||||
int32 Mob::GetManaRegen() const
|
int32 Mob::GetManaRegen() const
|
||||||
{
|
{
|
||||||
return mana_regen;
|
return mana_regen;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user