aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQAston <none@none>2010-01-29 18:51:06 +0100
committerQAston <none@none>2010-01-29 18:51:06 +0100
commit94e5e3970e93fd8726e58697722a1a814211adf0 (patch)
tree2c1d5dbc6e37775fca251769fbdcc2c7784101b1
parent04aff1dba8488525d4eecb9ccc4b3aadc95b8976 (diff)
*Prevent linked effects to apply area auras in Unit::RemoveAreaAurasDueToLeaveWorld, finally fix the update sql
--HG-- branch : trunk
-rw-r--r--sql/updates/7234_world_spell_ranks.sql198
-rw-r--r--src/game/Unit.cpp54
2 files changed, 128 insertions, 124 deletions
diff --git a/sql/updates/7234_world_spell_ranks.sql b/sql/updates/7234_world_spell_ranks.sql
index 18db2291d85..ee69cb2d51c 100644
--- a/sql/updates/7234_world_spell_ranks.sql
+++ b/sql/updates/7234_world_spell_ranks.sql
@@ -1,12 +1,3 @@
-DROP TABLE IF EXISTS `spell_ranks`;
-CREATE TABLE `spell_ranks` (
- `first_spell_id` INT UNSIGNED NOT NULL DEFAULT 0,
- `spell_id` INT UNSIGNED NOT NULL DEFAULT 0,
- `rank` TINYINT UNSIGNED NOT NULL DEFAULT 0,
- PRIMARY KEY (`first_spell_id`, `rank`),
- UNIQUE (`spell_id`)
-) ENGINE=MYISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Spell Rank Data';
-
INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
-- Abomination's Might
(53137, 53137, 1),
@@ -55,12 +46,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(19434, 49049, 8),
(19434, 49050, 9),
-- Alchemy
-(3101, 3101, 1),
-(3101, 2259, 2),
-(3101, 3464, 3),
-(3101, 11611, 4),
-(3101, 28596, 5),
-(3101, 51304, 6),
+(2259, 2259, 1),
+(2259, 3101, 2),
+(2259, 3464, 3),
+(2259, 11611, 4),
+(2259, 28596, 5),
+(2259, 51304, 6),
-- Ambush
(8676, 8676, 1),
(8676, 8724, 2),
@@ -424,12 +415,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(49140, 49663, 4),
(49140, 49664, 5),
-- Blacksmithing
-(3100, 3100, 1),
-(3100, 2018, 2),
-(3100, 3538, 3),
-(3100, 9785, 4),
-(3100, 29844, 5),
-(3100, 51300, 6),
+(2018, 2018, 1),
+(2018, 3100, 2),
+(2018, 3538, 3),
+(2018, 9785, 4),
+(2018, 29844, 5),
+(2018, 51300, 6),
-- Blade Barrier
(51789, 51789, 1),
(51789, 64855, 2),
@@ -850,12 +841,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(20117, 20120, 4),
(20117, 20121, 5),
-- Cooking
-(3102, 3102, 1),
-(3102, 2550, 2),
-(3102, 3413, 3),
-(3102, 18260, 4),
-(3102, 33359, 5),
-(3102, 51296, 6),
+(2550, 2550, 1),
+(2550, 3102, 2),
+(2550, 3413, 3),
+(2550, 18260, 4),
+(2550, 33359, 5),
+(2550, 51296, 6),
-- Cornered
(52234, 52234, 1),
(52234, 53497, 2),
@@ -1200,6 +1191,9 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(1160, 25202, 6),
(1160, 25203, 7),
(1160, 47437, 8),
+ -- Desecration
+(55666, 55666, 1),
+(55666, 55667, 2),
-- Desperate Prayer
(19236, 19236, 1),
(19236, 19238, 2),
@@ -1496,12 +1490,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(33879, 33879, 1),
(33879, 33880, 2),
-- Enchanting
-(7412, 7412, 1),
-(7412, 7411, 2),
-(7412, 7413, 3),
-(7412, 13920, 4),
-(7412, 28029, 5),
-(7412, 51313, 6),
+(7411, 7411, 1),
+(7411, 7412, 2),
+(7411, 7413, 3),
+(7411, 13920, 4),
+(7411, 28029, 5),
+(7411, 51313, 6),
-- Endless Winter
(49137, 49137, 1),
(49137, 49657, 2),
@@ -1519,12 +1513,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(44557, 44560, 2),
(44557, 44561, 3),
-- Engineering
-(4037, 4037, 1),
-(4037, 4036, 2),
-(4037, 4038, 3),
-(4037, 12656, 4),
-(4037, 30350, 5),
-(4037, 51306, 6),
+(4036, 4036, 1),
+(4036, 4037, 2),
+(4036, 4038, 3),
+(4036, 12656, 4),
+(4036, 30350, 5),
+(4036, 51306, 6),
-- Enhancing Totems
(16259, 16259, 1),
(16259, 16295, 2),
@@ -1864,12 +1858,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(44442, 44442, 1),
(44442, 44443, 2),
-- First Aid
-(3274, 3274, 1),
-(3274, 3273, 2),
-(3274, 7924, 3),
-(3274, 10846, 4),
-(3274, 27028, 5),
-(3274, 45542, 6),
+(3273, 3273, 1),
+(3273, 3274, 2),
+(3273, 7924, 3),
+(3273, 10846, 4),
+(3273, 27028, 5),
+(3273, 45542, 6),
-- Flame Shock
(8050, 8050, 1),
(8050, 8052, 2),
@@ -2462,12 +2456,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(16511, 26864, 4),
(16511, 48660, 5),
-- Herb Gathering
-(2368, 2368, 1),
-(2368, 2366, 2),
-(2368, 3570, 3),
-(2368, 11993, 4),
-(2368, 28695, 5),
-(2368, 50300, 6),
+(2366, 2366, 1),
+(2366, 2368, 2),
+(2366, 3570, 3),
+(2366, 11993, 4),
+(2366, 28695, 5),
+(2366, 50300, 6),
-- Heroic Strike
(78, 78, 1),
(78, 284, 2),
@@ -3152,12 +3146,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(588, 48040, 8),
(588, 48168, 9),
-- Inscription
-(45358, 45358, 1),
-(45358, 45357, 2),
-(45358, 45359, 3),
-(45358, 45360, 4),
-(45358, 45361, 5),
-(45358, 45363, 6),
+(45357, 45357, 1),
+(45357, 45358, 2),
+(45357, 45359, 3),
+(45357, 45360, 4),
+(45357, 45361, 5),
+(45357, 45363, 6),
-- Insect Swarm
(5570, 5570, 1),
(5570, 24974, 2),
@@ -3197,12 +3191,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(12300, 12959, 2),
(12300, 12960, 3),
-- Jewelcrafting
-(25230, 25230, 1),
-(25230, 25229, 2),
-(25230, 28894, 3),
-(25230, 28895, 4),
-(25230, 28897, 5),
-(25230, 51311, 6),
+(25229, 25229, 1),
+(25229, 25230, 2),
+(25229, 28894, 3),
+(25229, 28895, 4),
+(25229, 28897, 5),
+(25229, 51311, 6),
-- Judgements of the Just
(53695, 53695, 1),
(53695, 53696, 2),
@@ -3283,12 +3277,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(633, 27154, 4),
(633, 48788, 5),
-- Leatherworking
-(3104, 3104, 1),
-(3104, 2108, 2),
-(3104, 3811, 3),
-(3104, 10662, 4),
-(3104, 32549, 5),
-(3104, 51302, 6),
+(2108, 2108, 1),
+(2108, 3104, 2),
+(2108, 3811, 3),
+(2108, 10662, 4),
+(2108, 32549, 5),
+(2108, 51302, 6),
-- Lesser Heal
(2050, 2050, 1),
(2050, 2052, 2),
@@ -3403,9 +3397,9 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(56342, 56343, 2),
(56342, 56344, 3),
-- Lockpicking
-(1810, 1810, 1),
-(1810, 1809, 2),
-(1810, 6460, 3),
+(1809, 1809, 1),
+(1809, 1810, 2),
+(1809, 6460, 3),
-- Longevity
(53262, 53262, 1),
(53262, 53263, 2),
@@ -3690,12 +3684,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(2096, 2096, 1),
(2096, 10909, 2),
-- Mining
-(2576, 2576, 1),
-(2576, 2575, 2),
-(2576, 3564, 3),
-(2576, 10248, 4),
-(2576, 29354, 5),
-(2576, 50310, 6),
+(2575, 2575, 1),
+(2575, 2576, 2),
+(2575, 3564, 3),
+(2575, 10248, 4),
+(2575, 29354, 5),
+(2575, 50310, 6),
-- Missile Barrage
(44404, 44404, 1),
(44404, 54486, 2),
@@ -4891,12 +4885,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(1752, 48637, 11),
(1752, 48638, 12),
-- Skinning
-(8617, 8617, 1),
-(8617, 8613, 2),
-(8617, 8618, 3),
-(8617, 10768, 4),
-(8617, 32678, 5),
-(8617, 50305, 6),
+(8613, 8613, 1),
+(8613, 8617, 2),
+(8613, 8618, 3),
+(8613, 10768, 4),
+(8613, 32678, 5),
+(8613, 50305, 6),
-- Slam
(1464, 1464, 1),
(1464, 8820, 2),
@@ -5300,12 +5294,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(12295, 12676, 2),
(12295, 12677, 3),
-- Tailoring
-(3909, 3909, 1),
-(3909, 3908, 2),
-(3909, 3910, 3),
-(3909, 12180, 4),
-(3909, 26790, 5),
-(3909, 51309, 6),
+(3908, 3908, 1),
+(3908, 3909, 2),
+(3908, 3910, 3),
+(3908, 12180, 4),
+(3908, 26790, 5),
+(3908, 51309, 6),
-- Taste for Blood
(56636, 56636, 1),
(56636, 56637, 2),
@@ -6503,12 +6497,12 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(30165, 29177, 2),
(30165, 29178, 3),
-- Fishing
-(7731, 7731, 1),
-(7731, 7620, 2),
-(7731, 7732, 3),
-(7731, 18248, 4),
-(7731, 33095, 5),
-(7731, 51294, 6),
+(7620, 7620, 1),
+(7620, 7731, 2),
+(7620, 7732, 3),
+(7620, 18248, 4),
+(7620, 33095, 5),
+(7620, 51294, 6),
-- Icy Touch
(45477, 45477, 1),
(45477, 49896, 2),
@@ -6614,11 +6608,11 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
-- Anesthetic Poison
(26785, 26785, 1),
(26785, 57982, 2),
- -- Journeyman Riding
-(33391, 33391, 1),
-(33391, 33388, 2),
-(33391, 34090, 3),
-(33391, 34091, 4),
+ -- Apprentice Riding
+(33388, 33388, 1),
+(33388, 33391, 2),
+(33388, 34090, 3),
+(33388, 34091, 4),
-- Primal Fury
(16958, 16958, 1),
(16958, 16961, 2),
@@ -6902,4 +6896,4 @@ INSERT INTO spell_ranks (`first_spell_id`, `spell_id`, `rank`) VALUES
(5729, 25512, 7),
(5729, 58586, 8),
(5729, 58587, 9),
-(5729, 58588, 10);
+(5729, 58588, 10); \ No newline at end of file
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index d9c1179823c..bb48d49ab7b 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -4300,33 +4300,43 @@ void Unit::RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemo
void Unit::RemoveAreaAurasDueToLeaveWorld()
{
- // make sure that all area auras not applied on self are removed - prevent access to deleted pointer later
- for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
+ bool cleanRun;
+ do
{
- Aura * aura = iter->second;
- ++iter;
- Aura::ApplicationMap const & appMap = aura->GetApplicationMap();
- for(Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
+ cleanRun = true;
+ // make sure that all area auras not applied on self are removed - prevent access to deleted pointer later
+ for (AuraMap::iterator iter = m_ownedAuras.begin(); iter != m_ownedAuras.end();)
{
- AuraApplication * aurApp = itr->second;
- ++itr;
- Unit * target = aurApp->GetTarget();
- if (target == this)
- continue;
- target->RemoveAura(aurApp);
- // things linked on aura remove may apply new area aura - so start from the beginning
- iter = m_ownedAuras.begin();
+ Aura * aura = iter->second;
+ ++iter;
+ Aura::ApplicationMap const & appMap = aura->GetApplicationMap();
+ for(Aura::ApplicationMap::const_iterator itr = appMap.begin(); itr!= appMap.end();)
+ {
+ AuraApplication * aurApp = itr->second;
+ ++itr;
+ Unit * target = aurApp->GetTarget();
+ if (target == this)
+ continue;
+ target->RemoveAura(aurApp);
+ cleanRun = false;
+ // things linked on aura remove may apply new area aura - so start from the beginning
+ iter = m_ownedAuras.begin();
+ }
}
- }
- // remove area auras owned by others
- for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
- {
- if (iter->second->GetBase()->GetOwner()!=this)
- RemoveAura(iter);
- else
- ++iter;
+ // remove area auras owned by others
+ for (AuraApplicationMap::iterator iter = m_appliedAuras.begin(); iter != m_appliedAuras.end();)
+ {
+ if (iter->second->GetBase()->GetOwner()!=this)
+ {
+ RemoveAura(iter);
+ cleanRun = false;
+ }
+ else
+ ++iter;
+ }
}
+ while (!cleanRun);
}
void Unit::RemoveAllAuras()