From 3d95c4735612b6a17b8735aaa6193fc0e3095b52 Mon Sep 17 00:00:00 2001 From: "Marco Antonio J. Costa" Date: Tue, 7 Oct 2025 22:31:59 -0300 Subject: [PATCH] refactor UpDateStateOfStartButton --- Laptop/personnel.cpp | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/Laptop/personnel.cpp b/Laptop/personnel.cpp index d3081a5e..f18b18a4 100644 --- a/Laptop/personnel.cpp +++ b/Laptop/personnel.cpp @@ -5998,20 +5998,15 @@ void UpDateStateOfStartButton( void ) ButtonList[giPersonnelATMStartButton[gubPersonnelInfoState]]->uiFlags |= BUTTON_CLICKED_ON; // if in current mercs and the currently selected guy is valid, enable button, else disable it - if (fCurrentTeamMode) + if (fCurrentTeamMode && currentTeamIndex != -1) { - // is the current guy valid - if (currentTeamIndex != -1) - { for ( int i = 0; i < PERSONNEL_NUM_BTN; ++i ) EnableButton( giPersonnelATMStartButton[ i ] ); SoldierID iId = currentTeamList[currentTeamIndex]; - if (iId != NOBODY) + if (iId != NOBODY && iId->bAssignment == ASSIGNMENT_POW ) { - if ( iId->bAssignment == ASSIGNMENT_POW ) - { DisableButton( giPersonnelATMStartButton[ PERSONNEL_INV_BTN ] ); if ( gubPersonnelInfoState == PERSONNEL_INV_BTN ) @@ -6019,15 +6014,7 @@ void UpDateStateOfStartButton( void ) gubPersonnelInfoState = PERSONNEL_STAT_BTN; fPausedReDrawScreenFlag = TRUE; } - } } - } - else - { - // not valid, disable - for ( int i = 0; i < PERSONNEL_NUM_BTN; ++i ) - DisableButton( giPersonnelATMStartButton[ i ] ); - } } else {