From fcc2fc6f73126e52c44efb327d07c5bb2ee58238 Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 6 May 2014 22:06:02 +0000 Subject: [PATCH] Merged revision(s) 7195 from branches/ja2_source_official_2014: Show prison capacity in sector info box. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7196 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- .../Map Screen Interface TownMine Info.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Strategic/Map Screen Interface TownMine Info.cpp b/Strategic/Map Screen Interface TownMine Info.cpp index 20acbc83..895884f4 100644 --- a/Strategic/Map Screen Interface TownMine Info.cpp +++ b/Strategic/Map Screen Interface TownMine Info.cpp @@ -438,10 +438,26 @@ void AddTextToTownBox( void ) UINT16 numprisoners = GetNumberOfPrisoners( &(SectorInfo[SECTOR( bCurrentTownMineSectorX, bCurrentTownMineSectorY )]), &prisoners[PRISONER_OFFICER], &prisoners[PRISONER_ELITE], &prisoners[PRISONER_REGULAR], &prisoners[PRISONER_ADMIN] ); if ( numprisoners ) { + // determine prison capacity + UINT16 capacity = 0; + for ( UINT16 cnt = 0; cnt < NUM_FACILITY_TYPES; ++cnt ) + { + // Is this facility here? + if ( gFacilityLocations[SECTOR( bCurrentTownMineSectorX, bCurrentTownMineSectorY )][cnt].fFacilityHere ) + { + // we determine wether this is a prison by checking for usPrisonBaseLimit + if ( gFacilityTypes[cnt].AssignmentData[FAC_INTERROGATE_PRISONERS].usPrisonBaseLimit > 0 ) + { + capacity = gFacilityTypes[cnt].AssignmentData[FAC_INTERROGATE_PRISONERS].usPrisonBaseLimit; + break; + } + } + } + // prisoners swprintf( wString, L"%s:", pwTownInfoStrings[13] ); AddMonoString( &hStringHandle, wString ); - swprintf( wString, L"%d/%d/%d/%d%", prisoners[PRISONER_ADMIN], prisoners[PRISONER_REGULAR], prisoners[PRISONER_ELITE], prisoners[PRISONER_OFFICER] ); + swprintf( wString, L"%d/%d/%d/%d%/%d", prisoners[PRISONER_ADMIN], prisoners[PRISONER_REGULAR], prisoners[PRISONER_ELITE], prisoners[PRISONER_OFFICER], capacity ); AddSecondColumnMonoString( &hStringHandle, wString ); } }