mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
Merge branch 'master' into 310
This commit is contained in:
commit
4236f7c75c
21 changed files with 173 additions and 98 deletions
|
|
@ -1777,6 +1777,25 @@ void Creature::CallAssistance()
|
|||
}
|
||||
}
|
||||
|
||||
void Creature::CallForHelp(float fRadius)
|
||||
{
|
||||
if (fRadius <= 0.0f || !getVictim() || isPet() || isCharmed())
|
||||
return;
|
||||
|
||||
CellPair p(MaNGOS::ComputeCellPair(GetPositionX(), GetPositionY()));
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
|
||||
MaNGOS::CallOfHelpCreatureInRangeDo u_do(this, getVictim(), fRadius);
|
||||
MaNGOS::CreatureWorker<MaNGOS::CallOfHelpCreatureInRangeDo> worker(this, u_do);
|
||||
|
||||
TypeContainerVisitor<MaNGOS::CreatureWorker<MaNGOS::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, grid_creature_searcher, *GetMap());
|
||||
}
|
||||
|
||||
bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /*= true*/) const
|
||||
{
|
||||
// we don't need help from zombies :)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue