aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2015-09-05 22:45:15 +0200
committerjackpoz <giacomopoz@gmail.com>2015-09-05 22:45:15 +0200
commit166e66cc06d418b94e14abb30dea6a76ba9edce2 (patch)
tree5ecb6c8c4242fb8c437a8dfea0d39613d39b06ec /src
parent42a71133fa32a1414dc52241c99430178b24422e (diff)
Core/Spells: Fix crash happening when using items to cast spells
Fix a crash happening when using items casting spells like Item ID 37198 Fix #14900
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 88d7dfa6381..25531760b69 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -8335,9 +8335,6 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
return;
}
- // use triggered flag only for items with many spell casts and for not first cast
- uint8 count = 0;
-
// item spells cast at use
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
{
@@ -8358,13 +8355,12 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
continue;
}
- Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
+ Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE);
spell->m_CastItem = item;
spell->m_cast_count = cast_count; // set count of casts
spell->m_glyphIndex = glyphIndex; // glyph index
spell->prepare(&targets);
-
- ++count;
+ return;
}
// Item enchantments spells cast at use
@@ -8386,13 +8382,12 @@ void Player::CastItemUseSpell(Item* item, SpellCastTargets const& targets, uint8
continue;
}
- Spell* spell = new Spell(this, spellInfo, (count > 0) ? TRIGGERED_FULL_MASK : TRIGGERED_NONE);
+ Spell* spell = new Spell(this, spellInfo, TRIGGERED_NONE);
spell->m_CastItem = item;
spell->m_cast_count = cast_count; // set count of casts
spell->m_glyphIndex = glyphIndex; // glyph index
spell->prepare(&targets);
-
- ++count;
+ return;
}
}
}