Massive effort to reign in militia problem. Still has issues :(

Fix:  If only some of mercs go to a lower level (mine, basement, etc) but do not choose to "GO TO SECTOR", sector is still inaccessible from strategic map.  However, watch for triggers that might happen on first visit to a sector, that fail.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1076 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Overhaul
2007-07-19 08:33:17 +00:00
parent e2fa801e2b
commit 9d71fc89f0
16 changed files with 2017 additions and 1904 deletions
+9 -5
View File
@@ -5046,9 +5046,6 @@ void DisplayLevelString( void )
// function to manipulate the number of towns people on the cursor
BOOLEAN PickUpATownPersonFromSector( UINT8 ubType, INT16 sX, INT16 sY )
{
// see if there are any militia of this type in this sector
if( !SectorInfo[ SECTOR( sX, sY ) ].ubNumberOfCivsAtLevel[ ubType ] )
{
@@ -5067,7 +5064,7 @@ BOOLEAN PickUpATownPersonFromSector( UINT8 ubType, INT16 sX, INT16 sY )
return( FALSE );
}
if( SECTOR( sX, sY ) == SECTOR( gWorldSectorX, gWorldSectorY ) )
if( sX == gWorldSectorX && sY == gWorldSectorY )
{
gfStrategicMilitiaChangesMade = TRUE;
}
@@ -5115,11 +5112,12 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen2");
return( FALSE );
}
if( SECTOR( sX, sY ) == SECTOR( gWorldSectorX, gWorldSectorY ) )
if( sX == gWorldSectorX && sY == gWorldSectorY )
{
gfStrategicMilitiaChangesMade = TRUE;
}
// drop the guy into this sector
switch( ubType )
{
@@ -6119,6 +6117,12 @@ void MilitiaDoneButtonCallback(GUI_BUTTON *btn,INT32 reason)
// reset fact we are in the box
sSelectedMilitiaTown = 0;
fMapPanelDirty = TRUE;
// Go ahead and reset the militia in the selected sector (even if we didn't change it here)
if (gfStrategicMilitiaChangesMade)
{
ResetMilitia();
}
}
}