fix (by Sevenfm): some functions ignored the last member of a team

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8629 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2018-10-16 11:59:54 +00:00
parent 0447130826
commit 54d5bb0317
12 changed files with 22 additions and 22 deletions
+6 -6
View File
@@ -1148,7 +1148,7 @@ BOOLEAN IsAnythingAroundForSoldierToClean( SOLDIERTYPE * pSoldier )
}
// now the other merc's stuff
for(UINT8 teamIndex = gTacticalStatus.Team[gbPlayerNum].bFirstID; teamIndex < gTacticalStatus.Team[gbPlayerNum].bLastID; ++teamIndex)
for(UINT8 teamIndex = gTacticalStatus.Team[gbPlayerNum].bFirstID; teamIndex <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++teamIndex)
{
// Ignore self, mercs in other sectors, etc.
if (CanCharacterRepairAnotherSoldiersStuff(pSoldier, MercPtrs[teamIndex]))
@@ -1263,7 +1263,7 @@ BOOLEAN DoesCharacterHaveAnyItemsToRepair( SOLDIERTYPE *pSoldier, INT8 bHighestP
if ( bHighestPass != - 1 )
{
// now look for items to repair on other mercs
for( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop < gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
for( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
{
SOLDIERTYPE* pOtherSoldier = MercPtrs[ bLoop ];
@@ -5307,7 +5307,7 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier )
// first our own stuff
CollectCleanableItems(pSoldier, pSoldier, itemsToClean);
// then other mercs' stuff
for(UINT8 teamIndex = gTacticalStatus.Team[gbPlayerNum].bFirstID; teamIndex < gTacticalStatus.Team[gbPlayerNum].bLastID; ++teamIndex)
for(UINT8 teamIndex = gTacticalStatus.Team[gbPlayerNum].bFirstID; teamIndex <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++teamIndex)
{
// Ignore self, mercs in other sectors, etc.
if (CanCharacterRepairAnotherSoldiersStuff(pSoldier, MercPtrs[teamIndex]))
@@ -5352,7 +5352,7 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier )
// silversurfer: Looks strange? It's not. This function now needs the guy that does the repairs and the one that owns the stuff.
CollectRepairableItems(pSoldier, pSoldier, itemsToFix);
for(UINT8 teamIndex = gTacticalStatus.Team[gbPlayerNum].bFirstID; teamIndex < gTacticalStatus.Team[gbPlayerNum].bLastID; ++teamIndex)
for(UINT8 teamIndex = gTacticalStatus.Team[gbPlayerNum].bFirstID; teamIndex <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++teamIndex)
{
// Ignore self, mercs in other sectors, etc.
if (CanCharacterRepairAnotherSoldiersStuff(pSoldier, MercPtrs[teamIndex]))
@@ -18708,7 +18708,7 @@ void RepairItemsOnOthers( SOLDIERTYPE *pSoldier, UINT8 *pubRepairPtsLeft )
fSomethingWasRepairedThisPass = FALSE;
// look for jammed guns on other soldiers in sector and unjam them
for( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop < gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
for( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
{
pOtherSoldier = MercPtrs[ bLoop ];
@@ -18728,7 +18728,7 @@ void RepairItemsOnOthers( SOLDIERTYPE *pSoldier, UINT8 *pubRepairPtsLeft )
pBestOtherSoldier = NULL;
// now look for items to repair on other mercs
for( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop < gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
for( bLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; bLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++bLoop )
{
pOtherSoldier = MercPtrs[ bLoop ];