summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrystanosaurus <25745474+Trystanosaurus@users.noreply.github.com>2018-03-04 19:00:03 +0100
committerIny <Inifield@users.noreply.github.com>2018-03-04 19:00:03 +0100
commitf477948595919e1a3d4b0eb842a623c4d171fecc (patch)
treebcfc43ab0f3f35f5d683dff3f83d7ebb87485e26 /src
parenta36e94a49a5b3bbdf01c622600c87da8cf55a26b (diff)
Implement RATE_CREATURE_AGGRO
Make aggroRate a local variable and return aggro range of 0 if aggroRate is 0 to save unnecessary calculations.
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 8a2a0f3a13..c829c54bdf 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -2699,6 +2699,10 @@ float Creature::GetAggroRange(Unit const* target) const
// Determines the aggro range for creatures
// Based on data from wowwiki due to lack of 3.3.5a data
+ float aggroRate = sWorld->getRate(RATE_CREATURE_AGGRO);
+ if (aggroRate == 0)
+ return 0.0f;
+
uint32 targetLevel = target->getLevelForTarget(this);
uint32 myLevel = getLevelForTarget(target);
int32 levelDiff = int32(targetLevel) - int32(myLevel);
@@ -2729,7 +2733,7 @@ float Creature::GetAggroRange(Unit const* target) const
if (aggroRadius < minRange)
aggroRadius = minRange;
- return aggroRadius;
+ return (aggroRadius * aggroRate);
}
void Creature::SetObjectScale(float scale)