From 5415cf16c4a5ae88bbf0e895d1ce7210001acb3f Mon Sep 17 00:00:00 2001 From: evil-at-wow Date: Fri, 3 Apr 2015 22:55:50 +0100 Subject: [PATCH 1/4] [Core] Remove a useless statement from (cz2654). (cz2655) Thank you for pointing this out, @fgreinus. --- src/game/WorldHandlers/Spell.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/game/WorldHandlers/Spell.cpp b/src/game/WorldHandlers/Spell.cpp index 8325e561..0c11ad03 100644 --- a/src/game/WorldHandlers/Spell.cpp +++ b/src/game/WorldHandlers/Spell.cpp @@ -4018,7 +4018,6 @@ SpellCastResult Spell::CheckCast(bool strict) if ((*itr)->GetModifier()->m_miscvalue == 4327) { return SPELL_FAILED_FIZZLE; - itr = auraClassScripts.begin(); } else ++itr; From 6b5f0be84145de9a22f32ec2ecfd7515680b5716 Mon Sep 17 00:00:00 2001 From: evil-at-wow Date: Fri, 3 Apr 2015 22:59:33 +0100 Subject: [PATCH 2/4] [Core] Fix crash when using DB script command 34 (TERMINATE_CONDITION). (cz2656) Using DB script command 34 (TERMINATE_CONDITION) was triggering an array out of bounds access when debug logging was on, causing the server to crash. The array is accessed with ConditionSource as index, but there was no corresponding string for CONDITION_FROM_RESERVED_1. As a result, the array was missing one string and accessing the array with the highest possible index, CONDITION_FROM_DBSCRIPTS, accessed the array out of bounds. Many thanks to @Schmoozerd for debugging and suggesting a fix and to @scotty0100 for patiently running many tests! --- src/game/Object/ObjectMgr.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/game/Object/ObjectMgr.cpp b/src/game/Object/ObjectMgr.cpp index 65271f11..6cb11d39 100644 --- a/src/game/Object/ObjectMgr.cpp +++ b/src/game/Object/ObjectMgr.cpp @@ -6876,6 +6876,8 @@ bool ObjectMgr::IsPlayerMeetToCondition(uint16 conditionId, Player const* pPlaye return false; } +// Attention: make sure to keep this list in sync with ConditionSource to avoid array +// out of bounds access! It is accessed with ConditionSource as index! char const* conditionSourceToStr[] = { "loot system", @@ -6886,6 +6888,7 @@ char const* conditionSourceToStr[] = "hardcoded", "vendor's item check", "spell_area check", + "npc_spellclick_spells check", // Unused. For 3.x and later. "DBScript engine" }; From 9217fbf53ed40a72da7cfb789a756d428db64eee Mon Sep 17 00:00:00 2001 From: neo2003 Date: Fri, 3 Apr 2015 23:19:23 +0100 Subject: [PATCH 3/4] [Core] reapply Properly display creatures with waypoint when they enter player range (b95d077a408ca33c7094d304276848f50ffc8e8b) --- src/game/Object/Object.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/game/Object/Object.cpp b/src/game/Object/Object.cpp index 703f4311..cfe24e85 100644 --- a/src/game/Object/Object.cpp +++ b/src/game/Object/Object.cpp @@ -261,6 +261,11 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const { moveFlags |= MOVEFLAG_ONTRANSPORT; } + float x, y, z; + if (m_objectTypeId == TYPEID_UNIT && ((Unit*)this)->GetMotionMaster()->GetDestination(x, y, z)) + { + moveFlags |= MOVEFLAG_WALK_MODE | MOVEFLAG_MOVE_FORWARD | MOVEFLAG_SPLINE_ENABLED; + } *data << uint32(moveFlags); // movement flags *data << uint32(WorldTimer::getMSTime()); // time (in milliseconds) From 43bbfeae1db6bb86b2fd6910f1f775b56daaa624 Mon Sep 17 00:00:00 2001 From: Antz Date: Fri, 3 Apr 2015 23:36:37 +0100 Subject: [PATCH 4/4] [Fix] Fix incorrect enum in previous commit --- src/game/Object/Object.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/Object/Object.cpp b/src/game/Object/Object.cpp index cfe24e85..2c7ecde7 100644 --- a/src/game/Object/Object.cpp +++ b/src/game/Object/Object.cpp @@ -264,7 +264,7 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint8 updateFlags) const float x, y, z; if (m_objectTypeId == TYPEID_UNIT && ((Unit*)this)->GetMotionMaster()->GetDestination(x, y, z)) { - moveFlags |= MOVEFLAG_WALK_MODE | MOVEFLAG_MOVE_FORWARD | MOVEFLAG_SPLINE_ENABLED; + moveFlags |= MOVEFLAG_WALK_MODE | MOVEFLAG_FORWARD | MOVEFLAG_SPLINE_ENABLED; } *data << uint32(moveFlags); // movement flags