Merged revision(s) 7052 from branches/ja2_source_official_2014:

- Fix: Assertion if groupsize exceeds garrison size
- Fix: mobile militia never decides to move

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7053 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2014-03-11 22:48:13 +00:00
parent d83ae2a4c8
commit f6ffee0583
2 changed files with 57 additions and 54 deletions
+4 -1
View File
@@ -1583,6 +1583,9 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Roll %ld", iRandomRes); //ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Roll %ld", iRandomRes);
// Flugente: as I once broke this, allow me to explain this part. We've determined the 'urge' to move to an adjacent sector.
// We now see wether an adjacent sector is a worthy target to move to. If we do not find a vali target, we stop the movement function
iRandomRes = 256; iRandomRes = 256;
for( x = 0; x < uiDirNumber; ++x) for( x = 0; x < uiDirNumber; ++x)
@@ -1592,6 +1595,7 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
iRandomRes = x; iRandomRes = x;
break; break;
} }
}
// "Decided" to stay here // "Decided" to stay here
if(iRandomRes >= uiDirNumber) if(iRandomRes >= uiDirNumber)
@@ -1658,7 +1662,6 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
} }
} }
} }
}
// Kaiden: Roaming Militia Training: // Kaiden: Roaming Militia Training:
// If we're training roaming militia, // If we're training roaming militia,
+1 -1
View File
@@ -3062,7 +3062,7 @@ void SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoints
//Send the lowest of the two: number requested or number available //Send the lowest of the two: number requested or number available
iReinforcementsApproved = min( iReinforcementsRequested, iReinforcementsAvailable ); iReinforcementsApproved = min( iReinforcementsRequested, iReinforcementsAvailable );
if( iReinforcementsApproved < iMaxReinforcementsAllowed - ubNumExtraReinforcements ) if( iReinforcementsApproved > iMaxReinforcementsAllowed - ubNumExtraReinforcements )
{ {
//The force isn't strong enough, but the queen isn't willing to apply extra resources //The force isn't strong enough, but the queen isn't willing to apply extra resources
iReinforcementsApproved = iMaxReinforcementsAllowed - ubNumExtraReinforcements; iReinforcementsApproved = iMaxReinforcementsAllowed - ubNumExtraReinforcements;