More UINT8 -> UINT16 changes

This commit is contained in:
Asdow
2024-11-11 00:08:30 +02:00
parent 040410b450
commit fcf2b27d1a
21 changed files with 121 additions and 121 deletions
+4 -4
View File
@@ -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);
}
+2 -2
View File
@@ -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
#endif
+1 -1
View File
@@ -199,7 +199,7 @@ void PrepareMilitiaForTactical( BOOLEAN fPrepareAll)
{
SECTORINFO *pSector;
INT32 x;
UINT8 ubGreen, ubRegs, ubElites;
UINT16 ubGreen, ubRegs, ubElites;
if( gbWorldSectorZ > 0 )
return;
+1 -1
View File
@@ -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;
}
+15 -15
View File
@@ -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)
{
+2 -2
View File
@@ -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();