mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-19 03:35:43 +00:00
[Crash fix] Target IsInWorld check
This commit is contained in:
@@ -63,6 +63,10 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!target->IsInWorld())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
std::ostringstream msg;
|
||||
msg << target->GetName();
|
||||
|
||||
|
||||
@@ -29,7 +29,10 @@ uint8 AoeHealValue::Calculate()
|
||||
Player* player = ObjectAccessor::FindPlayer(itr->guid);
|
||||
if (!player || !player->IsAlive())
|
||||
continue;
|
||||
|
||||
|
||||
if (player->GetDistance(bot) >= sPlayerbotAIConfig->sightDistance)
|
||||
continue;
|
||||
|
||||
float percent = (static_cast<float> (player->GetHealth()) / player->GetMaxHealth()) * 100;
|
||||
if (percent <= range)
|
||||
++count;
|
||||
|
||||
Reference in New Issue
Block a user