- Equip Milita Improvements: I've written code, which adds attachments to free positions on the gun militia chose to pick up (by navaroe)

- Bugfix: Reinforcements:  Parts of roadblocks were resurrected after reinforcements death (by navaroe)

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7995 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2015-10-15 10:40:58 +00:00
parent fbd5cc001f
commit 91eef3098c
6 changed files with 135 additions and 47 deletions
+3 -3
View File
@@ -36,7 +36,7 @@ UINT32 guiMilitiaReinforceTurn = 0, guiMilitiaArrived = 0;//dnl ch68 090913
void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT8 *pubNumAdmins, UINT8 *pubNumTroops, UINT8 *pubNumElites, UINT8 *pubNumTanks )
{
UINT8 ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks;
UINT16 pusMoveDir[4][3];
UINT16 pusMoveDir[4][3]; //first column in this matrix is number of sector, except for 4th row
UINT8 ubDirNumber, ubIndex;
GetNumberOfStationaryEnemiesInSector( sSectorX, sSectorY, pubNumAdmins, pubNumTroops, pubNumElites, pubNumTanks );
@@ -57,10 +57,10 @@ void GetNumberOfEnemiesInFiveSectors( INT16 sSectorX, INT16 sSectorY, UINT8 *pub
GenerateDirectionInfos( sSectorX, sSectorY, &ubDirNumber, pusMoveDir, FALSE, TRUE );
for( ubIndex = 0; ubIndex < ubDirNumber; ubIndex++ )
{
{ //take number of the involved sector, find its X and Y coordintes and then ask for number of troops there
GetNumberOfStationaryEnemiesInSector( SECTORX( pusMoveDir[ ubIndex ][ 0 ] ), SECTORY( pusMoveDir[ ubIndex ][ 0 ] ), &ubNumAdmins, &ubNumTroops, &ubNumElites, &ubNumTanks );
while( ubNumElites + ubNumTroops + ubNumAdmins + ubNumTanks > gubReinforcementMinEnemyStaticGroupSize)
while( ubNumElites + ubNumTroops + ubNumAdmins + ubNumTanks > gubReinforcementMinEnemyStaticGroupSize) //count how many of static group will reinforce the battle, but leave minimal group size to guard
{
if( ubNumElites )
{