mirror of
https://github.com/mod-playerbots/mod-playerbots.git
synced 2026-01-14 01:19:08 +00:00
Resolved issues with herb gathering (#926)
* Check game objects loot tables and determine if loot is valid * Removed LOS checks since they already occur and removed enemy near node check * Dismount if mounted, decresed interaction distance, added looting delay * Decreased interaction distance * oops, wrong file * Check game objects loot tables and determine if loot is valid
This commit is contained in:
@@ -51,29 +51,11 @@ bool AddGatheringLootAction::AddLoot(ObjectGuid guid)
|
||||
if (loot.IsEmpty() || !wo)
|
||||
return false;
|
||||
|
||||
if (!bot->IsWithinLOSInMap(wo))
|
||||
return false;
|
||||
|
||||
if (loot.skillId == SKILL_NONE)
|
||||
return false;
|
||||
|
||||
if (!loot.IsLootPossible(bot))
|
||||
return false;
|
||||
|
||||
if (sServerFacade->IsDistanceGreaterThan(sServerFacade->GetDistance2d(bot, wo), INTERACTION_DISTANCE))
|
||||
{
|
||||
std::list<Unit*> targets;
|
||||
Acore::AnyUnfriendlyUnitInObjectRangeCheck u_check(bot, bot, sPlayerbotAIConfig->lootDistance);
|
||||
Acore::UnitListSearcher<Acore::AnyUnfriendlyUnitInObjectRangeCheck> searcher(bot, targets, u_check);
|
||||
Cell::VisitAllObjects(bot, searcher, sPlayerbotAIConfig->lootDistance * 1.5f);
|
||||
if (!targets.empty())
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << "Kill that " << targets.front()->GetName() << " so I can loot freely";
|
||||
botAI->TellError(out.str());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return AddAllLootAction::AddLoot(guid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user