mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/Movement: Fix MoveJump handling.
*Closes #5238 issue *Fix possible crash in MotionMaster
This commit is contained in:
@@ -365,10 +365,7 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
|
||||
init.SetParabolic(max_height,0);
|
||||
init.SetVelocity(speedXY);
|
||||
init.Launch();
|
||||
if (_owner->GetTypeId() == TYPEID_PLAYER)
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
|
||||
else
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
|
||||
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
|
||||
void MotionMaster::MoveFall(uint32 id/*=0*/)
|
||||
|
||||
@@ -84,7 +84,12 @@ class MotionMaster //: private std::stack<MovementGenerator *>
|
||||
//typedef std::stack<MovementGenerator *> Impl;
|
||||
typedef MovementGenerator* _Ty;
|
||||
|
||||
void pop() { Impl[_top] = NULL; --_top; }
|
||||
void pop()
|
||||
{
|
||||
Impl[_top] = NULL;
|
||||
while (!top())
|
||||
--_top;
|
||||
}
|
||||
void push(_Ty _Val) { ++_top; Impl[_top] = _Val; }
|
||||
|
||||
bool needInitTop() const { return _needInit[_top]; }
|
||||
|
||||
Reference in New Issue
Block a user