Merged from revision: 7287

Fixes (by Buggler)
- Disabled calling reinforcements from patrol groups when queen wakes up as they will not be replenished (thanks anv)
- Fixed queen reinforcement pool being replenished on depletion when playing with limited enemy troops setting
- Alternative hotkey ~ (tilde) to toggle merc inventory in strategic screen like in tactical screen

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7288 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-06-23 17:46:10 +00:00
parent 9419e1b8b9
commit ff34f538d9
3 changed files with 32 additions and 21 deletions
+24 -15
View File
@@ -2932,12 +2932,13 @@ void SendReinforcementsForGarrison( INT32 iDstGarrisonID, UINT16 usDefencePoints
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
ValidateWeights( 8 );
if( gGarrisonGroup[ iDstGarrisonID ].ubSectorID == SEC_B13 ||
/*if( gGarrisonGroup[ iDstGarrisonID ].ubSectorID == SEC_B13 ||
gGarrisonGroup[ iDstGarrisonID ].ubSectorID == SEC_C13 ||
gGarrisonGroup[ iDstGarrisonID ].ubSectorID == SEC_D13 )
{
pSector = NULL;
}
}*/
pSector = &SectorInfo[ gGarrisonGroup[ iDstGarrisonID ].ubSectorID ];
//Determine how many units the garrison needs.
iReinforcementsRequested = GarrisonReinforcementsRequested( iDstGarrisonID, &ubNumExtraReinforcements );
@@ -3312,6 +3313,7 @@ void EvaluateQueenSituation()
break;
}
/* // Buggler: Unlimited troops setting will have a constant pool value, limited troops setting should not be able to recruit new troops
if( !giReinforcementPool )
{ //Queen has run out of reinforcements. Simulate recruiting and training new troops
uiOffset *= 10;
@@ -3319,7 +3321,7 @@ void EvaluateQueenSituation()
giReinforcementPool += ( gGameExternalOptions.guiBaseQueenPoolIncrement * gGameOptions.ubDifficultyLevel ) * ( 100 + CurrentPlayerProgressPercentage() ) / 100 ;
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, GetWorldTotalMin() + uiOffset, 0 );
return;
}
}*/
//Re-post the event
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, GetWorldTotalMin() + uiOffset, 0 );
@@ -5628,7 +5630,7 @@ void RequestHighPriorityGarrisonReinforcements( INT32 iGarrisonID, UINT8 ubSoldi
ubBestDist = 255;
iBestIndex = -1;
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
Ensure_RepairedGarrisonGroup( &gGarrisonGroup, &giGarrisonArraySize ); /* added NULL fix, 2007-03-03, Sgt. Kolja */
for( i = 0; i < giPatrolArraySize; i++ )
{
@@ -5648,6 +5650,8 @@ void RequestHighPriorityGarrisonReinforcements( INT32 iGarrisonID, UINT8 ubSoldi
}
ubDstSectorX = (UINT8)SECTORX( gGarrisonGroup[ iGarrisonID ].ubSectorID );
ubDstSectorY = (UINT8)SECTORY( gGarrisonGroup[ iGarrisonID ].ubSectorID );
/* // Comment code calling reinforcements from patrol groups as they will not be replenished subsequently
if( iBestIndex != -1 )
{ //Send the group to the garrison
pGroup = GetGroup( gPatrolGroup[ iBestIndex ].ubGroupID );
@@ -5734,19 +5738,24 @@ void RequestHighPriorityGarrisonReinforcements( INT32 iGarrisonID, UINT8 ubSoldi
}
}
else
{ //There are no groups that have enough troops. Send a new force from the palace instead.
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ), 0, ubSoldiersRequested, 0, 0 );
pGroup->ubMoveType = ONE_WAY;
pGroup->pEnemyGroup->ubIntention = REINFORCEMENTS;
gGarrisonGroup[ iGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
pGroup->ubOriginalSector = (UINT8)SECTOR( ubDstSectorX, ubDstSectorY );
*/
{ //There are no groups that have enough troops. Send a new force from the palace instead.
if ( giReinforcementPool > 0 )
{
pGroup = CreateNewEnemyGroupDepartingFromSector( SECTOR( gModSettings.ubSAISpawnSectorX, gModSettings.ubSAISpawnSectorY ),
0, min( ubSoldiersRequested, giReinforcementPool ), 0 );
pGroup->ubMoveType = ONE_WAY;
pGroup->pEnemyGroup->ubIntention = REINFORCEMENTS;
gGarrisonGroup[ iGarrisonID ].ubPendingGroupID = pGroup->ubGroupID;
pGroup->ubOriginalSector = (UINT8)SECTOR( ubDstSectorX, ubDstSectorY );
//Madd: unlimited reinforcements?
if ( !gfUnlimitedTroops )
giReinforcementPool -= (INT32)ubSoldiersRequested;
//Madd: unlimited reinforcements?
if ( !gfUnlimitedTroops )
giReinforcementPool -= (INT32)min( ubSoldiersRequested, giReinforcementPool );
MoveSAIGroupToSector( &pGroup, gGarrisonGroup[ iGarrisonID ].ubSectorID, EVASIVE, REINFORCEMENTS );
ValidateGroup( pGroup );
MoveSAIGroupToSector( &pGroup, gGarrisonGroup[ iGarrisonID ].ubSectorID, EVASIVE, REINFORCEMENTS );
ValidateGroup( pGroup );
}
}
}
+6 -6
View File
@@ -7202,8 +7202,11 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
break;
case '`':
if (fAlt)
{
}
#ifdef JA2TESTVERSION
if( fCtrl )
else if( fCtrl )
{
if( bSelectedInfoChar != -1 )
{
@@ -7211,11 +7214,8 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
}
}
#endif
if (fAlt)
{
break;
}
else
RequestToggleMercInventoryPanel();
break;
case '\\':
+2
View File
@@ -786,6 +786,8 @@ void ToggleTacticalPanels( )
else
{
gbNewPanel = SM_PANEL;
// silversurfer: This needs to be reset to TRUE because inventory view only allows radar screen to be displayed and not the squad list.
fRenderRadarScreen = TRUE;
}
}