From 9737bd92551173748c81727bb577c91c7b8471de Mon Sep 17 00:00:00 2001 From: Shadooow Date: Sat, 1 Jan 2022 12:36:03 +0000 Subject: [PATCH] fixed bug allowing to plot path with Robot or NPCs that needs to be escorted on their own git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9225 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Map Screen Interface.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Strategic/Map Screen Interface.cpp b/Strategic/Map Screen Interface.cpp index 42958652..ed30851d 100644 --- a/Strategic/Map Screen Interface.cpp +++ b/Strategic/Map Screen Interface.cpp @@ -4602,13 +4602,21 @@ void HandleSettingTheSelectedListOfMercs( void ) if( GetSelectedDestChar() != -1 ) { + INT8 pbErrorNumber = -1; + pSoldier = MercPtrs[gCharactersList[GetSelectedDestChar()].usSolID]; + if (!CanCharacterMoveInStrategic(pSoldier, &pbErrorNumber)) + { + SetSelectedDestChar(-1); + giDestHighLine = -1; + return; + } // set cursor SetUpCursorForStrategicMap( ); fTeamPanelDirty = TRUE; fMapPanelDirty = TRUE; fCharacterInfoPanelDirty = TRUE; - DeselectSelectedListMercsWhoCantMoveWithThisGuy( &( Menptr[ gCharactersList[GetSelectedDestChar()].usSolID ] ) ); + DeselectSelectedListMercsWhoCantMoveWithThisGuy( pSoldier ); // remember the current paths for all selected characters so we can restore them if need be RememberPreviousPathForAllSelectedChars();