aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorQAston <none@none>2009-02-17 18:43:51 +0100
committerQAston <none@none>2009-02-17 18:43:51 +0100
commit3628b427ba67fe3f45368a15b207ad0fa060a491 (patch)
treefd14107865a9570d8657ecbfff6f34523bd5fef0 /src
parenteafa0eb5dff579c72f5b45b7c15ce1c0fc3abc04 (diff)
*Fix some crashes.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 3bd2eb0e54d..b7a92c98125 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10229,6 +10229,8 @@ void Unit::ApplyDiminishingAura( DiminishingGroup group, bool apply )
uint32 Unit::GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry)
{
+ if (!rangeEntry)
+ return 0;
if (rangeEntry->maxRangeHostile == rangeEntry->maxRangeFriend)
return rangeEntry->maxRangeFriend;
if (IsHostileTo(target))
@@ -10237,6 +10239,8 @@ uint32 Unit::GetSpellMaxRangeForTarget(Unit* target,const SpellRangeEntry * rang
};
uint32 Unit::GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rangeEntry)
{
+ if (!rangeEntry)
+ return 0;
if (rangeEntry->minRangeHostile == rangeEntry->minRangeFriend)
return rangeEntry->minRangeFriend;
if (IsHostileTo(target))
@@ -10245,6 +10249,8 @@ uint32 Unit::GetSpellMinRangeForTarget(Unit* target,const SpellRangeEntry * rang
};
uint32 Unit::GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry)
{
+ if (!radiusEntry)
+ return 0;
if (radiusEntry->radiusHostile == radiusEntry->radiusFriend)
return radiusEntry->radiusFriend;
if (IsHostileTo(target))