From 616d9a08e6604c6dee309cbb57684115b36dde03 Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Tue, 12 Aug 2025 02:07:11 -0300 Subject: [PATCH] Fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected --- Strategic/Assignments.cpp | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 3645f296..3993c715 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -18251,7 +18251,6 @@ BOOLEAN HandleSelectedMercsBeingPutAsleep( BOOLEAN fWakeUp, BOOLEAN fDisplayWarn INT32 iCounter = 0; SOLDIERTYPE *pSoldier = NULL; UINT8 ubNumberOfSelectedSoldiers = 0; - CHAR16 sString[ 128 ]; for( iCounter = 0; iCounter < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; ++iCounter ) { @@ -18306,27 +18305,21 @@ BOOLEAN HandleSelectedMercsBeingPutAsleep( BOOLEAN fWakeUp, BOOLEAN fDisplayWarn } } - // if there was anyone processed, check for success and inform player of failure - if( ubNumberOfSelectedSoldiers ) + if( ubNumberOfSelectedSoldiers == 0 ) { - if( fSuccess == FALSE ) - { - if( fWakeUp ) - { - // inform player not everyone could be woke up - swprintf( sString, pMapErrorString[ 27 ] ); - } - else - { - // inform player not everyone could be put to sleep - swprintf( sString, pMapErrorString[ 26 ]); - } + return fSuccess; + } - if( fDisplayWarning ) - { - DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL); - } - } + if( !fDisplayWarning ) { + return fSuccess; + } + + CHAR16 sString[ 128 ]; + swprintf( sString, fWakeUp ? pMapErrorString[ 27 ] : pMapErrorString[ 26 ] ); + if( gGameExternalOptions.fSleepDisplayFailNotification ) + { + // inform player not everyone could be woke up or put to sleep + DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL); } return( fSuccess );