From da7e88e75911a4f407e08c7e798fc1958bde8e08 Mon Sep 17 00:00:00 2001 From: Wanne Date: Sun, 26 Jul 2009 07:29:46 +0000 Subject: [PATCH] - Automatic cancellation of running if the merc is in a running state and was not moved since last turn (by Headrock) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3138 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 22197c40..79be4eb6 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -6612,6 +6612,24 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou this->CalcNewActionPoints( ); + // HEADROCK HAM 3.6: If this soldier is in a "moving" animation, but has not moved any tiles + // in the previous turn, then the player has apparently forgotten that he was moving. + // In this case, abort the character's action. + + // If haven't moved since the start of last round + if (!this->bTilesMoved) + { + // but are doing a movement animation + if ( !( gAnimControl[ this->usAnimState ].uiFlags & ANIM_STATIONARY ) ) + { + // Stop the merc + this->EVENT_StopMerc( this->sGridNo, this->ubDirection ); + } + + // Reset destination + this->pathing.sFinalDestination = this->sGridNo; + } + this->bTilesMoved = 0; if ( this->bInSector )