From fcf2b27d1ac7a13c4a163eeca082b6e2098f3dff Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Mon, 11 Nov 2024 00:08:30 +0200 Subject: [PATCH] More UINT8 -> UINT16 changes --- Strategic/Auto Resolve.cpp | 8 +-- Strategic/Campaign Types.h | 2 +- Strategic/Map Screen Interface Map.cpp | 12 ++--- Strategic/MilitiaIndividual.cpp | 4 +- Strategic/MilitiaIndividual.h | 6 +-- Strategic/MilitiaSquads.cpp | 72 +++++++++++++------------- Strategic/PreBattle Interface.cpp | 12 ++--- Strategic/Queen Command.cpp | 6 +-- Strategic/Rebel Command.cpp | 2 +- Strategic/Rebel Command.h | 2 +- Strategic/Strategic Movement.cpp | 8 +-- Strategic/Strategic Movement.h | 2 +- Strategic/Town Militia.cpp | 36 ++++++------- Strategic/Town Militia.h | 14 ++--- Strategic/mapscreen.cpp | 6 +-- Tactical/Inventory Choosing.cpp | 8 +-- Tactical/Inventory Choosing.h | 4 +- Tactical/Militia Control.cpp | 2 +- Tactical/Overhead.cpp | 2 +- Tactical/Soldier Init List.cpp | 30 +++++------ Tactical/Soldier Init List.h | 4 +- 21 files changed, 121 insertions(+), 121 deletions(-) diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp index 565cf5bb..5a1cb23a 100644 --- a/Strategic/Auto Resolve.cpp +++ b/Strategic/Auto Resolve.cpp @@ -2048,7 +2048,7 @@ static void ARCreateMilitia( UINT8 mclass, INT32 i, INT16 sX, INT16 sY) swprintf( gpCivs[i].pSoldier->name, gpStrategicString[ STR_AR_MILITIA_NAME ] ); } -static void ARCreateMilitiaSquad( UINT8 *cnt, UINT8 ubEliteMilitia, UINT8 ubRegMilitia, UINT8 ubGreenMilitia, INT16 sX, INT16 sY) +static void ARCreateMilitiaSquad( UINT16 *cnt, UINT16 ubEliteMilitia, UINT16 ubRegMilitia, UINT16 ubGreenMilitia, INT16 sX, INT16 sY) { while( *cnt < gpAR->ubCivs && (ubEliteMilitia || ubRegMilitia || ubGreenMilitia) ) { @@ -2077,10 +2077,10 @@ void CreateAutoResolveInterface() VOBJECT_DESC VObjectDesc; INT32 i, index; HVOBJECT hVObject; - UINT8 ubGreenMilitia, ubRegMilitia, ubEliteMilitia; + UINT16 ubGreenMilitia, ubRegMilitia, ubEliteMilitia; UINT16 pMoveDir[4][3]; UINT8 uiDirNumber = 0; - UINT8 cnt; + UINT16 cnt; //Setup new autoresolve blanket interface. MSYS_DefineRegion( &gpAR->AutoResolveRegion, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH-1, 0, @@ -2200,7 +2200,7 @@ void CreateAutoResolveInterface() ubGreenMilitia = MilitiaInSectorOfRank( gpAR->ubSectorX, gpAR->ubSectorY, GREEN_MILITIA ); // see if we get any bonus militia from nearby towns - UINT8 bonusGreenMilitia = 0, bonusRegularMilitia = 0, bonusEliteMilitia = 0; + UINT16 bonusGreenMilitia = 0, bonusRegularMilitia = 0, bonusEliteMilitia = 0; RebelCommand::GetBonusMilitia(gpAR->ubSectorX, gpAR->ubSectorY, bonusGreenMilitia, bonusRegularMilitia, bonusEliteMilitia, FALSE); // no need to create a group for autoresolve as we're just increasing local militia pop ubEliteMilitia += bonusEliteMilitia; ubRegMilitia += bonusRegularMilitia; diff --git a/Strategic/Campaign Types.h b/Strategic/Campaign Types.h index 238568a9..f5b6d996 100644 --- a/Strategic/Campaign Types.h +++ b/Strategic/Campaign Types.h @@ -519,7 +519,7 @@ typedef struct SECTORINFO //the more people go near it. A travel rating of 0 means there are never people //around. This value is used for determining how often items would "vanish" from //a sector (nice theory, except it isn't being used that way. Stealing is only in towns. ARM) - UINT8 ubNumberOfCivsAtLevel[ MAX_MILITIA_LEVELS ]; // town militia per experience class, 0/1/2 is GREEN/REGULAR/ELITE + UINT16 ubNumberOfCivsAtLevel[ MAX_MILITIA_LEVELS ]; // town militia per experience class, 0/1/2 is GREEN/REGULAR/ELITE // HEADROCK HAM 3.6: Adding separate training percentage for MOBILES. UINT8 usFiller3; UINT8 usFiller1; diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp index 8fd4fa52..8fcb5381 100644 --- a/Strategic/Map Screen Interface Map.cpp +++ b/Strategic/Map Screen Interface Map.cpp @@ -6231,14 +6231,14 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen4"); usSector = SECTOR( sSectorX, sSectorY ); // distribute here - SectorInfo[usSector].ubNumberOfCivsAtLevel[ GREEN_MILITIA ] = ( UINT8 )( iNumberOfGreens / iNumberUnderControl ); - SectorInfo[usSector].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] = ( UINT8 )( iNumberOfRegulars / iNumberUnderControl ); - SectorInfo[usSector].ubNumberOfCivsAtLevel[ ELITE_MILITIA ] = ( UINT8 )( iNumberOfElites / iNumberUnderControl ); + SectorInfo[usSector].ubNumberOfCivsAtLevel[ GREEN_MILITIA ] = ( UINT16 )( iNumberOfGreens / iNumberUnderControl ); + SectorInfo[usSector].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] = ( UINT16 )( iNumberOfRegulars / iNumberUnderControl ); + SectorInfo[usSector].ubNumberOfCivsAtLevel[ ELITE_MILITIA ] = ( UINT16 )( iNumberOfElites / iNumberUnderControl ); // Flugente: indivdual militia - DropIndividualMilitia( usSector, GREEN_MILITIA, (UINT8)(iNumberOfGreens / iNumberUnderControl) ); - DropIndividualMilitia( usSector, REGULAR_MILITIA, (UINT8)(iNumberOfRegulars / iNumberUnderControl) ); - DropIndividualMilitia( usSector, ELITE_MILITIA, (UINT8)(iNumberOfElites / iNumberUnderControl) ); + DropIndividualMilitia( usSector, GREEN_MILITIA, (UINT16)(iNumberOfGreens / iNumberUnderControl) ); + DropIndividualMilitia( usSector, REGULAR_MILITIA, (UINT16)(iNumberOfRegulars / iNumberUnderControl) ); + DropIndividualMilitia( usSector, ELITE_MILITIA, (UINT16)(iNumberOfElites / iNumberUnderControl) ); // Flugente: as we do not move the group militia, we have to make sure we don't accidentally overfill a sector sTotalSoFar = NumNonPlayerTeamMembersInSector( sSectorX, sSectorY, MILITIA_TEAM ); diff --git a/Strategic/MilitiaIndividual.cpp b/Strategic/MilitiaIndividual.cpp index dade1619..28cd25af 100644 --- a/Strategic/MilitiaIndividual.cpp +++ b/Strategic/MilitiaIndividual.cpp @@ -1004,7 +1004,7 @@ void HandlePossibleMilitiaPromotion( SOLDIERTYPE* pSoldier, BOOLEAN aAutoResolve pSoldier->ubMilitiaAssists = 0; } -void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites ) +void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites ) { if ( !usGreens && !usRegulars && !usElites ) return; @@ -1042,7 +1042,7 @@ void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UI // militia are disbanded - we have to take note of that -void DisbandIndividualMilitia( UINT8 aSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites ) +void DisbandIndividualMilitia( UINT8 aSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites ) { std::vector::iterator itend = gIndividualMilitiaVector.end( ); for ( std::vector::iterator it = gIndividualMilitiaVector.begin( ); it != itend; ++it ) diff --git a/Strategic/MilitiaIndividual.h b/Strategic/MilitiaIndividual.h index e03e7a95..bb7747e7 100644 --- a/Strategic/MilitiaIndividual.h +++ b/Strategic/MilitiaIndividual.h @@ -179,10 +179,10 @@ FLOAT PromoteIndividualMilitiaInSector( UINT8 aSector, FLOAT aPointsToAdd ); // handle possible militia promotion and individual militia update void HandlePossibleMilitiaPromotion( SOLDIERTYPE* pSoldier, BOOLEAN aAutoResolve ); -void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites ); +void MoveIndividualMilitiaProfiles( UINT8 aSourceSector, UINT8 aTargetSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites ); // militia are disbanded - we have to take note of that -void DisbandIndividualMilitia( UINT8 aSector, UINT8 usGreens, UINT8 usRegulars, UINT8 usElites ); +void DisbandIndividualMilitia( UINT8 aSector, UINT16 usGreens, UINT16 usRegulars, UINT16 usElites ); void PromoteIndividualMilitia( UINT8 aSector, UINT8 aSoldierClass ); @@ -195,4 +195,4 @@ UINT32 GetDailyUpkeep_IndividualMilitia( UINT32& arNumGreen, UINT32& arNumRegula void PickIndividualMilitia( UINT8 aSector, UINT8 ubType, UINT16 aNumber ); void DropIndividualMilitia( UINT8 aSector, UINT8 ubType, UINT16 aNumber ); -#endif \ No newline at end of file +#endif diff --git a/Strategic/MilitiaSquads.cpp b/Strategic/MilitiaSquads.cpp index 149a6c97..793798ff 100644 --- a/Strategic/MilitiaSquads.cpp +++ b/Strategic/MilitiaSquads.cpp @@ -140,12 +140,12 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); SECTORINFO *pTSectorInfo = &( SectorInfo[ SECTOR( sTMapX, sTMapY ) ] ); - UINT8 bGreensSourceTeam = 0, bGreensDestTeam = 0; - UINT8 bRegularsSourceTeam = 0, bRegularsDestTeam = 0; - UINT8 bElitesSourceTeam = 0, bElitesDestTeam = 0; - UINT8 bTotalGreens = 0, bTotalRegulars = 0, bTotalElites = 0; + UINT16 bGreensSourceTeam = 0, bGreensDestTeam = 0; + UINT16 bRegularsSourceTeam = 0, bRegularsDestTeam = 0; + UINT16 bElitesSourceTeam = 0, bElitesDestTeam = 0; + UINT16 bTotalGreens = 0, bTotalRegulars = 0, bTotalElites = 0; UINT8 bTotalGreensPercent = 0, bTotalRegularsPercent = 0, bTotalElitesPercent = 0; - INT8 bNewSourceGroupSize = 0, bNewDestGroupSize = 0, bGroupSizeRatio = 0; + INT16 bNewSourceGroupSize = 0, bNewDestGroupSize = 0, bGroupSizeRatio = 0; UINT8 ubChanceToSpreadOut; ////////////////////////////////////////////////////////// @@ -165,8 +165,8 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL { // Wilderness->Wilderness movement. Calculate Spread Out chance based on threats. - UINT8 ubNumEnemiesNearOrigin = NumEnemiesInFiveSectors( sMapX, sMapY ); - UINT8 ubNumEnemiesNearTarget = NumEnemiesInFiveSectors( sTMapX, sTMapY ); + UINT16 ubNumEnemiesNearOrigin = NumEnemiesInFiveSectors( sMapX, sMapY ); + UINT16 ubNumEnemiesNearTarget = NumEnemiesInFiveSectors( sTMapX, sTMapY ); if (ubNumEnemiesNearOrigin == 0 && ubNumEnemiesNearTarget > 0 ) @@ -264,9 +264,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL // Flugente: mobiles take along their gear // move only gear for those who come new into a sector - UINT8 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]); - UINT8 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]); - UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]); + UINT16 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]); + UINT16 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]); + UINT16 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]); MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens); @@ -306,9 +306,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL // Flugente: mobiles take along their gear // move only gear for those who come new into a sector - UINT8 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]); - UINT8 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]); - UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]); + UINT16 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]); + UINT16 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]); + UINT16 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]); MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens); @@ -336,7 +336,7 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL { // Source team moves En-Masse to target sector. - bNewDestGroupSize = __min( (NumNonPlayerTeamMembersInSector( sTMapX, sTMapY, MILITIA_TEAM ) + NumNonPlayerTeamMembersInSector( sMapX, sMapY, MILITIA_TEAM )), (UINT8)gGameExternalOptions.iMaxMilitiaPerSector ); + bNewDestGroupSize = __min( (NumNonPlayerTeamMembersInSector( sTMapX, sTMapY, MILITIA_TEAM ) + NumNonPlayerTeamMembersInSector( sMapX, sMapY, MILITIA_TEAM )), (UINT16)gGameExternalOptions.iMaxMilitiaPerSector ); bNewSourceGroupSize = __max( 0, (NumNonPlayerTeamMembersInSector( sTMapX, sTMapY, MILITIA_TEAM ) + NumNonPlayerTeamMembersInSector( sMapX, sMapY, MILITIA_TEAM )) - gGameExternalOptions.iMaxMilitiaPerSector ); // If there are still going to be two teams after the transfer @@ -396,9 +396,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL // Flugente: mobiles take along their gear // move only gear for those who come new into a sector - UINT8 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]); - UINT8 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]); - UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]); + UINT16 elites = max(0, bElitesDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ]); + UINT16 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]); + UINT16 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]); MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens); @@ -432,9 +432,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL // Flugente: update individual militia data ApplyTacticalLifeRatioToMilitia( ); - UINT8 greens = pSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA]; - UINT8 regulars = pSectorInfo->ubNumberOfCivsAtLevel[REGULAR_MILITIA]; - UINT8 elites = pSectorInfo->ubNumberOfCivsAtLevel[ELITE_MILITIA]; + UINT16 greens = pSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA]; + UINT16 regulars = pSectorInfo->ubNumberOfCivsAtLevel[REGULAR_MILITIA]; + UINT16 elites = pSectorInfo->ubNumberOfCivsAtLevel[ELITE_MILITIA]; StrategicRemoveMilitiaFromSector( sMapX, sMapY, GREEN_MILITIA, greens ); StrategicRemoveMilitiaFromSector( sMapX, sMapY, REGULAR_MILITIA, regulars ); @@ -549,7 +549,7 @@ UINT16 CountDirectionEnemyRating( INT16 sMapX, INT16 sMapY, UINT8 uiDir ) for( sLMY = MINIMUM_VALID_Y_COORDINATE; sLMY <= MAXIMUM_VALID_Y_COORDINATE ; ++sLMY ) { // SECTORINFO *pSectorInfo = &( SectorInfo[ uiSector ] ); - UINT8 uiSumOfEnemyTroops = NumNonPlayerTeamMembersInSector( sLMX, sLMY, ENEMY_TEAM ); + UINT16 uiSumOfEnemyTroops = NumNonPlayerTeamMembersInSector( sLMX, sLMY, ENEMY_TEAM ); //pSectorInfo->ubNumAdmins + pSectorInfo->ubNumTroops + pSectorInfo->ubNumElites; // there's an enemy @@ -605,21 +605,21 @@ UINT16 CountDirectionRating( INT16 sMapX, INT16 sMapY, UINT8 uiDir ) return iRes; } - UINT8 ubMaxSquadSize = gGameExternalOptions.iMaxMilitiaPerSector; + UINT16 ubMaxSquadSize = gGameExternalOptions.iMaxMilitiaPerSector; - UINT8 ubSourceGreens = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ]; - UINT8 ubSourceRegulars = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]; - UINT8 ubSourceElites = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ]; - UINT8 ubTargetGreens = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ]; - UINT8 ubTargetRegulars = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]; - UINT8 ubTargetElites = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ]; + UINT16 ubSourceGreens = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ]; + UINT16 ubSourceRegulars = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]; + UINT16 ubSourceElites = SectorInfo[SECTOR(sMapX, sMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ]; + UINT16 ubTargetGreens = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ GREEN_MILITIA ]; + UINT16 ubTargetRegulars = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]; + UINT16 ubTargetElites = SectorInfo[SECTOR(sDMapX, sDMapY)].ubNumberOfCivsAtLevel[ ELITE_MILITIA ]; - UINT8 ubSourceMilitia = ubSourceGreens + ubSourceRegulars + ubSourceElites; - UINT8 ubTargetMilitia = ubTargetGreens + ubTargetRegulars + ubTargetElites; + UINT16 ubSourceMilitia = ubSourceGreens + ubSourceRegulars + ubSourceElites; + UINT16 ubTargetMilitia = ubTargetGreens + ubTargetRegulars + ubTargetElites; UINT16 usSourceEnemiesInFiveSectors = NumEnemiesInFiveSectors( sMapX, sMapY ); UINT16 usTargetEnemiesInFiveSectors = NumEnemiesInFiveSectors( sDMapX, sDMapY ); - UINT8 ubTargetEnemies = NumNonPlayerTeamMembersInSector( sDMapX, sDMapY, ENEMY_TEAM ); + UINT16 ubTargetEnemies = NumNonPlayerTeamMembersInSector( sDMapX, sDMapY, ENEMY_TEAM ); UINT16 usSourceMilitiaInFiveSectors = CountAllMilitiaInFiveSectors( sMapX, sMapY ); UINT16 usTargetMilitiaInFiveSectors = CountAllMilitiaInFiveSectors( sDMapX, sDMapY ); @@ -1112,7 +1112,7 @@ void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY ) UINT16 pMoveDir[4][3]; UINT8 uiDirNumber = 0; UINT8 x; - UINT8 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0; + UINT16 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0; SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); BOOLEAN fMoreTroopsLeft[4] = {FALSE,FALSE,FALSE,FALSE}; BOOLEAN fFirstLoop = TRUE; @@ -1175,7 +1175,7 @@ void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY ) // Flugente: order sNumber reinforcements from src sector to target sector BOOLEAN CallMilitiaReinforcements( INT16 sTargetMapX, INT16 sTargetMapY, INT16 sSrcMapX, INT16 sSrcMapY, UINT16 sNumber ) { - UINT8 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0; + UINT16 uiNumGreen = 0, uiNumReg = 0, uiNumElite = 0; SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sTargetMapX, sTargetMapY ) ] ); guiDirNumber = 0; @@ -1236,9 +1236,9 @@ BOOLEAN CallMilitiaReinforcements( INT16 sTargetMapX, INT16 sTargetMapY, INT16 s { ++sMilitiaMoved; - UINT8 militia_green = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, GREEN_MILITIA ); - UINT8 militia_troop = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, REGULAR_MILITIA ); - UINT8 militia_elite = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, ELITE_MILITIA ); + UINT16 militia_green = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, GREEN_MILITIA ); + UINT16 militia_troop = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, REGULAR_MILITIA ); + UINT16 militia_elite = MilitiaInSectorOfRank( sTargetMapX, sTargetMapY, ELITE_MILITIA ); gpAttackDirs[guiDirNumber][0] += militia_green - uiNumGreen; gpAttackDirs[guiDirNumber][1] += militia_troop - uiNumReg; diff --git a/Strategic/PreBattle Interface.cpp b/Strategic/PreBattle Interface.cpp index 003a1fe2..effe444f 100644 --- a/Strategic/PreBattle Interface.cpp +++ b/Strategic/PreBattle Interface.cpp @@ -298,9 +298,9 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI ) VOBJECT_DESC VObjectDesc; INT32 i; UINT8 ubGroupID = 0; - UINT8 ubNumStationaryEnemies = 0; - UINT8 ubNumMobileEnemies = 0; - UINT8 ubNumMercs; + UINT16 ubNumStationaryEnemies = 0; + UINT16 ubNumMobileEnemies = 0; + UINT16 ubNumMercs; BOOLEAN fUsePluralVersion = FALSE; INT8 bBestExpLevel = 0; BOOLEAN fRetreatAnOption = TRUE; @@ -2387,9 +2387,9 @@ void RetreatAllInvolvedMilitiaGroups() return; // as group size will be cut to MAX_STRATEGIC_ENEMY_GROUP_SIZE, see how many troops are allowed and reduce sector count accordingly - UINT8 greens = pSector->ubNumberOfCivsAtLevel[0]; - UINT8 regulars = pSector->ubNumberOfCivsAtLevel[1]; - UINT8 elites = pSector->ubNumberOfCivsAtLevel[2]; + UINT16 greens = pSector->ubNumberOfCivsAtLevel[0]; + UINT16 regulars = pSector->ubNumberOfCivsAtLevel[1]; + UINT16 elites = pSector->ubNumberOfCivsAtLevel[2]; pGroup = CreateNewMilitiaGroupDepartingFromSector( SECTOR( sBattleSectorX, sBattleSectorY ), greens, regulars, elites ); diff --git a/Strategic/Queen Command.cpp b/Strategic/Queen Command.cpp index 077d373d..58452a63 100644 --- a/Strategic/Queen Command.cpp +++ b/Strategic/Queen Command.cpp @@ -1771,8 +1771,8 @@ void AddPossiblePendingEnemiesToBattle() BOOLEAN fMagicallyAppeared=FALSE; #endif - UINT8 ubSlots, ubNumAvailable; - UINT8 ubNumRobots, ubNumElites, ubNumTroops, ubNumAdmins, ubNumTanks, ubNumJeeps; + UINT16 ubSlots, ubNumAvailable; + UINT16 ubNumRobots, ubNumElites, ubNumTroops, ubNumAdmins, ubNumTanks, ubNumJeeps; UINT8 ubNumGroupsInSector; UINT8 ubGroupIndex; GROUP *pGroup; @@ -2000,7 +2000,7 @@ void AddPossiblePendingEnemiesToBattle() pGroup = pGroupInSectorList[ ubGroupIndex]; // Flugente fix: check for underflow... - UINT8 currentgroupsize = pGroup->pEnemyGroup->ubElitesInBattle + pGroup->pEnemyGroup->ubTroopsInBattle + pGroup->pEnemyGroup->ubAdminsInBattle + UINT16 currentgroupsize = pGroup->pEnemyGroup->ubElitesInBattle + pGroup->pEnemyGroup->ubTroopsInBattle + pGroup->pEnemyGroup->ubAdminsInBattle + pGroup->pEnemyGroup->ubRobotsInBattle + pGroup->pEnemyGroup->ubTanksInBattle + pGroup->pEnemyGroup->ubJeepsInBattle; if ( currentgroupsize > pGroup->ubGroupSize ) ubNumAvailable = 0; diff --git a/Strategic/Rebel Command.cpp b/Strategic/Rebel Command.cpp index 7961b78a..1688ea83 100644 --- a/Strategic/Rebel Command.cpp +++ b/Strategic/Rebel Command.cpp @@ -3182,7 +3182,7 @@ INT32 GetMiningPolicyBonus(INT16 townId) return 0; } -void GetBonusMilitia(INT16 sx, INT16 sy, UINT8& green, UINT8& regular, UINT8& elite, BOOLEAN createGroup) +void GetBonusMilitia(INT16 sx, INT16 sy, UINT16& green, UINT16& regular, UINT16& elite, BOOLEAN createGroup) { if (!gGameExternalOptions.fRebelCommandEnabled) return; diff --git a/Strategic/Rebel Command.h b/Strategic/Rebel Command.h index 22b6fd3b..d29cff3f 100644 --- a/Strategic/Rebel Command.h +++ b/Strategic/Rebel Command.h @@ -188,7 +188,7 @@ void ApplyMilitiaBonuses(SOLDIERTYPE* pMilitia); UINT8 GetApproximateEnemyLocationResolutionIndex(); FLOAT GetAssignmentBonus(INT16 x, INT16 y); INT32 GetMiningPolicyBonus(INT16 townId); -void GetBonusMilitia(INT16 x, INT16 y, UINT8& green, UINT8& regular, UINT8& elite, BOOLEAN createGroup); +void GetBonusMilitia(INT16 x, INT16 y, UINT16& green, UINT16& regular, UINT16& elite, BOOLEAN createGroup); INT16 GetFortificationsBonus(UINT8 sector); FLOAT GetHarriersSpeedPenalty(UINT8 sector); FLOAT GetLoyaltyGainModifier(); diff --git a/Strategic/Strategic Movement.cpp b/Strategic/Strategic Movement.cpp index 21baa737..588f91c1 100644 --- a/Strategic/Strategic Movement.cpp +++ b/Strategic/Strategic Movement.cpp @@ -806,7 +806,7 @@ GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmin return NULL; } -GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT8& arusNumAdmins, UINT8& arusNumTroops, UINT8& arusNumElites ) +GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT16& arusNumAdmins, UINT16& arusNumTroops, UINT16& arusNumElites ) { GROUP *pNew; AssertMsg( uiSector >= 0 && uiSector <= 255, String( "CreateNewMilitiaGroupDepartingFromSector with out of range value of %d", uiSector ) ); @@ -846,7 +846,7 @@ GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT8& arusNum pNew->pEnemyGroup->ubNumAdmins = arusNumAdmins; pNew->pEnemyGroup->ubNumTroops = arusNumTroops; pNew->pEnemyGroup->ubNumElites = arusNumElites; - pNew->ubGroupSize = (UINT8)(arusNumAdmins + arusNumTroops + arusNumElites); + pNew->ubGroupSize = arusNumAdmins + arusNumTroops + arusNumElites; pNew->ubTransportationMask = FOOT; pNew->fVehicle = FALSE; pNew->ubCreatedSectorID = pNew->ubOriginalSector; @@ -1120,7 +1120,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating gfCantRetreatInPBI = TRUE; } - ubChosenMerc = (UINT8)Random( ubNumMercs ); + ubChosenMerc = (UINT16)Random( ubNumMercs ); pSoldier = MercPtrs[ ubMercsInGroup[ ubChosenMerc ] ]; gpTacticalTraversalChosenSoldier = pSoldier; @@ -1149,7 +1149,7 @@ void PrepareForPreBattleInterface( GROUP *pPlayerDialogGroup, GROUP *pInitiating gfCantRetreatInPBI = TRUE; } - ubChosenMerc = (UINT8)Random( ubNumMercs ); + ubChosenMerc = (UINT16)Random( ubNumMercs ); pSoldier = MercPtrs[ ubMercsInGroup[ ubChosenMerc ] ]; diff --git a/Strategic/Strategic Movement.h b/Strategic/Strategic Movement.h index d1aad931..1acd86d3 100644 --- a/Strategic/Strategic Movement.h +++ b/Strategic/Strategic Movement.h @@ -204,7 +204,7 @@ BOOLEAN SetGroupPatrolParameters( UINT8 ubGroupID, UINT8 ubRestAtFL, UINT8 ubRes //............................................................ GROUP* CreateNewEnemyGroupDepartingFromSector( UINT32 uiSector, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumRobots, UINT8 ubNumTanks, UINT8 ubNumJeeps ); -GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT8& arusNumAdmins, UINT8& arusNumTroops, UINT8& arusNumElites ); +GROUP* CreateNewMilitiaGroupDepartingFromSector( UINT32 uiSector, UINT16& arusNumAdmins, UINT16& arusNumTroops, UINT16& arusNumElites ); #ifdef JA2UB GROUP* CreateNewEnemyGroupDepartingFromSectorUsingZLevel( UINT32 uiSector, UINT8 ubSectorZ, UINT8 ubNumAdmins, UINT8 ubNumTroops, UINT8 ubNumElites, UINT8 ubNumTanks ); diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp index feaf4aed..976b9545 100644 --- a/Strategic/Town Militia.cpp +++ b/Strategic/Town Militia.cpp @@ -471,7 +471,7 @@ INT8 MilitiaRankToSoldierClass(UINT8 ubRank) return(bSoldierClass); } -void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany) +void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany) { SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); @@ -486,15 +486,15 @@ void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 u fMapPanelDirty = TRUE; } -void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT8 ubHowMany) +void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT16 ubHowMany) { SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); // damn well better have that many around to promote! //Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubCurrentRank ] >= ubHowMany); - UINT8 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubCurrentRank ); - UINT8 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubCurrentRank ); + UINT16 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubCurrentRank ); + UINT16 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubCurrentRank ); //KM : July 21, 1999 patch fix if ( ubCurrentRank >= ELITE_MILITIA || stationary + ingroups < ubHowMany ) @@ -503,8 +503,8 @@ void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRa } // determine how many static and - if necessary - group-based militia we have to remove - UINT8 reducestatic = min( stationary, ubHowMany ); - UINT8 reducegroups = min( ingroups, ubHowMany - reducestatic ); + UINT16 reducestatic = min( stationary, ubHowMany ); + UINT16 reducegroups = min( ingroups, ubHowMany - reducestatic ); pSectorInfo->ubNumberOfCivsAtLevel[ubCurrentRank] -= reducestatic; pSectorInfo->ubNumberOfCivsAtLevel[ubCurrentRank + 1] += reducestatic; @@ -541,7 +541,7 @@ void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRa fMapPanelDirty = TRUE; } -void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany) +void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany) { SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] ); @@ -549,8 +549,8 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI // damn well better have that many around to remove! //Assert(pSectorInfo->ubNumberOfCivsAtLevel[ ubRank ] >= ubHowMany); - UINT8 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubRank ); - UINT8 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubRank ); + UINT16 stationary = MilitiaInSectorOfRankStationary( sMapX, sMapY, ubRank ); + UINT16 ingroups = MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubRank ); //KM : July 21, 1999 patch fix if ( stationary + ingroups < ubHowMany ) @@ -559,8 +559,8 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI } // determine how many static and - if necessary - group-based militia we have to remove - UINT8 reducestatic = min( stationary, ubHowMany ); - UINT8 reducegroups = min( ingroups, ubHowMany - reducestatic ); + UINT16 reducestatic = min( stationary, ubHowMany ); + UINT16 reducegroups = min( ingroups, ubHowMany - reducestatic ); pSectorInfo->ubNumberOfCivsAtLevel[ubRank] -= reducestatic; @@ -571,21 +571,21 @@ void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UI { if ( ubRank == GREEN_MILITIA ) { - UINT8 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumAdmins ); + UINT16 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumAdmins ); pGroup->pEnemyGroup->ubNumAdmins -= reduced; pGroup->ubGroupSize -= reduced; reducegroups -= reduced; } else if ( ubRank == REGULAR_MILITIA ) { - UINT8 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumTroops ); + UINT16 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumTroops ); pGroup->pEnemyGroup->ubNumTroops -= reduced; pGroup->ubGroupSize -= reduced; reducegroups -= reduced; } else if ( ubRank == ELITE_MILITIA ) { - UINT8 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumElites ); + UINT16 reduced = min( reducegroups, pGroup->pEnemyGroup->ubNumElites ); pGroup->pEnemyGroup->ubNumElites -= reduced; pGroup->ubGroupSize -= reduced; reducegroups -= reduced; @@ -705,12 +705,12 @@ void HandleMilitiaDefections(INT16 sMapX, INT16 sMapY) } } -UINT8 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank) +UINT16 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank) { return MilitiaInSectorOfRankStationary( sMapX, sMapY, ubRank ) + MilitiaInSectorOfRankInGroups( sMapX, sMapY, ubRank ); } -UINT8 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank ) +UINT16 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank ) { if ( ubRank < MAX_MILITIA_LEVELS ) return SectorInfo[SECTOR( sMapX, sMapY )].ubNumberOfCivsAtLevel[ubRank]; @@ -718,9 +718,9 @@ UINT8 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank ) return 0; } -UINT8 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank ) +UINT16 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank ) { - UINT8 count = 0; + UINT16 count = 0; GROUP *pGroup = gpGroupList; while ( pGroup ) diff --git a/Strategic/Town Militia.h b/Strategic/Town Militia.h index 33824893..db584d71 100644 --- a/Strategic/Town Militia.h +++ b/Strategic/Town Militia.h @@ -30,9 +30,9 @@ INT8 SoldierClassToMilitiaRank(UINT8 ubSoldierClass); INT8 MilitiaRankToSoldierClass(UINT8 ubRank); // these add, promote, and remove militias of a certain rank -void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany); -void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT8 ubHowMany); -void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT8 ubHowMany); +void StrategicAddMilitiaToSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany); +void StrategicPromoteMilitiaInSector(INT16 sMapX, INT16 sMapY, UINT8 ubCurrentRank, UINT16 ubHowMany); +void StrategicRemoveMilitiaFromSector(INT16 sMapX, INT16 sMapY, UINT8 ubRank, UINT16 ubHowMany); void StrategicRemoveAllStaticMilitiaFromSector( INT16 sMapX, INT16 sMapY, UINT8 ubRank ); @@ -49,9 +49,9 @@ UINT8 FindBestMilitiaTrainingLeadershipInSector ( INT16 sMapX, INT16 sMapY, INT8 // call this if the player attacks his own militia void HandleMilitiaDefections(INT16 sMapX, INT16 sMapY); -UINT8 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank); -UINT8 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank ); -UINT8 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank ); +UINT16 MilitiaInSectorOfRank(INT16 sMapX, INT16 sMapY, UINT8 ubRank); +UINT16 MilitiaInSectorOfRankStationary( INT16 sMapX, INT16 sMapY, UINT8 ubRank ); +UINT16 MilitiaInSectorOfRankInGroups( INT16 sMapX, INT16 sMapY, UINT8 ubRank ); // Returns TRUE if sector is under player control, has no enemies in it, and isn't currently in combat mode BOOLEAN SectorOursAndPeaceful( INT16 sMapX, INT16 sMapY, INT8 bMapZ ); @@ -135,4 +135,4 @@ FLOAT GetIntel(); void AddRaidPersonnel( INT32 aBloodcats, INT32 aZombie, INT32 aBandits ); void GetRaidPersonnel( INT32& arBloodcats, INT32& arZombie, INT32& arBandits ); -#endif \ No newline at end of file +#endif diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp index 97d670ba..2afd246f 100644 --- a/Strategic/mapscreen.cpp +++ b/Strategic/mapscreen.cpp @@ -17506,9 +17506,9 @@ BOOLEAN MilitiaPlotStart( ) return FALSE; // as group size will be cut to MAX_STRATEGIC_ENEMY_GROUP_SIZE, see how many troops are allowed and reduce sector count accordingly - UINT8 greens = pSector->ubNumberOfCivsAtLevel[0]; - UINT8 regulars = pSector->ubNumberOfCivsAtLevel[1]; - UINT8 elites = pSector->ubNumberOfCivsAtLevel[2]; + UINT16 greens = pSector->ubNumberOfCivsAtLevel[0]; + UINT16 regulars = pSector->ubNumberOfCivsAtLevel[1]; + UINT16 elites = pSector->ubNumberOfCivsAtLevel[2]; // when we start plotting, the group is still empty - we add militia later GROUP* pGroup = CreateNewMilitiaGroupDepartingFromSector( SECTOR( sSelMapX, sSelMapY ), greens, regulars, elites ); diff --git a/Tactical/Inventory Choosing.cpp b/Tactical/Inventory Choosing.cpp index 72bfa796..4bab504f 100644 --- a/Tactical/Inventory Choosing.cpp +++ b/Tactical/Inventory Choosing.cpp @@ -3924,23 +3924,23 @@ void MoveOneMilitiaEquipmentSet(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, } } -void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT8 usElites, UINT8 usRegulars, UINT8 usGreens) +void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT16 usElites, UINT16 usRegulars, UINT16 usGreens) { if ( !gGameExternalOptions.fMilitiaUseSectorInventory ) return; // atm there is no class-specific selection, but that might change in the future - for (UINT8 i = 0; i < usElites; ++i) + for (UINT16 i = 0; i < usElites; ++i) { MoveOneMilitiaEquipmentSet( sSourceX, sSourceY, sTargetX, sTargetY, SOLDIER_CLASS_ELITE_MILITIA); } - for (UINT8 i = 0; i < usRegulars; ++i) + for (UINT16 i = 0; i < usRegulars; ++i) { MoveOneMilitiaEquipmentSet( sSourceX, sSourceY, sTargetX, sTargetY, SOLDIER_CLASS_REG_MILITIA); } - for (UINT8 i = 0; i < usGreens; ++i) + for (UINT16 i = 0; i < usGreens; ++i) { MoveOneMilitiaEquipmentSet( sSourceX, sSourceY, sTargetX, sTargetY, SOLDIER_CLASS_GREEN_MILITIA); } diff --git a/Tactical/Inventory Choosing.h b/Tactical/Inventory Choosing.h index 6f75e339..0fa4a469 100644 --- a/Tactical/Inventory Choosing.h +++ b/Tactical/Inventory Choosing.h @@ -121,9 +121,9 @@ extern ARMY_GUN_CHOICE_TYPE gArmyItemChoices[SOLDIER_GUN_CHOICE_SELECTIONS][MAX_ void MoveOneMilitiaEquipmentSet(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, INT8 bSoldierClass); // move a number of militia equipment sets between sectors -void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT8 usElites, UINT8 usRegulars, UINT8 usGreens); +void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT16 usElites, UINT16 usRegulars, UINT16 usGreens); // take militia items from sector void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass ); -#endif \ No newline at end of file +#endif diff --git a/Tactical/Militia Control.cpp b/Tactical/Militia Control.cpp index 715db535..e5fad2d8 100644 --- a/Tactical/Militia Control.cpp +++ b/Tactical/Militia Control.cpp @@ -199,7 +199,7 @@ void PrepareMilitiaForTactical( BOOLEAN fPrepareAll) { SECTORINFO *pSector; INT32 x; - UINT8 ubGreen, ubRegs, ubElites; + UINT16 ubGreen, ubRegs, ubElites; if( gbWorldSectorZ > 0 ) return; diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 1b155c8d..84fbb739 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -994,7 +994,7 @@ BOOLEAN ExecuteOverhead( ) // check if bonus militia join us if (checkBonusMilitia == TRUE && gGameExternalOptions.fRebelCommandEnabled && gubPBSectorZ == 0) { - UINT8 bonusGreenMilitia = 0, bonusRegularMilitia = 0, bonusEliteMilitia = 0; + UINT16 bonusGreenMilitia = 0, bonusRegularMilitia = 0, bonusEliteMilitia = 0; RebelCommand::GetBonusMilitia(gubPBSectorX, gubPBSectorY, bonusGreenMilitia, bonusRegularMilitia, bonusEliteMilitia, TRUE); checkBonusMilitia = FALSE; } diff --git a/Tactical/Soldier Init List.cpp b/Tactical/Soldier Init List.cpp index d4ec5fe7..3db1f288 100644 --- a/Tactical/Soldier Init List.cpp +++ b/Tactical/Soldier Init List.cpp @@ -2109,12 +2109,12 @@ void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT16 ubNumLarvae, UINT16 ubN } } -void AddSoldierInitListOtherCreatures( UINT8 usNum ) +void AddSoldierInitListOtherCreatures( UINT16 usNum ) { SOLDIERINITNODE *curr; - UINT8 ubFreeSlots; + UINT16 ubFreeSlots; BOOLEAN fDoPlacement; - UINT8 ubNumCreatures = usNum; + UINT16 ubNumCreatures = usNum; DebugMsg( TOPIC_JA2, DBG_LEVEL_3, String( "AddSoldierInitListBloodcats" ) ); @@ -2465,7 +2465,7 @@ void AddSoldierInitListBloodcats() else { //We don't yet know the number of bloodcat placements in this sector so //count them now, and permanently record it. - INT8 bBloodCatPlacements = 0; + INT16 bBloodCatPlacements = 0; curr = gSoldierInitHead; while( curr ) { @@ -2513,11 +2513,11 @@ void AddSoldierInitListBloodcats() } if( pSector->bBloodCats > 0 ) { //Add them to the world now... - UINT8 ubNumAdded = 0; - UINT8 ubMaxNum = (UINT8)pSector->bBloodCats; + UINT16 ubNumAdded = 0; + UINT16 ubMaxNum = (UINT16)pSector->bBloodCats; SOLDIERINITNODE *mark; - UINT8 ubSlotsToFill; - UINT8 ubSlotsAvailable; + UINT16 ubSlotsToFill; + UINT16 ubSlotsAvailable; SOLDIERINITNODE *curr; //Sort the list in the following manner: @@ -2983,12 +2983,12 @@ void StripEnemyDetailedPlacementsIfSectorWasPlayerLiberated() //#define CENTRAL_GRIDNO 13202 //#define CENTRAL_RADIUS 30 -void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNumGreen, UINT8 ubNumReg, UINT8 ubNumElites ) +void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT16 ubNumGreen, UINT16 ubNumReg, UINT16 ubNumElites ) { SOLDIERTYPE *pSoldier; MAPEDGEPOINTINFO MapEdgepointInfo; - UINT8 ubCurrSlot; - UINT8 ubTotalSoldiers; + UINT16 ubCurrSlot; + UINT16 ubTotalSoldiers; UINT8 bDesiredDirection=0; ubTotalSoldiers = ubNumGreen + ubNumReg + ubNumElites; @@ -3073,7 +3073,7 @@ void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNu } UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 ); } - else if( ubNumReg && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumReg) ) + else if( ubNumReg && (UINT16)Random( ubTotalSoldiers ) < (ubNumElites + ubNumReg) ) { ubNumReg--; ubTotalSoldiers--; @@ -3113,7 +3113,7 @@ void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNu } UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, 0 ); } - else if( ubNumGreen && (UINT8)Random( ubTotalSoldiers ) < (UINT8)(ubNumElites + ubNumReg + ubNumGreen) ) + else if( ubNumGreen && (UINT16)Random( ubTotalSoldiers ) < (UINT16)(ubNumElites + ubNumReg + ubNumGreen) ) { ubNumGreen--; ubTotalSoldiers--; @@ -3219,7 +3219,7 @@ void SectorAddAssassins( INT16 sMapX, INT16 sMapY, INT16 sMapZ ) return; // now count militia, and which type (green, regular, elite) is most numerous - that will be the best type to blend in - UINT8 militiacnt = MilitiaInSectorOfRank( sMapX, sMapY, GREEN_MILITIA ); + UINT16 militiacnt = MilitiaInSectorOfRank( sMapX, sMapY, GREEN_MILITIA ); UINT8 militiadisguise = GREEN_MILITIA; if ( MilitiaInSectorOfRank( sMapX, sMapY, REGULAR_MILITIA ) > militiacnt ) { @@ -3290,7 +3290,7 @@ void SectorAddPrisonersofWar( INT16 sMapX, INT16 sMapY, INT16 sMapZ ) } // we can't spawn if all civilian slots are already taken (we leave a bit of reserve for more important civs) - UINT8 maxcivs = max(0, gGameExternalOptions.ubGameMaximumNumberOfCivilians - 3); + UINT16 maxcivs = max(0, gGameExternalOptions.ubGameMaximumNumberOfCivilians - 3); for (UINT16 i = numberofpows; i < numprisoners; ++i) { diff --git a/Tactical/Soldier Init List.h b/Tactical/Soldier Init List.h index 0eb2f2ef..4774bd97 100644 --- a/Tactical/Soldier Init List.h +++ b/Tactical/Soldier Init List.h @@ -44,9 +44,9 @@ void AddSoldierInitListEnemyDefenceSoldiers( UINT16 ubTotalAdmin, UINT16 ubTotal void AddSoldierInitListCreatures( BOOLEAN fQueen, UINT16 ubNumLarvae, UINT16 ubNumInfants, UINT16 ubNumYoungMales, UINT16 ubNumYoungFemales, UINT16 ubNumAdultMales, UINT16 ubNumAdultFemales ); -void AddSoldierInitListOtherCreatures( UINT8 usNum ); +void AddSoldierInitListOtherCreatures( UINT16 usNum ); void AddSoldierInitListMilitia( UINT16 ubNumGreen, UINT16 ubNumReg, UINT16 ubNumElites ); -void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT8 ubNumGreen, UINT8 ubNumReg, UINT8 ubNumElites ); +void AddSoldierInitListMilitiaOnEdge( UINT8 ubStrategicInsertionCode, UINT16 ubNumGreen, UINT16 ubNumReg, UINT16 ubNumElites ); void AddSoldierInitListBloodcats();