mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 21:02:14 +01:00
Core/Movement: 96f4c7c followup
This commit is contained in:
1
sql/updates/world/3.3.5/2017_03_25_00_world.sql
Normal file
1
sql/updates/world/3.3.5/2017_03_25_00_world.sql
Normal file
@@ -0,0 +1 @@
|
||||
DELETE FROM `trinity_string` WHERE `entry`=530;
|
||||
@@ -537,7 +537,7 @@ enum TrinityStrings
|
||||
LANG_MOVEGENS_IDLE = 527,
|
||||
LANG_MOVEGENS_RANDOM = 528,
|
||||
LANG_MOVEGENS_WAYPOINT = 529,
|
||||
LANG_MOVEGENS_ANIMAL_RANDOM = 530,
|
||||
// = 530, not used
|
||||
LANG_MOVEGENS_CONFUSED = 531,
|
||||
LANG_MOVEGENS_CHASE_PLAYER = 532,
|
||||
LANG_MOVEGENS_CHASE_CREATURE = 533,
|
||||
|
||||
@@ -42,10 +42,16 @@ MotionMaster::~MotionMaster()
|
||||
// clear ALL movement generators (including default)
|
||||
while (!empty())
|
||||
{
|
||||
MovementGenerator *curr = top();
|
||||
MovementGenerator* movement = top();
|
||||
pop();
|
||||
if (curr && !IsStatic(curr))
|
||||
delete curr; // Skip finalizing on delete, it might launch new movement
|
||||
if (movement && !IsStatic(movement))
|
||||
delete movement;
|
||||
}
|
||||
|
||||
while (!_expireList.empty())
|
||||
{
|
||||
delete _expireList.back();
|
||||
_expireList.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,8 +122,8 @@ void MotionMaster::Clear(bool reset /*= true*/)
|
||||
|
||||
void MotionMaster::ClearExpireList()
|
||||
{
|
||||
for (auto itr = _expireList.begin(); itr != _expireList.end(); itr++)
|
||||
DirectDelete(*itr);
|
||||
for (auto itr : _expireList)
|
||||
DirectDelete(itr);
|
||||
|
||||
_expireList.clear();
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ enum RotateDirection
|
||||
class TC_GAME_API MotionMaster
|
||||
{
|
||||
public:
|
||||
explicit MotionMaster(Unit* unit) : _expireList(nullptr), _top(-1), _owner(unit), _cleanFlag(MMCF_NONE)
|
||||
explicit MotionMaster(Unit* unit) : _top(-1), _owner(unit), _cleanFlag(MMCF_NONE)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
|
||||
{
|
||||
|
||||
@@ -2076,9 +2076,6 @@ public:
|
||||
case WAYPOINT_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_WAYPOINT);
|
||||
break;
|
||||
case ANIMAL_RANDOM_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_ANIMAL_RANDOM);
|
||||
break;
|
||||
case CONFUSED_MOTION_TYPE:
|
||||
handler->SendSysMessage(LANG_MOVEGENS_CONFUSED);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user