Core/Movement: Fix MoveJump handling.

*Closes #5238 issue
*Fix possible crash in MotionMaster
This commit is contained in:
Chaplain
2012-02-17 00:19:14 +03:00
parent ba4d1c36f1
commit af90546835
2 changed files with 7 additions and 5 deletions

View File

@@ -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*/)

View File

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