New Feature: Militia Volunteer Pool limits the number of militia we can train. Turned off by default.

GameDir >= r2210 is recommended.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7746 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2015-02-22 18:52:41 +00:00
parent caf482614a
commit c7c085b04f
17 changed files with 165 additions and 6 deletions
+14
View File
@@ -1412,6 +1412,10 @@ BOOLEAN CanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
{
AssertNotNIL(pSoldier);
// Flugente: militia volunteer pool
if ( !GetVolunteerPool() )
return FALSE;
// Make sure the basic sector/merc variables are still applicable. This is simply a fail-safe.
if( !BasicCanCharacterTrainMilitia( pSoldier ) )
{
@@ -2480,6 +2484,9 @@ void UpdateAssignments()
// reset scan flags in all sectors
ClearSectorScanResults();
// update militia volunteer count
UpdateVolunteers();
// run through sectors and handle each type in sector
for(sX = 0 ; sX < MAP_WORLD_X; ++sX )
{
@@ -18375,6 +18382,13 @@ BOOLEAN CanCharacterTrainMilitiaWithErrorReport( SOLDIERTYPE *pSoldier )
return( FALSE );
}
if ( !GetVolunteerPool() )
{
swprintf( sString, L"There are no volunteers for militia left!" );
DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL );
return (FALSE);
}
if ( 100 <= GetMobileMilitiaQuota( TRUE ) )
return ( FALSE );