From d4b52d5bbcd966da58e03db11442bee995c11e98 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 17 Mar 2009 10:40:28 -0600 Subject: *Move movementinform to finalize function to prevent error log spams. --HG-- branch : trunk --- src/game/PointMovementGenerator.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src/game/PointMovementGenerator.cpp') 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,15 +57,22 @@ bool PointMovementGenerator::Update(T &unit, const uint32 &diff) if(i_destinationHolder.HasArrived()) { - //unit.StopMoving(); - if(!unit.hasUnitState(UNIT_STAT_CHARGING)) - MovementInform(unit); + arrived = true; return false; } return true; } +template +void PointMovementGenerator:: Finalize(T &unit) +{ + if(unit.hasUnitState(UNIT_STAT_CHARGING)) + unit.clearUnitState(UNIT_STAT_CHARGING); + else if(arrived) + MovementInform(unit); +} + template void PointMovementGenerator::MovementInform(T &unit) { @@ -79,7 +86,8 @@ template <> void PointMovementGenerator::MovementInform(Creature &unit template void PointMovementGenerator::Initialize(Player&); template bool PointMovementGenerator::Update(Player &, const uint32 &diff); template void PointMovementGenerator::MovementInform(Player&); +template void PointMovementGenerator::Finalize(Player&); template void PointMovementGenerator::Initialize(Creature&); template bool PointMovementGenerator::Update(Creature&, const uint32 &diff); - +template void PointMovementGenerator::Finalize(Creature&); -- cgit v1.2.3