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:
@@ -247,7 +247,7 @@ UINT8 DoReinforcementAsPendingEnemy( INT16 sMapX, INT16 sMapY )
|
||||
GROUP *pGroup;
|
||||
//ENEMYGROUP *pEnemyGroup;
|
||||
SECTORINFO *pThisSector, *pSector;
|
||||
|
||||
|
||||
if( !gGameExternalOptions.gfAllowReinforcements )
|
||||
return 255;
|
||||
|
||||
@@ -274,7 +274,7 @@ UINT8 DoReinforcementAsPendingEnemy( INT16 sMapX, INT16 sMapY )
|
||||
}
|
||||
}
|
||||
|
||||
while( ubDirNumber > 0)
|
||||
while( ubDirNumber > 0 )
|
||||
{
|
||||
ubIndex = Random(ubDirNumber);
|
||||
|
||||
@@ -286,26 +286,22 @@ UINT8 DoReinforcementAsPendingEnemy( INT16 sMapX, INT16 sMapY )
|
||||
{
|
||||
(pThisSector->ubNumElites)++;
|
||||
(pSector->ubNumElites)--;
|
||||
(pThisSector->ubElitesInBattle)++;
|
||||
AddEnemiesToBattle( NULL, (UINT8)pusMoveDir[ ubIndex ][ 2 ], 0, 0, 1, FALSE );
|
||||
}else if( pSector->ubNumTroops )
|
||||
{
|
||||
(pThisSector->ubNumTroops)++;
|
||||
(pSector->ubNumTroops)--;
|
||||
(pThisSector->ubTroopsInBattle)++;
|
||||
AddEnemiesToBattle( NULL, (UINT8)pusMoveDir[ ubIndex ][ 2 ], 0, 1, 0, FALSE );
|
||||
}else if( pSector->ubNumAdmins )
|
||||
{
|
||||
(pThisSector->ubNumAdmins)++;
|
||||
(pSector->ubNumAdmins)--;
|
||||
(pThisSector->ubAdminsInBattle)++;
|
||||
AddEnemiesToBattle( NULL, (UINT8)pusMoveDir[ ubIndex ][ 2 ], 1, 0, 0, FALSE );
|
||||
}
|
||||
|
||||
AddEnemiesToBattle( NULL, (UINT8)pusMoveDir[ ubIndex ][ 2 ],
|
||||
pThisSector->ubNumAdmins - pThisSector->ubAdminsInBattle,
|
||||
pThisSector->ubNumTroops - pThisSector->ubTroopsInBattle,
|
||||
pThisSector->ubNumElites - pThisSector->ubElitesInBattle,
|
||||
FALSE );
|
||||
|
||||
pThisSector->ubAdminsInBattle = pThisSector->ubNumAdmins;
|
||||
pThisSector->ubTroopsInBattle = pThisSector->ubNumTroops;
|
||||
pThisSector->ubElitesInBattle = pThisSector->ubNumElites;
|
||||
|
||||
return (UINT8)pusMoveDir[ ubIndex ][ 2 ];
|
||||
}
|
||||
else
|
||||
@@ -458,3 +454,4 @@ void AddPossiblePendingMilitiaToBattle()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user