mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Space Viking's many mercs changes plus numerous generic bug fixes
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2498 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -69,8 +69,9 @@ class SOLDIERTYPE;
|
||||
// the number of help region messages
|
||||
#define NUMBER_OF_MAPSCREEN_HELP_MESSAGES 5
|
||||
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
// number of LINKED LISTS for sets of leave items (each slot holds an unlimited # of items)
|
||||
#define NUM_LEAVE_LIST_SLOTS 20
|
||||
#define NUM_LEAVE_LIST_SLOTS CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS
|
||||
|
||||
#define SELECTED_CHAR_ARROW_X 1 //8
|
||||
|
||||
@@ -115,7 +116,7 @@ enum{
|
||||
UINT16 usVehicleY = 0;
|
||||
|
||||
// waiting list for update box
|
||||
INT32 iUpdateBoxWaitingList[ MAX_CHARACTER_COUNT ];
|
||||
INT32 iUpdateBoxWaitingList[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
|
||||
|
||||
FASTHELPREGION pFastHelpMapScreenList[ MAX_MAPSCREEN_FAST_HELP ];
|
||||
|
||||
@@ -194,8 +195,8 @@ extern INT32 giCharInfoButton[];
|
||||
extern STR16 pUpdatePanelButtons[];
|
||||
|
||||
// the list of soldiers that are moving
|
||||
SOLDIERTYPE * pSoldierMovingList[ MAX_CHARACTER_COUNT ];
|
||||
BOOLEAN fSoldierIsMoving[ MAX_CHARACTER_COUNT ];
|
||||
SOLDIERTYPE * pSoldierMovingList[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
|
||||
BOOLEAN fSoldierIsMoving[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
|
||||
|
||||
SOLDIERTYPE *pUpdateSoldierBox[ SIZE_OF_UPDATE_BOX ];
|
||||
|
||||
@@ -226,7 +227,7 @@ BOOLEAN fMapInventoryPoolInited = FALSE;
|
||||
BOOLEAN fShowMapScreenMovementList = FALSE;
|
||||
|
||||
|
||||
MapScreenCharacterSt gCharactersList[ MAX_CHARACTER_COUNT+1];
|
||||
MapScreenCharacterSt gCharactersList[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS+1];
|
||||
|
||||
extern MOUSE_REGION gCharInfoHandRegion;
|
||||
MOUSE_REGION gMapStatusBarsRegion;
|
||||
@@ -234,7 +235,7 @@ MOUSE_REGION gMapStatusBarsRegion;
|
||||
SGPPoint MovePosition={450, 100 };
|
||||
|
||||
// which lines are selected? .. for assigning groups of mercs to the same thing
|
||||
BOOLEAN fSelectedListOfMercsForMapScreen[ MAX_CHARACTER_COUNT ];
|
||||
BOOLEAN fSelectedListOfMercsForMapScreen[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
|
||||
BOOLEAN fResetTimerForFirstEntryIntoMapScreen = FALSE;
|
||||
INT32 iReasonForSoldierUpDate = NO_REASON_FOR_UPDATE;
|
||||
|
||||
@@ -246,7 +247,7 @@ UINT32 guiSAMICON;
|
||||
BOOLEAN fDisableDueToBattleRoster = FALSE;
|
||||
|
||||
// track old contract times
|
||||
INT32 iOldContractTimes[ MAX_CHARACTER_COUNT ];
|
||||
INT32 iOldContractTimes[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
|
||||
|
||||
// position of pop up box
|
||||
INT32 giBoxY = 0;
|
||||
@@ -431,7 +432,7 @@ void InitalizeVehicleAndCharacterList( void )
|
||||
|
||||
void SetEntryInSelectedCharacterList( INT8 bEntry )
|
||||
{
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < MAX_CHARACTER_COUNT ) );
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
|
||||
|
||||
// set this entry to selected
|
||||
fSelectedListOfMercsForMapScreen[ bEntry ] = TRUE ;
|
||||
@@ -441,7 +442,7 @@ void SetEntryInSelectedCharacterList( INT8 bEntry )
|
||||
|
||||
void ResetEntryForSelectedList( INT8 bEntry )
|
||||
{
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < MAX_CHARACTER_COUNT ) );
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
|
||||
|
||||
// set this entry to selected
|
||||
fSelectedListOfMercsForMapScreen[ bEntry ] = FALSE;
|
||||
@@ -451,8 +452,9 @@ void ResetEntryForSelectedList( INT8 bEntry )
|
||||
|
||||
void ResetSelectedListForMapScreen( void )
|
||||
{
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
// set all the entries int he selected list to false
|
||||
memset( &fSelectedListOfMercsForMapScreen, FALSE, MAX_CHARACTER_COUNT * sizeof( BOOLEAN ) );
|
||||
memset( fSelectedListOfMercsForMapScreen, FALSE, sizeof(fSelectedListOfMercsForMapScreen) );
|
||||
|
||||
// if we still have a valid dude selected
|
||||
if ( ( bSelectedInfoChar != -1 ) && ( gCharactersList[ bSelectedInfoChar ].fValid == TRUE ) )
|
||||
@@ -467,7 +469,7 @@ void ResetSelectedListForMapScreen( void )
|
||||
|
||||
BOOLEAN IsEntryInSelectedListSet( INT8 bEntry )
|
||||
{
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < MAX_CHARACTER_COUNT ) );
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
|
||||
|
||||
// is this entry in the selected list set?
|
||||
|
||||
@@ -478,7 +480,7 @@ BOOLEAN IsEntryInSelectedListSet( INT8 bEntry )
|
||||
|
||||
void ToggleEntryInSelectedList( INT8 bEntry )
|
||||
{
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < MAX_CHARACTER_COUNT ) );
|
||||
Assert( ( bEntry >= 0 ) && ( bEntry < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) );
|
||||
|
||||
// toggle the value in the selected list
|
||||
fSelectedListOfMercsForMapScreen[ bEntry ] = !( fSelectedListOfMercsForMapScreen[ bEntry ] );
|
||||
@@ -520,7 +522,7 @@ BOOLEAN MultipleCharacterListEntriesSelected( void )
|
||||
INT32 iCounter = 0;
|
||||
|
||||
// check if more than one person is selected in the selected list
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( fSelectedListOfMercsForMapScreen[iCounter] == TRUE )
|
||||
{
|
||||
@@ -545,7 +547,7 @@ void ResetAssignmentsForMercsTrainingUnpaidSectorsInSelectedList( INT8 bAssignme
|
||||
INT32 iCounter = 0;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
// valid character?
|
||||
if( gCharactersList[ iCounter ].fValid == FALSE )
|
||||
@@ -577,7 +579,7 @@ void ResetAssignmentOfMercsThatWereTrainingMilitiaInThisSector( INT16 sSectorX,
|
||||
INT32 iCounter = 0;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
// valid character?
|
||||
if( gCharactersList[ iCounter ].fValid == FALSE )
|
||||
@@ -610,7 +612,7 @@ void PlotPathForSelectedCharacterList( INT16 sX, INT16 sY )
|
||||
{
|
||||
INT32 iCounter = 0;
|
||||
// run through list and build paths for each character
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( ( fSelectedListOfMercsForMapScreen[ iCounter ] == TRUE )&&( bSelectedDestChar != iCounter ) )
|
||||
{
|
||||
@@ -630,7 +632,7 @@ void DeselectSelectedListMercsWhoCantMoveWithThisGuy( SOLDIERTYPE *pSoldier )
|
||||
|
||||
|
||||
// deselect any other selected mercs that can't travel together with pSoldier
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter ].fValid == TRUE )
|
||||
{
|
||||
@@ -725,7 +727,7 @@ void SelectUnselectedMercsWhoMustMoveWithThisGuy( void )
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter ].fValid == TRUE )
|
||||
{
|
||||
@@ -757,7 +759,7 @@ BOOLEAN AnyMercInSameSquadOrVehicleIsSelected( SOLDIERTYPE *pSoldier )
|
||||
SOLDIERTYPE *pSoldier2 = NULL;
|
||||
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter ].fValid == TRUE )
|
||||
{
|
||||
@@ -836,7 +838,7 @@ void RestoreBackgroundForAssignmentGlowRegionList( void )
|
||||
if( iOldAssignmentLine != giAssignHighLine )
|
||||
{
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 66, Y_START - 1, 118 + 1 - 67, ( INT16 )( ( ( MAX_CHARACTER_COUNT + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
|
||||
RestoreExternBackgroundRect( 66, Y_START - 1, 118 + 1 - 67, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -864,7 +866,7 @@ void RestoreBackgroundForDestinationGlowRegionList( void )
|
||||
if( iOldDestinationLine != giDestHighLine )
|
||||
{
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 182, Y_START - 1, 217 + 1 - 182, ( INT16 )( ( ( MAX_CHARACTER_COUNT + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
|
||||
RestoreExternBackgroundRect( 182, Y_START - 1, 217 + 1 - 182, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) );
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -892,7 +894,7 @@ void RestoreBackgroundForContractGlowRegionList( void )
|
||||
if( iOldContractLine != giContractHighLine )
|
||||
{
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 222, Y_START - 1, 250 + 1 - 222, ( INT16 )( ( ( MAX_CHARACTER_COUNT + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
|
||||
RestoreExternBackgroundRect( 222, Y_START - 1, 250 + 1 - 222, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -924,7 +926,7 @@ void RestoreBackgroundForSleepGlowRegionList( void )
|
||||
if( iOldSleepHighLine != giSleepHighLine )
|
||||
{
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 123, Y_START - 1, 142 + 1 - 123, ( INT16 )( ( ( MAX_CHARACTER_COUNT + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
|
||||
RestoreExternBackgroundRect( 123, Y_START - 1, 142 + 1 - 123, ( INT16 )( ( ( CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 ) ) ;
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -965,7 +967,7 @@ void PlayGlowRegionSound( void )
|
||||
INT16 CharacterIsGettingPathPlotted( INT16 sCharNumber )
|
||||
{
|
||||
// valid character number?
|
||||
if( ( sCharNumber < 0 ) || ( sCharNumber >= MAX_CHARACTER_COUNT ) )
|
||||
if( ( sCharNumber < 0 ) || ( sCharNumber >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -1007,7 +1009,7 @@ INT16 CharacterIsGettingPathPlotted( INT16 sCharNumber )
|
||||
BOOLEAN IsCharacterSelectedForAssignment( INT16 sCharNumber )
|
||||
{
|
||||
// valid character number?
|
||||
if( ( sCharNumber < 0 ) || ( sCharNumber >= MAX_CHARACTER_COUNT ) )
|
||||
if( ( sCharNumber < 0 ) || ( sCharNumber >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -1044,7 +1046,7 @@ BOOLEAN IsCharacterSelectedForAssignment( INT16 sCharNumber )
|
||||
BOOLEAN IsCharacterSelectedForSleep( INT16 sCharNumber )
|
||||
{
|
||||
// valid character number?
|
||||
if( ( sCharNumber < 0 ) || ( sCharNumber >= MAX_CHARACTER_COUNT ) )
|
||||
if( ( sCharNumber < 0 ) || ( sCharNumber >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -1104,7 +1106,7 @@ void ActivateSoldierPopup( SOLDIERTYPE *pSoldier, UINT8 ubPopupType, INT16 xp, I
|
||||
INT8 bCharacter = -1;
|
||||
|
||||
|
||||
for( bCounter = 0; bCounter < MAX_CHARACTER_COUNT; bCounter++ )
|
||||
for( bCounter = 0; bCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; bCounter++ )
|
||||
{
|
||||
if( gCharactersList[ bCounter ].fValid == TRUE )
|
||||
{
|
||||
@@ -1247,7 +1249,7 @@ void CheckAndUpdateBasedOnContractTimes( void )
|
||||
INT32 iCounter = 0;
|
||||
INT32 iTimeRemaining = 0;
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[iCounter].fValid == TRUE )
|
||||
{
|
||||
@@ -1343,7 +1345,7 @@ void HandleDisplayOfSelectedMercArrows( void )
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0,SELECTED_CHAR_ARROW_X, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
|
||||
// now run through the selected list of guys, an arrow for each
|
||||
for( ubCount = 0; ubCount < MAX_CHARACTER_COUNT; ubCount++ )
|
||||
for( ubCount = 0; ubCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; ubCount++ )
|
||||
{
|
||||
if( gCharactersList[ ubCount ].fValid == TRUE )
|
||||
{
|
||||
@@ -1974,7 +1976,7 @@ INT32 GetNumberOfCharactersOnPlayersTeam( void )
|
||||
{
|
||||
INT32 iNumberOfPeople = 0, iCounter = 0;
|
||||
|
||||
for(iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for(iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter ].fValid == TRUE )
|
||||
{
|
||||
@@ -2109,7 +2111,7 @@ void FindAndSetThisContractSoldier( SOLDIERTYPE *pSoldier )
|
||||
|
||||
fShowContractMenu = FALSE;
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter].fValid == TRUE )
|
||||
{
|
||||
@@ -2297,7 +2299,7 @@ void RandomMercInGroupSaysQuote( GROUP *pGroup, UINT16 usQuoteNum )
|
||||
{
|
||||
PLAYERGROUP *pPlayer;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT8 ubMercsInGroup[ 20 ];
|
||||
UINT8 ubMercsInGroup[ CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ];
|
||||
UINT8 ubNumMercs = 0;
|
||||
UINT8 ubChosenMerc;
|
||||
|
||||
@@ -2343,7 +2345,7 @@ INT32 GetNumberOfPeopleInCharacterList( void )
|
||||
INT32 iCounter = 0, iCount = 0;
|
||||
|
||||
// get the number of valid mercs in the mapscreen character list
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter].fValid == TRUE )
|
||||
{
|
||||
@@ -2511,7 +2513,7 @@ void GoToNextCharacterInList( void )
|
||||
}
|
||||
|
||||
// is the current guy invalid or the first one?
|
||||
if( ( bSelectedInfoChar == -1 )|| ( bSelectedInfoChar == MAX_CHARACTER_COUNT ) )
|
||||
if( ( bSelectedInfoChar == -1 )|| ( bSelectedInfoChar == CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) )
|
||||
{
|
||||
iCount = 0;
|
||||
}
|
||||
@@ -2520,9 +2522,9 @@ void GoToNextCharacterInList( void )
|
||||
iCount = bSelectedInfoChar + 1;
|
||||
}
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < MAX_CHARACTER_COUNT ) && ValidSelectableCharForNextOrPrev( iCount ) )
|
||||
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCount ) )
|
||||
{
|
||||
ChangeSelectedInfoChar( ( INT8 )iCount, TRUE );
|
||||
break;
|
||||
@@ -2531,7 +2533,7 @@ void GoToNextCharacterInList( void )
|
||||
{
|
||||
iCount++;
|
||||
|
||||
if( iCount >= MAX_CHARACTER_COUNT )
|
||||
if( iCount >= CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS )
|
||||
{
|
||||
iCount = 0;
|
||||
}
|
||||
@@ -2558,7 +2560,7 @@ void GoToPrevCharacterInList( void )
|
||||
// is the current guy invalid or the first one?
|
||||
if( ( bSelectedInfoChar == -1 ) || ( bSelectedInfoChar == 0 ) )
|
||||
{
|
||||
iCount = MAX_CHARACTER_COUNT;
|
||||
iCount = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2566,9 +2568,9 @@ void GoToPrevCharacterInList( void )
|
||||
}
|
||||
|
||||
// now run through the list and find first prev guy
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < MAX_CHARACTER_COUNT ) && ValidSelectableCharForNextOrPrev( iCount ) )
|
||||
if ( ( gCharactersList[ iCount ].fValid ) && ( iCount < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS ) && ValidSelectableCharForNextOrPrev( iCount ) )
|
||||
{
|
||||
ChangeSelectedInfoChar( ( INT8 )iCount, TRUE );
|
||||
break;
|
||||
@@ -2580,7 +2582,7 @@ void GoToPrevCharacterInList( void )
|
||||
if( iCount < 0 )
|
||||
{
|
||||
// was FIRST_VEHICLE
|
||||
iCount = MAX_CHARACTER_COUNT;
|
||||
iCount = CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3297,7 +3299,7 @@ void DeselectVehicleForMovement( INT32 iVehicleId )
|
||||
fVehicleIsMoving[ iCounter ] = FALSE;
|
||||
|
||||
// now deselect everyone in vehicle
|
||||
for( iCount = 0; iCount < 10 ; iCount++ )
|
||||
for( iCount = 0; iCount < MAXPASSENGERS ; iCount++ )
|
||||
{
|
||||
pPassenger = pVehicleList[ iVehicleId ].pPassengers[ iCount ];
|
||||
|
||||
@@ -3361,7 +3363,7 @@ void AddSoldierToMovingLists( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
INT32 iCounter = 0;
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( pSoldierMovingList[ iCounter ] == pSoldier )
|
||||
{
|
||||
@@ -3457,7 +3459,7 @@ void InitializeMovingLists( void )
|
||||
giNumberOfVehiclesInSectorMoving = 0;
|
||||
|
||||
// init the soldiers
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
// soldier is NOT moving
|
||||
pSoldierMovingList[ iCounter ] = NULL;
|
||||
@@ -3495,7 +3497,7 @@ BOOLEAN IsAnythingSelectedForMoving( void )
|
||||
|
||||
|
||||
// check soldiers
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if ( ( pSoldierMovingList[ iCounter ] != NULL ) && fSoldierIsMoving[ iCounter ] )
|
||||
{
|
||||
@@ -3578,7 +3580,7 @@ void SetUpMovingListsForSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
|
||||
// note that Skyrider can't be moved using the move box, and won't appear because the helicoprer is not in the char list
|
||||
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter ].fValid )
|
||||
{
|
||||
@@ -4440,7 +4442,7 @@ void HandleSettingTheSelectedListOfMercs( void )
|
||||
bSelectedDestChar = -1;
|
||||
|
||||
// run through the list of grunts
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
// is the current guy a valid character?
|
||||
if( gCharactersList[ iCounter ].fValid == TRUE )
|
||||
@@ -5597,7 +5599,7 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
|
||||
|
||||
if (!is_networked)
|
||||
// select starting sector (A9 - Omerta)
|
||||
ChangeSelectedMapSector( 9, 1, 0 );
|
||||
ChangeSelectedMapSector( startingX, startingY, startingZ );
|
||||
|
||||
if (is_networked)
|
||||
{
|
||||
@@ -5613,13 +5615,13 @@ BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
|
||||
else
|
||||
{
|
||||
// load starting sector
|
||||
if ( !SetCurrentWorldSector( 9, 1, 0 ) )
|
||||
if ( !SetCurrentWorldSector( startingX, startingY, startingZ ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
gubPBSectorX = 9;
|
||||
gubPBSectorY = 1;
|
||||
gubPBSectorX = startingX;
|
||||
gubPBSectorY = startingY;
|
||||
}
|
||||
|
||||
|
||||
@@ -6105,7 +6107,7 @@ BOOLEAN CanEntireMovementGroupMercIsInMove( SOLDIERTYPE *pSoldier, INT8 *pbError
|
||||
// even if group is 0 (not that that should happen, should it?) still loop through for other mercs selected to move
|
||||
|
||||
// if anyone in the merc's group or also selected cannot move for whatever reason return false
|
||||
for( iCounter = 0; iCounter < MAX_CHARACTER_COUNT; iCounter++ )
|
||||
for( iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
|
||||
{
|
||||
if( gCharactersList[ iCounter ].fValid == TRUE )
|
||||
{
|
||||
@@ -6423,6 +6425,11 @@ BOOLEAN LoadLeaveItemList( HWFILE hFile )
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// Sanity check
|
||||
if (uiCount > 1000) {
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// allocate space
|
||||
gpLeaveListHead[ iCounter ] = new MERC_LEAVE_ITEM;
|
||||
if( gpLeaveListHead[ iCounter ] == NULL )
|
||||
|
||||
Reference in New Issue
Block a user