*Move movementinform to finalize function to prevent error log spams.
--HG-- branch : trunk
This commit is contained in:
@@ -57,15 +57,22 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
|
|||||||
|
|
||||||
if(i_destinationHolder.HasArrived())
|
if(i_destinationHolder.HasArrived())
|
||||||
{
|
{
|
||||||
//unit.StopMoving();
|
arrived = true;
|
||||||
if(!unit.hasUnitState(UNIT_STAT_CHARGING))
|
|
||||||
MovementInform(unit);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void PointMovementGenerator<T>:: Finalize(T &unit)
|
||||||
|
{
|
||||||
|
if(unit.hasUnitState(UNIT_STAT_CHARGING))
|
||||||
|
unit.clearUnitState(UNIT_STAT_CHARGING);
|
||||||
|
else if(arrived)
|
||||||
|
MovementInform(unit);
|
||||||
|
}
|
||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
void PointMovementGenerator<T>::MovementInform(T &unit)
|
void PointMovementGenerator<T>::MovementInform(T &unit)
|
||||||
{
|
{
|
||||||
@@ -79,7 +86,8 @@ template <> void PointMovementGenerator<Creature>::MovementInform(Creature &unit
|
|||||||
template void PointMovementGenerator<Player>::Initialize(Player&);
|
template void PointMovementGenerator<Player>::Initialize(Player&);
|
||||||
template bool PointMovementGenerator<Player>::Update(Player &, const uint32 &diff);
|
template bool PointMovementGenerator<Player>::Update(Player &, const uint32 &diff);
|
||||||
template void PointMovementGenerator<Player>::MovementInform(Player&);
|
template void PointMovementGenerator<Player>::MovementInform(Player&);
|
||||||
|
template void PointMovementGenerator<Player>::Finalize(Player&);
|
||||||
|
|
||||||
template void PointMovementGenerator<Creature>::Initialize(Creature&);
|
template void PointMovementGenerator<Creature>::Initialize(Creature&);
|
||||||
template bool PointMovementGenerator<Creature>::Update(Creature&, const uint32 &diff);
|
template bool PointMovementGenerator<Creature>::Update(Creature&, const uint32 &diff);
|
||||||
|
template void PointMovementGenerator<Creature>::Finalize(Creature&);
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ class TRINITY_DLL_SPEC PointMovementGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PointMovementGenerator(uint32 _id, float _x, float _y, float _z) : id(_id),
|
PointMovementGenerator(uint32 _id, float _x, float _y, float _z) : id(_id),
|
||||||
i_x(_x), i_y(_y), i_z(_z), i_nextMoveTime(0) {}
|
i_x(_x), i_y(_y), i_z(_z), i_nextMoveTime(0), arrived(false) {}
|
||||||
|
|
||||||
void Initialize(T &);
|
void Initialize(T &);
|
||||||
void Finalize(T &unit){unit.clearUnitState(UNIT_STAT_CHARGING);}
|
void Finalize(T &unit);
|
||||||
void Reset(T &unit){unit.StopMoving();}
|
void Reset(T &unit){unit.StopMoving();}
|
||||||
bool Update(T &, const uint32 &diff);
|
bool Update(T &, const uint32 &diff);
|
||||||
|
|
||||||
@@ -49,6 +49,7 @@ class TRINITY_DLL_SPEC PointMovementGenerator
|
|||||||
float i_x,i_y,i_z;
|
float i_x,i_y,i_z;
|
||||||
uint32 id;
|
uint32 id;
|
||||||
DestinationHolder< Traveller<T> > i_destinationHolder;
|
DestinationHolder< Traveller<T> > i_destinationHolder;
|
||||||
|
bool arrived;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user