Core/Movement: 96f4c7c followup

This commit is contained in:
ccrs
2017-03-25 13:17:29 +01:00
committed by Aokromes
parent 2683f6cf6b
commit 7ea5c422cb
5 changed files with 14 additions and 10 deletions

View File

@@ -0,0 +1 @@
DELETE FROM `trinity_string` WHERE `entry`=530;

View File

@@ -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,

View File

@@ -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();

View File

@@ -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)
{

View File

@@ -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;