mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Actually fix NOTIFY_IF_SLEEP_FAILS for multiple mercs selected
This commit is contained in:
committed by
majcosta
parent
ed00830202
commit
3c44f133fd
@@ -18305,21 +18305,10 @@ BOOLEAN HandleSelectedMercsBeingPutAsleep( BOOLEAN fWakeUp, BOOLEAN fDisplayWarn
|
||||
}
|
||||
}
|
||||
|
||||
if( ubNumberOfSelectedSoldiers == 0 )
|
||||
{
|
||||
return fSuccess;
|
||||
}
|
||||
|
||||
if( !fDisplayWarning ) {
|
||||
return fSuccess;
|
||||
}
|
||||
|
||||
CHAR16 sString[ 128 ];
|
||||
swprintf( sString, fWakeUp ? pMapErrorString[ 27 ] : pMapErrorString[ 26 ] );
|
||||
if( gGameExternalOptions.fSleepDisplayFailNotification )
|
||||
if( ubNumberOfSelectedSoldiers && !fSuccess && fDisplayWarning )
|
||||
{
|
||||
// inform player not everyone could be woke up or put to sleep
|
||||
DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL);
|
||||
DoScreenIndependantMessageBox(fWakeUp ? pMapErrorString[27] : pMapErrorString[26], MSG_BOX_FLAG_OK, NULL);
|
||||
}
|
||||
|
||||
return( fSuccess );
|
||||
|
||||
@@ -11897,12 +11897,12 @@ void TeamListSleepRegionBtnCallBack( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
if( pSoldier->flags.fMercAsleep == TRUE )
|
||||
{
|
||||
// try to wake him up
|
||||
if( SetMercAwake( pSoldier, TRUE, FALSE ) )
|
||||
if( SetMercAwake( pSoldier, gGameExternalOptions.fSleepDisplayFailNotification, FALSE ) )
|
||||
{
|
||||
// HEADROCK HAM B2.8: New feature wakes all trainees/trainers automatically
|
||||
HandleTrainingWakeSynchronize( pSoldier );
|
||||
// propagate
|
||||
HandleSelectedMercsBeingPutAsleep( TRUE, TRUE );
|
||||
HandleSelectedMercsBeingPutAsleep( TRUE, gGameExternalOptions.fSleepDisplayFailNotification);
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -11919,7 +11919,7 @@ void TeamListSleepRegionBtnCallBack( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
// HEADROCK HAM B2.8: New feature sends all trainees/trainers to sleep automatically
|
||||
HandleTrainingSleepSynchronize( pSoldier );
|
||||
// propagate
|
||||
HandleSelectedMercsBeingPutAsleep( FALSE, TRUE );
|
||||
HandleSelectedMercsBeingPutAsleep( FALSE, gGameExternalOptions.fSleepDisplayFailNotification);
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user