aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql1
-rw-r--r--sql/updates/world/2012_02_29_00_world_conditions_misc.sql126
-rw-r--r--sql/updates/world/2012_02_29_01_world_conditions.sql5
-rw-r--r--sql/updates/world/2012_02_29_02_world_conditions.sql5
-rw-r--r--sql/updates/world/2012_02_29_03_world_creature_text.sql18
-rw-r--r--sql/updates/world/2012_02_29_04_world_creature_text.sql11
-rw-r--r--sql/updates/world/2012_02_29_05_world_creature_text.sql15
-rw-r--r--sql/updates/world/2012_03_01_00_world_conditions.sql5
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp51
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.h27
-rwxr-xr-xsrc/server/game/Entities/Object/Object.cpp12
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp16
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp12
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.h1
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp3
-rwxr-xr-xsrc/server/game/Maps/Map.cpp5
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp27
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp19
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp40
-rw-r--r--src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp32
-rw-r--r--src/server/shared/Packets/ByteBuffer.cpp22
-rwxr-xr-xsrc/server/shared/Packets/ByteBuffer.h24
22 files changed, 333 insertions, 144 deletions
diff --git a/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql b/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql
new file mode 100644
index 00000000000..da3a0f786b8
--- /dev/null
+++ b/sql/updates/characters/2012_03_01_00_characters_character_queststatus.sql
@@ -0,0 +1 @@
+DELETE FROM `character_queststatus` WHERE `status`=0;
diff --git a/sql/updates/world/2012_02_29_00_world_conditions_misc.sql b/sql/updates/world/2012_02_29_00_world_conditions_misc.sql
new file mode 100644
index 00000000000..34eb1261ed1
--- /dev/null
+++ b/sql/updates/world/2012_02_29_00_world_conditions_misc.sql
@@ -0,0 +1,126 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup` IN(34125,33796,33798,33799,33791,33792,33790,
+33795,33793,33800,33794,33843,33842,26421,26477,28161,29856,32788,32790);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,
+`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES
+-- Stabled Campagin Warhorse Requires Any of the Dailies
+(18,34125,63215,1,9,0,13847,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,2,9,0,13851,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,3,9,0,13852,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,4,9,0,13854,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,5,9,0,13855,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,6,9,0,13856,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,7,9,0,13857,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,8,9,0,13858,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,9,9,0,13859,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,10,9,0,13860,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,11,9,0,13861,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,12,9,0,13862,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,13,9,0,13863,0,0,0,'Required quest active for spellclick'),
+(18,34125,63215,14,9,0,13864,0,0,0,'Required quest active for spellclick'),
+-- Raptor requires (A) Valiant of Sen'Jin
+(18,33796,62784,1,8,0,13693,0,0,0,'Required quest rewarded for spellclick'),
+(18,33796,62784,2,8,0,13708,0,0,0,'Required quest rewarded for spellclick'),
+-- Forsaken Warhorse requires (A) Valiant of Undercity
+(18,33798,62787,1,8,0,13695,0,0,0,'Required quest rewarded for spellclick'),
+(18,33798,62787,2,8,0,13710,0,0,0,'Required quest rewarded for spellclick'),
+-- Orgrimmar Wolf requires (A) Valiant of Orgrimmar
+(18,33799,62783,1,8,0,13691,0,0,0,'Required quest rewarded for spellclick'),
+(18,33799,62783,2,8,0,13707,0,0,0,'Required quest rewarded for spellclick'),
+-- Silvermoon Hawkstrider requires (A) Valiant of Silvermoon
+(18,33791,62786,1,8,0,13696,0,0,0,'Required quest rewarded for spellclick'),
+(18,33791,62786,2,8,0,13711,0,0,0,'Required quest rewarded for spellclick'),
+-- Thunder Bluff Kodo requires (A) Valiant of Thunder Bluff
+(18,33792,62785,1,8,0,13694,0,0,0,'Required quest rewarded for spellclick'),
+(18,33792,62785,2,8,0,13709,0,0,0,'Required quest rewarded for spellclick'),
+-- Exodar Elekk requires (A) Valiant of the Exodar
+(18,33790,62781,1,8,0,13690,0,0,0,'Required quest rewarded for spellclick'),
+(18,33790,62781,2,8,0,13705,0,0,0,'Required quest rewarded for spellclick'),
+-- Ironforge Ram requires (A) Valiant of Ironforge
+(18,33795,62779,1,8,0,13685,0,0,0,'Required quest rewarded for spellclick'),
+(18,33795,62779,2,8,0,13703,0,0,0,'Required quest rewarded for spellclick'),
+-- Gnomeregan Mechanostrider requires (A) Valiant of Gnomeregan
+(18,33793,62780,1,8,0,13688,0,0,0,'Required quest rewarded for spellclick'),
+(18,33793,62780,2,8,0,13704,0,0,0,'Required quest rewarded for spellclick'),
+-- Stormwind Steed requires (A) Valiant of Stormwind
+(18,33800,62774,1,8,0,13593,0,0,0,'Required quest rewarded for spellclick'),
+(18,33800,62774,2,8,0,13684,0,0,0,'Required quest rewarded for spellclick'),
+-- Darnassian Nightsaber requires (A) Valiant of Darnassus
+(18,33794,62782,1,8,0,13689,0,0,0,'Required quest rewarded for spellclick'),
+(18,33794,62782,2,8,0,13706,0,0,0,'Required quest rewarded for spellclick'),
+-- Stabled Quel'Dorei steeds requires The Argent Tournament rewarded
+(18,33843,63792,0,8,0,13667,0,0,0,'Required quest rewarded for spellclick'),
+-- Stabled Quel'Dorei steed forbids Alliance Eligibility Marker rewarded
+(18,33843,63792,0,8,0,13686,0,0,1,'Forbidden rewarded quest for spellclick'),
+-- Sunreaver Hawkstrider requires The Argent Tournament rewarded
+(18,33842,63791,0,8,0,13668,0,0,0,'Required quest rewarded for spellclick'),
+-- Sunreaver Hawkstrider forbids Horde Eligibility Marker rewarded
+(18,33842,63791,0,8,0,13687,0,0,1,'Forbidden rewarded quest for spellclick'),
+-- Misc
+(18,26421,47575,0,8,0,12092,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26421,47575,0,8,0,12096,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26421,47575,1,9,0,12092,0,0,0,'Required quest active for spellclick'),
+(18,26421,47575,2,9,0,12096,0,0,0,'Required quest active for spellclick'),
+(18,26477,47096,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26477,47096,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26477,61286,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26477,61286,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26477,61832,0,8,0,11999,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26477,61832,0,8,0,12000,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,26477,61286,1,9,0,11999,0,0,0,'Required quest active for spellclick'),
+(18,26477,61286,2,9,0,12000,0,0,0,'Required quest active for spellclick'),
+(18,26477,47096,1,9,0,11999,0,0,0,'Required quest active for spellclick'),
+(18,26477,47096,2,9,0,12000,0,0,0,'Required quest active for spellclick'),
+(18,26477,61832,1,9,0,11999,0,0,0,'Required quest active for spellclick'),
+(18,26477,61832,2,9,0,12000,0,0,0,'Required quest active for spellclick'),
+(18,28161,39996,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,28161,39996,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,28161,39996,1,9,0,12532,0,0,0,'Required quest active for spellclick'),
+(18,28161,39996,2,9,0,12702,0,0,0,'Required quest active for spellclick'),
+(18,28161,51037,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,28161,51037,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,28161,51037,1,9,0,12532,0,0,0,'Required quest active for spellclick'),
+(18,28161,51037,2,9,0,12702,0,0,0,'Required quest active for spellclick'),
+(18,28161,51961,0,8,0,12532,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,28161,51961,0,8,0,12702,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,28161,51961,1,9,0,12532,0,0,0,'Required quest active for spellclick'),
+(18,28161,51961,2,9,0,12702,0,0,0,'Required quest active for spellclick'),
+(18,29856,55363,0,8,0,12629,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,29856,55363,0,8,0,12643,0,0,1,'Forbidden rewarded quest for spellclick'),
+(18,29856,55363,1,9,0,12629,0,0,0,'Required quest active for spellclick'),
+(18,29856,55363,2,9,0,12643,0,0,0,'Required quest active for spellclick'),
+(18,32788,57539,1,8,0,13075,0,0,0,'Required quest rewarded for spellclick'),
+(18,32788,57539,2,9,0,13075,0,0,0,'Required quest active for spellclick'),
+(18,32790,57654,1,8,0,13073,0,0,0,'Required quest rewarded for spellclick'),
+(18,32790,57654,2,9,0,13073,0,0,0,'Required quest active for spellclick');
+
+-- Remove duplicate entries in npc_spellclick_spells (leave 1)
+DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN(34125,26421,26477,28161,
+31157,33790,33791,33792,33793,33794,33795,33796,33798,33799,33800,34944,29856,30564,29414,31269);
+INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES
+(26477,47096,2,0),
+(26477,61286,2,0),
+(26477,61832,0,0),
+(29414,18277,1,0),
+(29856,55363,2,0),
+(31269,46598,1,0),
+(33794,62782,1,0),
+(28161,51037,2,0),
+(28161,39996,1,0),
+(30564,57401,1,0),
+(34125,63215,1,0),
+(34944,68458,1,0),
+(33790,62781,1,0),
+(33793,62780,1,0),
+(33795,62779,1,0),
+(33800,62774,1,0),
+(33798,62787,1,0),
+(31157,46598,1,0),
+(26421,47575,1,0),
+(28161,51961,1,0),
+(33791,62786,1,0),
+(33792,62785,1,0),
+(33796,62784,1,0),
+(33799,62783,1,0);
+
+-- If this query fails, fix your custom content
+ALTER TABLE `npc_spellclick_spells` ADD PRIMARY KEY(`npc_entry`,`spell_id`); \ No newline at end of file
diff --git a/sql/updates/world/2012_02_29_01_world_conditions.sql b/sql/updates/world/2012_02_29_01_world_conditions.sql
new file mode 100644
index 00000000000..bae8baf51a9
--- /dev/null
+++ b/sql/updates/world/2012_02_29_01_world_conditions.sql
@@ -0,0 +1,5 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,
+`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES
+(18,29488,54568,15,8,0,12670,0,0,0,'Required quest rewarded for spellclick'),
+(18,29488,54568,15,9,0,12670,0,0,0,'Required quest active for spellclick');
diff --git a/sql/updates/world/2012_02_29_02_world_conditions.sql b/sql/updates/world/2012_02_29_02_world_conditions.sql
new file mode 100644
index 00000000000..a28e6d6424f
--- /dev/null
+++ b/sql/updates/world/2012_02_29_02_world_conditions.sql
@@ -0,0 +1,5 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,
+`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES
+(18,29488,54568,1,8,0,12670,0,0,0,'Required quest rewarded for spellclick'),
+(18,29488,54568,2,9,0,12670,0,0,0,'Required quest active for spellclick');
diff --git a/sql/updates/world/2012_02_29_03_world_creature_text.sql b/sql/updates/world/2012_02_29_03_world_creature_text.sql
new file mode 100644
index 00000000000..2e1d3d77dde
--- /dev/null
+++ b/sql/updates/world/2012_02_29_03_world_creature_text.sql
@@ -0,0 +1,18 @@
+-- NPC talk text insert from sniff
+DELETE FROM `script_texts` WHERE `npc_entry`=28923;
+DELETE FROM `creature_text` WHERE `entry`=28923;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(28923,0,0, 'I have witnessed the rise and fall of empires... the birth and extinction of entire species... Over countless millennia the foolishness of mortals has remained the only constant. Your presence here confirms this.',14,0,100,0,0,14160, 'Loken'),
+(28923,1,0, 'My master has shown me the future, and you have no place in it. Azeroth will be reborn in darkness. Yogg-Saron shall be released! The Pantheon shall fall!',14,0,100,0,0,14161, 'Loken'),
+(28923,2,0, 'What hope is there for you? None!',14,0,100,0,0,14162, 'Loken'),
+(28923,3,0, 'You cannot hide from fate!',14,0,100,0,0,14163, 'Loken'),
+(28923,3,1, 'Come closer. I will make it quick.',14,0,100,0,0,14164, 'Loken'),
+(28923,3,2, 'Your flesh cannot hold out for long.',14,0,100,0,0,14165, 'Loken'),
+(28923,4,0, 'Only mortal...',14,0,100,0,0,14166, 'Loken'),
+(28923,4,1, 'I... am... FOREVER!',14,0,100,0,0,14167, 'Loken'),
+(28923,4,2, 'What little time you had, you wasted!',14,0,100,0,0,14168, 'Loken'),
+(28923,5,0, 'You stare blindly into the abyss!',14,0,100,0,0,14169, 'Loken'),
+(28923,6,0, 'Your ignorance is profound. Can you not see where this path leads?',14,0,100,0,0,14170, 'Loken'),
+(28923,7,0, 'You cross the precipice of oblivion!',14,0,100,0,0,14171, 'Loken'),
+(28923,8,0, 'My death... heralds the end of this world.',14,0,100,0,0,14172, 'Loken'),
+(28923,9,0, '%s begins to cast Lightning Nova!',41,0,100,0,0,0, 'Loken');
diff --git a/sql/updates/world/2012_02_29_04_world_creature_text.sql b/sql/updates/world/2012_02_29_04_world_creature_text.sql
new file mode 100644
index 00000000000..d8b7c2c048a
--- /dev/null
+++ b/sql/updates/world/2012_02_29_04_world_creature_text.sql
@@ -0,0 +1,11 @@
+-- NPC talk text insert from sniff
+DELETE FROM `script_texts` WHERE `npc_entry`=28546;
+DELETE FROM `creature_text` WHERE `entry`=28546;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(28546,0,0, 'You wish to confront the master? You must first weather the storm!',14,0,100,0,0,14453, 'Ionar'),
+(28546,1,0, 'The slightest spark shall be your undoing.',14,0,100,0,0,14454, 'Ionar'),
+(28546,1,1, 'No one is safe!',14,0,100,0,0,14455, 'Ionar'),
+(28546,2,0, 'Shocking ... I know!',14,0,100,0,0,14456, 'Ionar'),
+(28546,2,1, 'You atempt the unpossible.',14,0,100,0,0,14457, 'Ionar'),
+(28546,2,2, 'Your spark of light is ... extinguish.',14,0,100,0,0,14458, 'Ionar'),
+(28546,3,0, 'Master... you have guests.',14,0,100,0,0,14459, 'Ionar');
diff --git a/sql/updates/world/2012_02_29_05_world_creature_text.sql b/sql/updates/world/2012_02_29_05_world_creature_text.sql
new file mode 100644
index 00000000000..332fecf6326
--- /dev/null
+++ b/sql/updates/world/2012_02_29_05_world_creature_text.sql
@@ -0,0 +1,15 @@
+-- NPC talk text insert from sniff
+DELETE FROM `script_texts` WHERE `npc_entry`=28587;
+DELETE FROM `creature_text` WHERE `entry`=28587;
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
+(28587,0,0, 'It is you who have destroyed my children? You... shall... pay!',14,0,100,0,0,13960, 'Volkhan'),
+(28587,1,0, 'Life from lifelessness... death for you.',14,0,100,0,0,13961, 'Volkhan'),
+(28587,1,1, 'Nothing is wasted in the process. You will see....',14,0,100,0,0,13962, 'Volkhan'),
+(28587,2,0, 'I will crush you beneath my boots!',14,0,100,0,0,13963, 'Volkhan'),
+(28587,2,1, 'All my work... undone!',14,0,100,0,0,13964, 'Volkhan'),
+(28587,3,0, 'The armies of iron will conquer all!',14,0,100,0,0,13965, 'Volkhan'),
+(28587,3,1, 'Ha, pathetic!',14,0,100,0,0,13966, 'Volkhan'),
+(28587,3,2, 'You have cost me too much work!',14,0,100,0,0,13967, 'Volkhan'),
+(28587,4,0, 'The master was right... to be concerned.',14,0,100,0,0,13968, 'Volkhan'),
+(28587,5,0, '%s runs to his anvil!',41,0,100,0,0,0, 'Volkhan'),
+(28587,6,0, '%s prepares to shatter his Brittle Golems!',41,0,100,0,0,0, 'Volkhan');
diff --git a/sql/updates/world/2012_03_01_00_world_conditions.sql b/sql/updates/world/2012_03_01_00_world_conditions.sql
new file mode 100644
index 00000000000..794a5ce1210
--- /dev/null
+++ b/sql/updates/world/2012_03_01_00_world_conditions.sql
@@ -0,0 +1,5 @@
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=18 AND `SourceGroup`=29488 AND `SourceEntry`=54568;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,
+`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`Comment`) VALUES
+(18,29488,54568,1,8,0,12670,0,0,0,'Required quest rewarded for spellclick'),
+(18,29488,54568,2,28,0,12670,0,0,0,'Required quest completed for spellclick');
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 0f1895bf1ed..755b9299352 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -515,7 +515,9 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo,
sLog->outDebug(LOG_FILTER_CONDITIONSYS, "ConditionMgr::IsPlayerMeetToConditionList condType: %u val1: %u", (*i)->ConditionType, (*i)->ConditionValue1);
if ((*i)->isLoaded())
{
+ //! Find ElseGroup in ElseGroupStore
std::map<uint32, bool>::const_iterator itr = ElseGroupStore.find((*i)->ElseGroup);
+ //! If not found, add an entry in the store and set to true (placeholder)
if (itr == ElseGroupStore.end())
ElseGroupStore[(*i)->ElseGroup] = true;
else if (!(*itr).second)
@@ -854,18 +856,6 @@ void ConditionMgr::LoadConditions(bool isReload)
break;
case CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT:
{
- //if no list for npc create one
- if (SpellClickEventConditionStore.find(cond->SourceGroup) == SpellClickEventConditionStore.end())
- {
- ConditionTypeContainer cmap;
- SpellClickEventConditionStore[cond->SourceGroup] = cmap;
- }
- //if no list for spellclick spell create one
- if (SpellClickEventConditionStore[cond->SourceGroup].find(cond->SourceEntry) == SpellClickEventConditionStore[cond->SourceGroup].end())
- {
- ConditionList clist;
- SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry] = clist;
- }
SpellClickEventConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond);
valid = true;
++count;
@@ -877,18 +867,6 @@ void ConditionMgr::LoadConditions(bool isReload)
break;
case CONDITION_SOURCE_TYPE_VEHICLE_SPELL:
{
- //if no list for vehicle create one
- if (VehicleSpellConditionStore.find(cond->SourceGroup) == VehicleSpellConditionStore.end())
- {
- ConditionTypeContainer cmap;
- VehicleSpellConditionStore[cond->SourceGroup] = cmap;
- }
- //if no list for vehicle's spell create one
- if (VehicleSpellConditionStore[cond->SourceGroup].find(cond->SourceEntry) == VehicleSpellConditionStore[cond->SourceGroup].end())
- {
- ConditionList clist;
- VehicleSpellConditionStore[cond->SourceGroup][cond->SourceEntry] = clist;
- }
VehicleSpellConditionStore[cond->SourceGroup][cond->SourceEntry].push_back(cond);
valid = true;
++count;
@@ -896,18 +874,8 @@ void ConditionMgr::LoadConditions(bool isReload)
}
case CONDITION_SOURCE_TYPE_SMART_EVENT:
{
- // If the entry does not exist, create a new list
+ //! TODO: PAIR_32 ?
std::pair<int32, uint32> key = std::make_pair(cond->SourceEntry, cond->SourceId);
- if (SmartEventConditionStore.find(key) == SmartEventConditionStore.end())
- {
- ConditionTypeContainer cmap;
- SmartEventConditionStore[key] = cmap;
- }
- if (SmartEventConditionStore[key].find(cond->SourceGroup) == SmartEventConditionStore[key].end())
- {
- ConditionList clist;
- SmartEventConditionStore[key][cond->SourceGroup] = clist;
- }
SmartEventConditionStore[key][cond->SourceGroup].push_back(cond);
valid = true;
++count;
@@ -1929,6 +1897,19 @@ void ConditionMgr::Clean()
SmartEventConditionStore.clear();
+ for (CreatureSpellConditionContainer::iterator itr = SpellClickEventConditionStore.begin(); itr != SpellClickEventConditionStore.end(); ++itr)
+ {
+ for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
+ {
+ for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
+ delete *i;
+ it->second.clear();
+ }
+ itr->second.clear();
+ }
+
+ SpellClickEventConditionStore.clear();
+
// this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;)
for (std::list<Condition*>::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr)
delete *itr;
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 5a5e2dd1c2e..ec6d6dd8453 100755
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -72,6 +72,33 @@ enum ConditionTypes
CONDITION_MAX = 39 // MAX
};
+/*! Documentation on implementing a new ConditionSourceType:
+ Step 1: Check for the lowest free ID. Look for CONDITION_SOURCE_TYPE_UNUSED_XX in the enum.
+ Then define the new source type.
+
+ Step 2: Determine and map the parameters for the new condition type.
+
+ Step 3: Add a case block to ConditionMgr::isSourceTypeValid with the new condition type
+ and validate the parameters.
+
+ Step 4: If your condition can be grouped (determined in step 2), add a rule for it in
+ ConditionMgr::CanHaveSourceGroupSet, following the example of the existing types.
+
+ Step 5: Define the maximum available condition targets in ConditionMgr::GetMaxAvailableConditionTargets.
+
+ The following steps only apply if your condition can be grouped:
+
+ Step 6: Determine how you are going to store your conditions. You need to add a new storage container
+ for it in ConditionMgr class, along with a function like:
+ ConditionList GetConditionsForXXXYourNewSourceTypeXXX(parameters...)
+
+ The above function should be placed in upper level (practical) code that actually
+ checks the conditions.
+
+ Step 7: Implement loading for your source type in ConditionMgr::LoadConditions.
+
+ Step 8: Implement memory cleaning for your source type in ConditionMgr::Clean.
+*/
enum ConditionSourceType
{
CONDITION_SOURCE_TYPE_NONE = 0,
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 92534113609..2a2b78f4630 100755
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -375,6 +375,12 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
}
}
+ // 0x8
+ if (flags & UPDATEFLAG_UNKNOWN)
+ {
+ *data << uint32(0);
+ }
+
// 0x10
if (flags & UPDATEFLAG_LOWGUID)
{
@@ -405,12 +411,6 @@ void Object::_BuildMovementUpdate(ByteBuffer* data, uint16 flags) const
}
}
- // 0x8
- if (flags & UPDATEFLAG_UNKNOWN)
- {
- *data << uint32(0);
- }
-
// 0x4
if (flags & UPDATEFLAG_HAS_TARGET)
{
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 75d02d4f23f..963cfc308d8 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -143,8 +143,9 @@ static uint32 copseReclaimDelay[MAX_DEATH_COUNT] = { 30, 60, 120 };
// == PlayerTaxi ================================================
PlayerTaxi::PlayerTaxi()
- : m_taximask()
-{ }
+{
+ memset(m_taximask, 0, sizeof(m_taximask));
+}
void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint8 level)
{
@@ -17780,12 +17781,19 @@ void Player::_LoadQuestStatus(PreparedQueryResult result)
QuestStatusData& questStatusData = m_QuestStatus[quest_id];
uint8 qstatus = fields[1].GetUInt8();
- if (qstatus < MAX_QUEST_STATUS)
+ if (qstatus < MAX_QUEST_STATUS && qstatus > QUEST_STATUS_NONE)
questStatusData.Status = QuestStatus(qstatus);
+ else if (qstatus == QUEST_STATUS_NONE)
+ {
+ sLog->outError("Player %s (GUID: %u) has QUEST_STATUS_NONE for quest %u and should be removed from character_queststatus.",
+ GetName(), GetGUIDLow(), quest_id);
+ continue;
+ }
else
{
questStatusData.Status = QUEST_STATUS_INCOMPLETE;
- sLog->outError("Player %s have invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).", GetName(), quest_id, qstatus);
+ sLog->outError("Player %s (GUID: %u) has invalid quest %d status (%u), replaced by QUEST_STATUS_INCOMPLETE(3).",
+ GetName(), GetGUIDLow(), quest_id, qstatus);
}
questStatusData.Explored = (fields[2].GetUInt8() > 0);
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 1e46ea7346d..138eda962aa 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -17171,14 +17171,18 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel
GetMap()->CreatureRelocation(ToCreature(), x, y, z, orientation);
}
else if (turn)
- SetOrientation(orientation);
-
- if ((relocated || turn) && IsVehicle())
- GetVehicleKit()->RelocatePassengers(x, y, z, orientation);
+ UpdateOrientation(orientation);
return (relocated || turn);
}
+void Unit::UpdateOrientation(float orientation)
+{
+ SetOrientation(orientation);
+ if (IsVehicle())
+ GetVehicleKit()->RelocatePassengers(GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
+}
+
void Unit::SendThreatListUpdate()
{
if (!getThreatManager().isThreatListEmpty())
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 0fe5f3d8ca3..b07f2ae1c16 100755
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1614,6 +1614,7 @@ class Unit : public WorldObject
virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false);
// returns true if unit's position really changed
bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); }
+ void UpdateOrientation(float orientation);
void KnockbackFrom(float x, float y, float speedXY, float speedZ);
void JumpTo(float speedXY, float speedZ, bool forward = true);
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index 6693af5c91f..2f552eddb9f 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -431,6 +431,7 @@ void Vehicle::RemovePassenger(Unit* unit)
sScriptMgr->OnRemovePassenger(this, unit);
}
+//! Must be called after m_base::Relocate
void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
{
ASSERT(_me->GetMap());
@@ -440,8 +441,6 @@ void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
if (Unit* passenger = ObjectAccessor::GetUnit(*GetBase(), itr->second.Passenger))
{
ASSERT(passenger->IsInWorld());
- ASSERT(passenger->IsOnVehicle(GetBase()));
- ASSERT(GetSeatForPassenger(passenger));
float px = x + passenger->m_movementInfo.t_pos.m_positionX;
float py = y + passenger->m_movementInfo.t_pos.m_positionY;
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index 31dc622a724..00b52bf746b 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -32,6 +32,7 @@
#include "Group.h"
#include "LFGMgr.h"
#include "DynamicTree.h"
+#include "Vehicle.h"
union u_map_magic
{
@@ -702,6 +703,8 @@ void Map::PlayerRelocation(Player* player, float x, float y, float z, float orie
Cell new_cell(x, y);
player->Relocate(x, y, z, orientation);
+ if (player->IsVehicle())
+ player->GetVehicleKit()->RelocatePassengers(x, y, z, orientation);
if (old_cell.DiffGrid(new_cell) || old_cell.DiffCell(new_cell))
{
@@ -740,6 +743,8 @@ void Map::CreatureRelocation(Creature* creature, float x, float y, float z, floa
else
{
creature->Relocate(x, y, z, ang);
+ if (creature->IsVehicle())
+ creature->GetVehicleKit()->RelocatePassengers(x, y, z, ang);
creature->UpdateObjectVisibility(false);
RemoveCreatureFromMoveList(creature);
}
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 8f5e862555c..9249cb3fdbc 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -223,6 +223,7 @@ public:
sWaypointMgr->ReloadPath(id);
return true;
}
+
static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/)
{
@@ -605,7 +606,7 @@ public:
return false;
}
- if (show == "del" && target)
+ if (show == "del")
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp modify del, PathID: |r|cff00ffff%u|r", pathid);
@@ -615,9 +616,12 @@ public:
if (wpGuid != 0)
{
wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
- wpCreature->CombatStop();
- wpCreature->DeleteFromDB();
- wpCreature->AddObjectToRemoveList();
+ if (wpCreature)
+ {
+ wpCreature->CombatStop();
+ wpCreature->DeleteFromDB();
+ wpCreature->AddObjectToRemoveList();
+ }
}
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_WAYPOINT_DATA);
@@ -638,7 +642,7 @@ public:
return true;
} // del
- if (show == "move" && target)
+ if (show == "move")
{
handler->PSendSysMessage("|cff00ff00DEBUG: wp move, PathID: |r|cff00ffff%u|r", pathid);
@@ -652,16 +656,20 @@ public:
// Respawn the owner of the waypoints
if (wpGuid != 0)
{
- wpCreature = handler->GetSession()->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
- wpCreature->CombatStop();
- wpCreature->DeleteFromDB();
- wpCreature->AddObjectToRemoveList();
+ wpCreature = map->GetCreature(MAKE_NEW_GUID(wpGuid, VISUAL_WAYPOINT, HIGHGUID_UNIT));
+ if (wpCreature)
+ {
+ wpCreature->CombatStop();
+ wpCreature->DeleteFromDB();
+ wpCreature->AddObjectToRemoveList();
+ }
// re-create
Creature* wpCreature2 = new Creature;
if (!wpCreature2->Create(sObjectMgr->GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation()))
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
+ wpCreature2 = NULL;
return false;
}
@@ -672,6 +680,7 @@ public:
{
handler->PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT);
delete wpCreature2;
+ wpCreature2 = NULL;
return false;
}
//sMapMgr->GetMap(npcCreature->GetMapId())->Add(wpCreature2);
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
index 016c4d27cfa..abdf5ecb1e1 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_ionar.cpp
@@ -41,13 +41,10 @@ enum Spells
enum Yells
{
- SAY_AGGRO = -1602011,
- SAY_SLAY_1 = -1602012,
- SAY_SLAY_2 = -1602013,
- SAY_SLAY_3 = -1602014,
- SAY_DEATH = -1602015,
- SAY_SPLIT_1 = -1602016,
- SAY_SPLIT_2 = -1602017
+ SAY_AGGRO = 0,
+ SAY_SPLIT = 1,
+ SAY_SLAY = 2,
+ SAY_DEATH = 3
};
enum Creatures
@@ -122,7 +119,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
if (instance)
instance->SetData(TYPE_IONAR, IN_PROGRESS);
@@ -130,7 +127,7 @@ public:
void JustDied(Unit* /*killer*/)
{
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
lSparkList.DespawnAll();
@@ -140,7 +137,7 @@ public:
void KilledUnit(Unit* /*victim*/)
{
- DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
+ Talk(SAY_SLAY);
}
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
@@ -278,7 +275,7 @@ public:
{
bHasDispersed = true;
- DoScriptText(RAND(SAY_SPLIT_1, SAY_SPLIT_2), me);
+ Talk(SAY_SPLIT);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
index 171215c605a..e4f2bb5ce01 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_loken.cpp
@@ -30,20 +30,16 @@ enum eEnums
{
ACHIEV_TIMELY_DEATH_START_EVENT = 20384,
- SAY_AGGRO = -1602018,
- SAY_INTRO_1 = -1602019,
- SAY_INTRO_2 = -1602020,
- SAY_SLAY_1 = -1602021,
- SAY_SLAY_2 = -1602022,
- SAY_SLAY_3 = -1602023,
- SAY_DEATH = -1602024,
- SAY_NOVA_1 = -1602025,
- SAY_NOVA_2 = -1602026,
- SAY_NOVA_3 = -1602027,
- SAY_75HEALTH = -1602028,
- SAY_50HEALTH = -1602029,
- SAY_25HEALTH = -1602030,
- EMOTE_NOVA = -1602031,
+ SAY_INTRO_1 = 0,
+ SAY_INTRO_2 = 1,
+ SAY_AGGRO = 2,
+ SAY_NOVA = 3,
+ SAY_SLAY = 4,
+ SAY_75HEALTH = 5,
+ SAY_50HEALTH = 6,
+ SAY_25HEALTH = 7,
+ SAY_DEATH = 8,
+ EMOTE_NOVA = 9,
SPELL_ARC_LIGHTNING = 52921,
SPELL_LIGHTNING_NOVA_N = 52960,
@@ -106,7 +102,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
if (m_instance)
{
@@ -117,7 +113,7 @@ public:
void JustDied(Unit* /*killer*/)
{
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
if (m_instance)
m_instance->SetData(TYPE_LOKEN, DONE);
@@ -125,7 +121,7 @@ public:
void KilledUnit(Unit* /*victim*/)
{
- DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
+ Talk(SAY_SLAY);
}
void UpdateAI(const uint32 uiDiff)
@@ -190,8 +186,8 @@ public:
if (m_uiLightningNova_Timer <= uiDiff)
{
- DoScriptText(RAND(SAY_NOVA_1, SAY_NOVA_2, SAY_NOVA_3), me);
- DoScriptText(EMOTE_NOVA, me);
+ Talk(SAY_NOVA);
+ Talk(EMOTE_NOVA);
DoCast(me, SPELL_LIGHTNING_NOVA_N);
m_bIsAura = false;
@@ -206,9 +202,9 @@ public:
{
switch (m_uiHealthAmountModifier)
{
- case 1: DoScriptText(SAY_75HEALTH, me); break;
- case 2: DoScriptText(SAY_50HEALTH, me); break;
- case 3: DoScriptText(SAY_25HEALTH, me); break;
+ case 1: Talk(SAY_75HEALTH); break;
+ case 2: Talk(SAY_50HEALTH); break;
+ case 3: Talk(SAY_25HEALTH); break;
}
++m_uiHealthAmountModifier;
diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
index 1fc724c8b6c..83604ed4153 100644
--- a/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
+++ b/src/server/scripts/Northrend/Ulduar/HallsOfLightning/boss_volkhan.cpp
@@ -28,17 +28,13 @@ EndScriptData */
enum eEnums
{
- SAY_AGGRO = -1602032,
- SAY_SLAY_1 = -1602033,
- SAY_SLAY_2 = -1602034,
- SAY_SLAY_3 = -1602035,
- SAY_DEATH = -1602036,
- SAY_STOMP_1 = -1602037,
- SAY_STOMP_2 = -1602038,
- SAY_FORGE_1 = -1602039,
- SAY_FORGE_2 = -1602040,
- EMOTE_TO_ANVIL = -1602041,
- EMOTE_SHATTER = -1602042,
+ SAY_AGGRO = 0,
+ SAY_FORGE = 1,
+ SAY_STOMP = 2,
+ SAY_SLAY = 3,
+ SAY_DEATH = 4,
+ EMOTE_TO_ANVIL = 5,
+ EMOTE_SHATTER = 6,
SPELL_HEAT_N = 52387,
SPELL_HEAT_H = 59528,
@@ -127,7 +123,7 @@ public:
void EnterCombat(Unit* /*who*/)
{
- DoScriptText(SAY_AGGRO, me);
+ Talk(SAY_AGGRO);
if (m_instance)
m_instance->SetData(TYPE_VOLKHAN, IN_PROGRESS);
@@ -148,7 +144,7 @@ public:
void JustDied(Unit* /*killer*/)
{
- DoScriptText(SAY_DEATH, me);
+ Talk(SAY_DEATH);
DespawnGolem();
if (m_instance)
@@ -172,7 +168,7 @@ public:
void KilledUnit(Unit* /*victim*/)
{
- DoScriptText(RAND(SAY_SLAY_1, SAY_SLAY_2, SAY_SLAY_3), me);
+ Talk(SAY_SLAY);
}
void DespawnGolem()
@@ -263,11 +259,11 @@ public:
if (m_uiShatteringStomp_Timer <= uiDiff)
{
// Should he stomp even if he has no brittle golem to shatter?
- DoScriptText(RAND(SAY_STOMP_1, SAY_STOMP_2), me);
+ Talk(SAY_STOMP);
DoCast(me, SPELL_SHATTERING_STOMP_N);
- DoScriptText(EMOTE_SHATTER, me);
+ Talk(EMOTE_SHATTER);
m_uiShatteringStomp_Timer = 30000;
m_bCanShatterGolem = true;
@@ -297,7 +293,7 @@ public:
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(false);
- DoScriptText(RAND(SAY_FORGE_1, SAY_FORGE_2), me);
+ Talk(SAY_FORGE);
m_bHasTemper = true;
@@ -308,7 +304,7 @@ public:
{
case 1:
// 1 - Start run to Anvil
- DoScriptText(EMOTE_TO_ANVIL, me);
+ Talk(EMOTE_TO_ANVIL);
me->GetMotionMaster()->MoveTargetedHome();
m_uiSummonPhase = 2; // Set Next Phase
break;
diff --git a/src/server/shared/Packets/ByteBuffer.cpp b/src/server/shared/Packets/ByteBuffer.cpp
deleted file mode 100644
index a64bb926d04..00000000000
--- a/src/server/shared/Packets/ByteBuffer.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ByteBuffer.h"
-
-void ByteBufferException::PrintError() const
-{
-}
diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h
index 3cd6ff73b1e..f018eb31bb4 100755
--- a/src/server/shared/Packets/ByteBuffer.h
+++ b/src/server/shared/Packets/ByteBuffer.h
@@ -30,11 +30,9 @@ class ByteBufferException
ByteBufferException(size_t pos, size_t size, size_t valueSize)
: Pos(pos), Size(size), ValueSize(valueSize)
{
- PrintError();
}
protected:
- virtual void PrintError() const = 0;
size_t Pos;
size_t Size;
@@ -45,7 +43,10 @@ class ByteBufferPositionException : public ByteBufferException
{
public:
ByteBufferPositionException(bool add, size_t pos, size_t size, size_t valueSize)
- : ByteBufferException(pos, size, valueSize), _add(add) {}
+ : ByteBufferException(pos, size, valueSize), _add(add)
+ {
+ PrintError();
+ }
protected:
void PrintError() const
@@ -62,7 +63,10 @@ class ByteBufferSourceException : public ByteBufferException
{
public:
ByteBufferSourceException(size_t pos, size_t size, size_t valueSize)
- : ByteBufferException(pos, size, valueSize) {}
+ : ByteBufferException(pos, size, valueSize)
+ {
+ PrintError();
+ }
protected:
void PrintError() const
@@ -174,14 +178,17 @@ class ByteBuffer
ByteBuffer &operator<<(const std::string &value)
{
- append((uint8 const*)value.c_str(), value.length());
+ if (size_t len = value.length())
+ append((uint8 const*)value.c_str(), len);
append((uint8)0);
return *this;
}
ByteBuffer &operator<<(const char *str)
{
- append((uint8 const*)str, str ? strlen(str) : 0);
+ size_t len = 0;
+ if (str && (len = strlen(str)))
+ append((uint8 const*)str, len);
append((uint8)0);
return *this;
}
@@ -368,11 +375,6 @@ class ByteBuffer
_storage.reserve(ressize);
}
- void append(const std::string& str)
- {
- append((uint8 const*)str.c_str(), str.size() + 1);
- }
-
void append(const char *src, size_t cnt)
{
return append((const uint8 *)src, cnt);