mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
MERGED source code from development trunk (revision: 4658)
- Bugfix: Militia do not stop enemy invasion on strategic map (fix by tazpn) o see here: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290508#Post290508 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4659 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -349,27 +349,30 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
|
||||
gfDisplayPotentialRetreatPaths = FALSE;
|
||||
|
||||
gpBattleGroup = pBattleGroup;
|
||||
|
||||
//calc sector values
|
||||
if( gpBattleGroup )
|
||||
{
|
||||
gubPBSectorX = gpBattleGroup->ubSectorX;
|
||||
gubPBSectorY = gpBattleGroup->ubSectorY;
|
||||
gubPBSectorZ = gpBattleGroup->ubSectorZ;
|
||||
|
||||
// get number of enemies thought to be here
|
||||
SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ].bLastKnownEnemies = NumEnemiesInSector( gubPBSectorX, gubPBSectorY );
|
||||
fMapPanelDirty = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
gubPBSectorX = (UINT8)SECTORX( gubSectorIDOfCreatureAttack );
|
||||
gubPBSectorY = (UINT8)SECTORY( gubSectorIDOfCreatureAttack );
|
||||
gubPBSectorZ = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
gpBattleGroup = pBattleGroup;
|
||||
|
||||
//calc sector values
|
||||
if( gpBattleGroup )
|
||||
{
|
||||
gubPBSectorX = gpBattleGroup->ubSectorX;
|
||||
gubPBSectorY = gpBattleGroup->ubSectorY;
|
||||
gubPBSectorZ = gpBattleGroup->ubSectorZ;
|
||||
|
||||
// get number of enemies thought to be here
|
||||
SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ].bLastKnownEnemies = NumEnemiesInSector( gubPBSectorX, gubPBSectorY );
|
||||
fMapPanelDirty = TRUE;
|
||||
}
|
||||
else if( gfPersistantPBI )
|
||||
{
|
||||
gubPBSectorX = (UINT8)SECTORX( gubSectorIDOfCreatureAttack );
|
||||
gubPBSectorY = (UINT8)SECTORY( gubSectorIDOfCreatureAttack );
|
||||
gubPBSectorZ = 0;
|
||||
}
|
||||
|
||||
|
||||
if( !gfPersistantPBI )
|
||||
{ //calculate the non-persistant situation
|
||||
gfBlinkHeader = TRUE;
|
||||
|
||||
@@ -381,7 +384,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
{ //There are bloodcats in the sector, so no autoresolve allowed
|
||||
gubExplicitEnemyEncounterCode = HOSTILE_BLOODCATS_CODE;
|
||||
}
|
||||
else if( gbWorldSectorZ )
|
||||
else if( gbWorldSectorZ > 0 )
|
||||
{ //We are underground, so no autoresolve allowed
|
||||
pSector = &SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ];
|
||||
if( pSector->ubCreaturesInBattle )
|
||||
@@ -393,6 +396,10 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
||||
gubExplicitEnemyEncounterCode = ENTERING_ENEMY_SECTOR_CODE;
|
||||
}
|
||||
}
|
||||
else if (pBattleGroup && !pBattleGroup->fPlayer && CountAllMilitiaInSector( pBattleGroup->ubSectorX, pBattleGroup->ubSectorY ) > 0)
|
||||
{
|
||||
gubEnemyEncounterCode = ENEMY_ENCOUNTER_CODE;
|
||||
}
|
||||
else if( gubEnemyEncounterCode == ENTERING_ENEMY_SECTOR_CODE ||
|
||||
gubEnemyEncounterCode == ENEMY_ENCOUNTER_CODE ||
|
||||
gubEnemyEncounterCode == ENEMY_AMBUSH_CODE ||
|
||||
@@ -1772,7 +1779,7 @@ void CalculateNonPersistantPBIInfo()
|
||||
{ //There are bloodcats in the sector, so no autoresolve allowed
|
||||
gubExplicitEnemyEncounterCode = HOSTILE_BLOODCATS_CODE;
|
||||
}
|
||||
else if( gbWorldSectorZ )
|
||||
else if( gbWorldSectorZ > 0 )
|
||||
{
|
||||
UNDERGROUND_SECTORINFO *pSector = FindUnderGroundSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
Assert( pSector );
|
||||
|
||||
Reference in New Issue
Block a user