aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <none@none>2010-11-13 18:54:33 +0100
committerShauren <none@none>2010-11-13 18:54:33 +0100
commitec49ce5fc3d5d57109dd6bce405b1a05b3f351e1 (patch)
tree851a07d57b479af8c4d68325917554db22e9cb26 /src
parent880ef0c398a043b60d18e750c420dd8209272cb3 (diff)
Core/Spells: Fixed possible crashes in scaling mounts code when player is not in a valid zone
--HG-- branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-xsrc/server/game/Spells/SpellEffects.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index d1bb898d228..1d30b69588d 100755
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -4472,7 +4472,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->GetPosition(x, y, z);
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
- if (canFly && pArea->flags & AREA_FLAG_NO_FLY_ZONE)
+ if (canFly && (pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE) || !pArea)
canFly = false;
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
@@ -4517,7 +4517,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->GetPosition(x, y, z);
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
- if (canFly && pArea->flags & AREA_FLAG_NO_FLY_ZONE)
+ if (canFly && (pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE) || !pArea)
canFly = false;
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
@@ -4842,7 +4842,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->GetPosition(x, y, z);
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
- if (canFly && pArea->flags & AREA_FLAG_NO_FLY_ZONE)
+ if (canFly && (pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE) || !pArea)
canFly = false;
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
@@ -4888,7 +4888,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->GetPosition(x, y, z);
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
- if (canFly && pArea->flags & AREA_FLAG_NO_FLY_ZONE)
+ if (canFly && (pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE) || !pArea)
canFly = false;
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
@@ -4951,7 +4951,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
unitTarget->GetPosition(x, y, z);
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
- if (canFly && pArea->flags & AREA_FLAG_NO_FLY_ZONE)
+ if (canFly && (pArea && pArea->flags & AREA_FLAG_NO_FLY_ZONE) || !pArea)
canFly = false;
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))