Use SoldierID

Rename function parameter to make it clear it needs to be profileID
Change the parameter type to UINT8
This commit is contained in:
Asdow
2024-11-20 21:10:44 +02:00
parent 3f4c94642e
commit 63fe0be512
+6 -6
View File
@@ -667,7 +667,7 @@ void EnableQDSButtons();
BOOLEAN DoQDSMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback ); BOOLEAN DoQDSMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback );
void IncrementActiveDropDownBox( INT16 sIncrementValue ); void IncrementActiveDropDownBox( INT16 sIncrementValue );
INT16 IsMercInTheSector( UINT16 usMercID ); SoldierID IsMercInTheSector( UINT8 ubMercProfileID );
void RefreshAllNPCInventory(); void RefreshAllNPCInventory();
void SetQDSMercProfile(); void SetQDSMercProfile();
void HandleQDSTalkingMerc(); void HandleQDSTalkingMerc();
@@ -3270,7 +3270,7 @@ void BtnQuestDebugAllOrSectorNPCToggleCallback( GUI_BUTTON *btn, INT32 reason )
DisableButton( guiQuestDebugStartMercTalkingButtonButton ); DisableButton( guiQuestDebugStartMercTalkingButtonButton );
} }
if( IsMercInTheSector( gNpcListBox.sCurSelectedItem ) == -1 ) if( IsMercInTheSector( gNpcListBox.sCurSelectedItem ) == NOBODY )
DisableButton( guiQuestDebugViewNPCInvButton ); DisableButton( guiQuestDebugViewNPCInvButton );
EnableQDSButtons(); EnableQDSButtons();
@@ -3567,7 +3567,7 @@ void EnableQDSButtons()
if( gfUseLocalNPCs ) if( gfUseLocalNPCs )
{ {
if( IsMercInTheSector( gubCurrentNpcInSector[ gNpcListBox.sCurSelectedItem ] ) != -1 ) if( IsMercInTheSector( gubCurrentNpcInSector[ gNpcListBox.sCurSelectedItem ] ) != NOBODY )
{ {
EnableButton( guiQuestDebugViewNPCInvButton ); EnableButton( guiQuestDebugViewNPCInvButton );
EnableButton( guiQuestDebugNPCRefreshButtonButton ); EnableButton( guiQuestDebugNPCRefreshButtonButton );
@@ -3664,20 +3664,20 @@ void IncrementActiveDropDownBox( INT16 sIncrementValue )
} }
INT16 IsMercInTheSector( UINT16 usMercID ) SoldierID IsMercInTheSector( UINT8 ubMercProfileID )
{ {
UINT16 cnt; UINT16 cnt;
for ( cnt=0; cnt < TOTAL_SOLDIERS; cnt++ ) for ( cnt=0; cnt < TOTAL_SOLDIERS; cnt++ )
{ {
//if the merc is active //if the merc is active
if( Menptr[ cnt ].ubProfile == usMercID ) if( Menptr[ cnt ].ubProfile == ubMercProfileID )
{ {
if( Menptr[ cnt ].bActive ) if( Menptr[ cnt ].bActive )
return( Menptr[ cnt ].ubID ); return( Menptr[ cnt ].ubID );
} }
} }
return( -1 ); return( NOBODY );
} }