The person who wrote this script accidently used action_type 11 (SMART_ACTION_CAST) instead of 69 (SMART_ACTION_MOVE_TO_POS), and since the action_param1 field of SMART_ACTION_MOVE_TO_POS is the motion id (point id given back to SMART_EVENT_MOVEMENTINFORM), it was set to 5. Ironically, the first parameter of SMART_ACTION_CAST is the spell id and it was spell id 5 is Death Touch.
However this script would do nothing because I changed it so that SMART_TARGET_NONE no longer functioned as SMART_TARGET_ACTION_INVOKER in this commit: 9653576cb4. Before this commit, though, it WOULD cast Death Touch. Fun fun fun.
Fix memory leak in Auction House when creating an auction with stackable items and a stack of the same amount in the inventory. Leak added in 15a2acfb52 .
Fix CreatureAI left uninitialized for 1 server tick for Creatures with DeathState:DEAD . This is a workaround required after c9cf2f059f changes .
Valgrind log:
Conditional jump or move depends on uninitialised value(s)
at : npc_draenei_survivor::npc_draenei_survivorAI::MoveInLineOfSight(Unit*) (zone_azuremyst_isle.cpp:104)
by : CreatureAI::MoveInLineOfSight_Safe(Unit*) (CreatureAI.cpp:123)
by : CreatureUnitRelocationWorker(Creature*, Unit*) (GridNotifiers.cpp:134)
by : Trinity::AIRelocationNotifier::Visit(GridRefManager<Creature>&) (GridNotifiers.cpp:252)
Uninitialised value was created by a heap allocation
at : operator new(unsigned long) (vg_replace_malloc.c:319)
by : npc_draenei_survivor::GetAI(Creature*) const (zone_azuremyst_isle.cpp:66)
by : ScriptMgr::GetCreatureAI(Creature*) (ScriptMgr.cpp:792)
by : FactorySelector::selectAI(Creature*) (CreatureAISelector.cpp:41)
by : Creature::AIM_Initialize(CreatureAI*) (Creature.cpp:716)
by : Creature::AddToWorld() (Creature.cpp:190)
Fix some static analysis issues about uninitialized values. Most of them are false positives, always initialized before being accessed, while some of them are real issues spotted by valgrind too.
Fix the stack implementation used in MotionMaster and added few sanity checks to ensure no underflows will be made.
Valgrind log:
Invalid read of size 8
at : MotionMaster::top() const (MotionMaster.h:115)
by : MotionMaster::pop() (MotionMaster.h:91)
by : MotionMaster::~MotionMaster() (MotionMaster.cpp:74)
by : Unit::~Unit() (Unit.cpp:296)
by : Player::~Player() (Player.cpp:880)
by : WorldSession::HandleCharCreateCallback(Trinity::AutoPtr<PreparedResultSet, ACE_Thread_Mutex>, CharacterCreateInfo*) (CharacterHandler.cpp:665)
by : WorldSession::HandleCharCreateCallback(Trinity::AutoPtr<PreparedResultSet, ACE_Thread_Mutex>, CharacterCreateInfo*) (CharacterHandler.cpp:516)