From 2bd2dfd3a5355c9f3d264b904ceb3dd13ce6edc7 Mon Sep 17 00:00:00 2001 From: latimerius <> Date: Mon, 27 May 2002 20:43:50 +0000 Subject: [PATCH] Fixed a bug in attack code which caused fighting unit's Moving flag to be still set (the "move to target" subaction never cleared it). It is only for the hierarchic pathfinder, anyway. --- src/action/action_attack.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/action/action_attack.cpp b/src/action/action_attack.cpp index 5f92f512b..ecbf17e35 100644 --- a/src/action/action_attack.cpp +++ b/src/action/action_attack.cpp @@ -299,6 +299,14 @@ local void MoveToTarget(Unit* unit) // NEW return codes supported, FIXME: but johns thinks not perfect. +#ifdef HIERARCHIC_PATHFINDER + if( unit->Reset ) { + if( CheckForTargetInRange(unit) ) { + return; + } + } + if (err==PF_REACHED) { +#else /* HIERARCHIC_PATHDFINDER */ if( unit->Reset ) { // // Look if we have reached the target. @@ -306,6 +314,7 @@ local void MoveToTarget(Unit* unit) if( CheckForTargetInRange(unit) ) { return; } +#endif /* HIERARCHIC_PATHDFINDER */ goal=unit->Orders[0].Goal; //