From 0875a76687c4e0e1345ab5e3842121cc1fa9437f Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 1 Mar 2015 00:42:20 +0000 Subject: [PATCH] If the player has no prison and thus has to let his prisoners go, some might volunteer. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7763 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Overhead.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 1d445dab..8a1eacec 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -6709,7 +6709,7 @@ BOOLEAN GetPlayerControlledPrisonList( std::vector& arSectorIDVector ) } } - return ( arSectorIDVector.size() > 0 ); + return ( !arSectorIDVector.empty() ); } extern INT32 giReinforcementPool; @@ -6934,6 +6934,23 @@ void RemoveCapturedEnemiesFromSectorInfo( INT16 sMapX, INT16 sMapY, INT8 bMapZ ) DoMessageBox( MSG_BOX_BASIC_MEDIUM_BUTTONS, TacticalStr[ PRISONER_DECIDE_STR ], GAME_SCREEN, MSG_BOX_FLAG_GENERIC_EIGHT_BUTTONS, PrisonerMessageBoxCallBack, NULL ); } + // if we control no prison, we have to let them go... + else + { + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[PRISONER_NO_PRISONS_STR] ); + + // some prisoners volunteer to work for us + UINT16 volunteers = Random( ubNumPrisoners / 3 ); + + if ( volunteers ) + { + AddVolunteers( volunteers ); + + // we add the volunteers anyway, but only show the message if this feature is on + if ( gGameExternalOptions.fMilitiaVolunteerPool ) + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_TURN_VOLUNTEER], volunteers ); + } + } } }