aboutsummaryrefslogtreecommitdiff
path: root/src/game/PointMovementGenerator.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-17 10:40:28 -0600
committermegamage <none@none>2009-03-17 10:40:28 -0600
commitd4b52d5bbcd966da58e03db11442bee995c11e98 (patch)
treeeecfca48cc56c69f3a6b11c6f370c6019f0cbaca /src/game/PointMovementGenerator.cpp
parentc24e3363876a0fbec2f554d9e3b5bd2370760ff9 (diff)
*Move movementinform to finalize function to prevent error log spams.
--HG-- branch : trunk
Diffstat (limited to 'src/game/PointMovementGenerator.cpp')
-rw-r--r--src/game/PointMovementGenerator.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp
index 4aa21d32d55..6117dbf903d 100644
--- a/src/game/PointMovementGenerator.cpp
+++ b/src/game/PointMovementGenerator.cpp
@@ -57,9 +57,7 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
if(i_destinationHolder.HasArrived())
{
- //unit.StopMoving();
- if(!unit.hasUnitState(UNIT_STAT_CHARGING))
- MovementInform(unit);
+ arrived = true;
return false;
}
@@ -67,6 +65,15 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff)
}
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>
void PointMovementGenerator<T>::MovementInform(T &unit)
{
}
@@ -79,7 +86,8 @@ template <> void PointMovementGenerator<Creature>::MovementInform(Creature &unit
template void PointMovementGenerator<Player>::Initialize(Player&);
template bool PointMovementGenerator<Player>::Update(Player &, const uint32 &diff);
template void PointMovementGenerator<Player>::MovementInform(Player&);
+template void PointMovementGenerator<Player>::Finalize(Player&);
template void PointMovementGenerator<Creature>::Initialize(Creature&);
template bool PointMovementGenerator<Creature>::Update(Creature&, const uint32 &diff);
-
+template void PointMovementGenerator<Creature>::Finalize(Creature&);