Core/Spells: Fixed possible crashes in scaling mounts code when player is not in a valid zone
--HG-- branch : trunk
This commit is contained in:
@@ -4472,7 +4472,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
|||||||
unitTarget->GetPosition(x, y, z);
|
unitTarget->GetPosition(x, y, z);
|
||||||
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
||||||
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
|
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;
|
canFly = false;
|
||||||
|
|
||||||
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
||||||
@@ -4517,7 +4517,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
|||||||
unitTarget->GetPosition(x, y, z);
|
unitTarget->GetPosition(x, y, z);
|
||||||
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
||||||
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
|
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;
|
canFly = false;
|
||||||
|
|
||||||
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
||||||
@@ -4842,7 +4842,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
|||||||
unitTarget->GetPosition(x, y, z);
|
unitTarget->GetPosition(x, y, z);
|
||||||
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
||||||
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
|
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;
|
canFly = false;
|
||||||
|
|
||||||
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
||||||
@@ -4888,7 +4888,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
|||||||
unitTarget->GetPosition(x, y, z);
|
unitTarget->GetPosition(x, y, z);
|
||||||
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
||||||
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
|
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;
|
canFly = false;
|
||||||
|
|
||||||
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
||||||
@@ -4951,7 +4951,7 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
|
|||||||
unitTarget->GetPosition(x, y, z);
|
unitTarget->GetPosition(x, y, z);
|
||||||
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
uint32 areaFlag = unitTarget->GetBaseMap()->GetAreaFlag(x, y, z);
|
||||||
AreaTableEntry const *pArea = sAreaStore.LookupEntry(areaFlag);
|
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;
|
canFly = false;
|
||||||
|
|
||||||
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
switch(unitTarget->ToPlayer()->GetBaseSkillValue(SKILL_RIDING))
|
||||||
|
|||||||
Reference in New Issue
Block a user