mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Fix from Heinz:
1) Fixed error creating new soldiers in DoReinforcementAsPendingEnemy 2) Fixed some bugs in Shopkeeper interface. 3) Fixed CTD when pressing Alt-Y not in cheat mode 4) Save/load screen shouldn't appear during quickload git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2612 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1600,7 +1600,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
{
|
||||
ubNumElites--;
|
||||
ubTotalSoldiers--;
|
||||
pSoldier = TacticalCreateEliteEnemy();
|
||||
Assert(pSoldier = TacticalCreateEliteEnemy());
|
||||
if( pGroup )
|
||||
{
|
||||
pSoldier->ubGroupID = pGroup->ubGroupID;
|
||||
@@ -1623,7 +1623,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
{
|
||||
ubNumTroops--;
|
||||
ubTotalSoldiers--;
|
||||
pSoldier = TacticalCreateArmyTroop();
|
||||
Assert(pSoldier = TacticalCreateArmyTroop());
|
||||
if( pGroup )
|
||||
{
|
||||
pSoldier->ubGroupID = pGroup->ubGroupID;
|
||||
@@ -1646,7 +1646,7 @@ void AddEnemiesToBattle( GROUP *pGroup, UINT8 ubStrategicInsertionCode, UINT8 ub
|
||||
{
|
||||
ubNumAdmins--;
|
||||
ubTotalSoldiers--;
|
||||
pSoldier = TacticalCreateAdministrator();
|
||||
Assert(pSoldier = TacticalCreateAdministrator());
|
||||
if( pGroup )
|
||||
{
|
||||
pSoldier->ubGroupID = pGroup->ubGroupID;
|
||||
@@ -2184,4 +2184,21 @@ BOOLEAN OnlyHostileCivsInSector()
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOLEAN CheckPendingEnemies()
|
||||
{
|
||||
if( gbWorldSectorZ ) return FALSE;
|
||||
SECTORINFO *pSector = &SectorInfo[ SECTOR( gWorldSectorX, gWorldSectorY ) ];
|
||||
if( (pSector->ubNumElites + pSector->ubNumTroops + pSector->ubNumAdmins) > ( pSector->ubElitesInBattle + pSector->ubTroopsInBattle + pSector->ubAdminsInBattle) )
|
||||
return TRUE;
|
||||
for (GROUP *pGroup = gpGroupList; pGroup; pGroup = pGroup->next)
|
||||
{
|
||||
if( !pGroup->fPlayer
|
||||
&& !pGroup->fVehicle
|
||||
&& pGroup->ubSectorX == gWorldSectorX
|
||||
&& pGroup->ubSectorY == gWorldSectorY
|
||||
&& pGroup->ubGroupSize > pGroup->pEnemyGroup->ubElitesInBattle + pGroup->pEnemyGroup->ubTroopsInBattle + pGroup->pEnemyGroup->ubAdminsInBattle)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user