aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Entities/Creature
diff options
context:
space:
mode:
authorkaelima <kaelima@live.se>2011-10-19 17:40:44 +0100
committerkaelima <kaelima@live.se>2011-10-19 17:40:44 +0100
commitbe0b2fcf97404af624e538be96ea05892d3f41be (patch)
tree8849332a9a8930226fea13b4e5188f4b521a70c3 /src/server/game/Entities/Creature
parentd7e019072677dd098c491986ebe8c48259d20155 (diff)
Core/Grid:
- Simplified CellArea calculation (Original author: SilverIce) - Removed unused code in Cell class (Original author: SilverIce) - Improve some Visit functions.
Diffstat (limited to 'src/server/game/Entities/Creature')
-rwxr-xr-xsrc/server/game/Entities/Creature/Creature.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index a4dfe76dd21..3d6eaf1a198 100755
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -661,7 +661,6 @@ void Creature::DoFleeToGetAssistance()
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::NearestAssistCreatureInCreatureRangeCheck u_check(this, getVictim(), radius);
Trinity::CreatureLastSearcher<Trinity::NearestAssistCreatureInCreatureRangeCheck> searcher(this, creature, u_check);
@@ -1762,7 +1761,6 @@ Unit* Creature::SelectNearestTarget(float dist) const
{
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Unit* target = NULL;
@@ -1789,7 +1787,6 @@ Unit* Creature::SelectNearestTargetInAttackDistance(float dist) const
{
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Unit* target = NULL;
@@ -1852,7 +1849,6 @@ void Creature::CallAssistance()
{
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
Trinity::AnyAssistCreatureInRangeCheck u_check(this, getVictim(), radius);
@@ -1878,22 +1874,21 @@ void Creature::CallAssistance()
}
}
-void Creature::CallForHelp(float fRadius)
+void Creature::CallForHelp(float radius)
{
- if (fRadius <= 0.0f || !getVictim() || isPet() || isCharmed())
+ if (radius <= 0.0f || !getVictim() || isPet() || isCharmed())
return;
CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
Cell cell(p);
- cell.data.Part.reserved = ALL_DISTRICT;
cell.SetNoCreate();
- Trinity::CallOfHelpCreatureInRangeDo u_do(this, getVictim(), fRadius);
+ Trinity::CallOfHelpCreatureInRangeDo u_do(this, getVictim(), radius);
Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo> worker(this, u_do);
TypeContainerVisitor<Trinity::CreatureWorker<Trinity::CallOfHelpCreatureInRangeDo>, GridTypeMapContainer > grid_creature_searcher(worker);
- cell.Visit(p, grid_creature_searcher, *GetMap(), *this, fRadius);
+ cell.Visit(p, grid_creature_searcher, *GetMap(), *this, radius);
}
bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /*= true*/) const