From 3628b427ba67fe3f45368a15b207ad0fa060a491 Mon Sep 17 00:00:00 2001 From: QAston Date: Tue, 17 Feb 2009 18:43:51 +0100 Subject: *Fix some crashes. --HG-- branch : trunk --- src/game/Unit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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)) -- cgit v1.2.3