aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <none@none>2010-12-19 15:22:19 +0100
committerShauren <none@none>2010-12-19 15:22:19 +0100
commit14a480cb13d356e70822317df94e8fa1e7d79e84 (patch)
treeb10cac10426e50e13ffa1e81ece5e7a46c7c6246
parentc35947816c9b49ad247a0e03cd40d5c5a99ad87a (diff)
Core/Players: Fixed recently introduced crashes in Player::ApplyEnchantment
Closes issue #5193. --HG-- branch : trunk
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 2a2d1133386..ab56a0bb145 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -13196,8 +13196,8 @@ void Player::ApplyEnchantment(Item *item, EnchantmentSlot slot, bool apply, bool
{
// Check if the requirements for the prismatic socket are met before applying the gem stats
SpellItemEnchantmentEntry const *pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(item->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
- if(pPrismaticEnchant->requiredSkill > 0 && pPrismaticEnchant->requiredSkillValue > GetSkillValue(pPrismaticEnchant->requiredSkill))
- return;
+ if (!pPrismaticEnchant || (pPrismaticEnchant->requiredSkill > 0 && pPrismaticEnchant->requiredSkillValue > GetSkillValue(pPrismaticEnchant->requiredSkill)))
+ return;
}
if (!item->IsBroken())
@@ -13568,7 +13568,7 @@ void Player::UpdateSkillEnchantments(uint16 skill_id, uint16 curr_value, uint16
{
SpellItemEnchantmentEntry const *pPrismaticEnchant = sSpellItemEnchantmentStore.LookupEntry(m_items[i]->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT));
- if (pPrismaticEnchant->requiredSkill == skill_id)
+ if (pPrismaticEnchant && pPrismaticEnchant->requiredSkill == skill_id)
{
if (curr_value < pPrismaticEnchant->requiredSkillValue && new_value >= pPrismaticEnchant->requiredSkillValue)
ApplyEnchantment(m_items[i], EnchantmentSlot(slot), true);