mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Merged from revision: 7561
- Fixed hardcoded sam site sectors for gubEnemyEncounterCode (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7562 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -327,6 +327,7 @@ void AddTextToTownBox( void )
|
|||||||
if ( fSamSiteFound[ x ] )
|
if ( fSamSiteFound[ x ] )
|
||||||
{
|
{
|
||||||
fSAMSiteKnown = TRUE;
|
fSAMSiteKnown = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -644,6 +645,7 @@ void AddTextToBlankSectorBox( void )
|
|||||||
if ( fSamSiteFound[ x ] )
|
if ( fSamSiteFound[ x ] )
|
||||||
{
|
{
|
||||||
fSAMSiteKnown = TRUE;
|
fSAMSiteKnown = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -751,7 +753,10 @@ void AddCommonInfoToBox(void)
|
|||||||
if ( pSamList[x] == usSectorValue )
|
if ( pSamList[x] == usSectorValue )
|
||||||
{
|
{
|
||||||
if ( fSamSiteFound[ x ] )
|
if ( fSamSiteFound[ x ] )
|
||||||
|
{
|
||||||
fKnownSite = TRUE;
|
fKnownSite = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -383,6 +383,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
gubPBSectorZ = 0;
|
gubPBSectorZ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pSector = &SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ];
|
||||||
|
|
||||||
if( !gfPersistantPBI )
|
if( !gfPersistantPBI )
|
||||||
{ //calculate the non-persistant situation
|
{ //calculate the non-persistant situation
|
||||||
@@ -398,7 +399,6 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
}
|
}
|
||||||
else if( gbWorldSectorZ > 0 )
|
else if( gbWorldSectorZ > 0 )
|
||||||
{ //We are underground, so no autoresolve allowed
|
{ //We are underground, so no autoresolve allowed
|
||||||
pSector = &SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ];
|
|
||||||
if( pSector->ubCreaturesInBattle )
|
if( pSector->ubCreaturesInBattle )
|
||||||
{
|
{
|
||||||
gubExplicitEnemyEncounterCode = FIGHTING_CREATURES_CODE;
|
gubExplicitEnemyEncounterCode = FIGHTING_CREATURES_CODE;
|
||||||
@@ -627,7 +627,6 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
// Basic chance - progress level/2 minus highest merc exp level*2, and 10% on top
|
// Basic chance - progress level/2 minus highest merc exp level*2, and 10% on top
|
||||||
iChance = (UINT8)( ((CurrentPlayerProgressPercentage() / 2 ) - bBestExpLevel*2 ) + 15 );
|
iChance = (UINT8)( ((CurrentPlayerProgressPercentage() / 2 ) - bBestExpLevel*2 ) + 15 );
|
||||||
|
|
||||||
pSector = &SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ];
|
|
||||||
if( pSector->uiFlags & SF_ENEMY_AMBUSH_LOCATION )
|
if( pSector->uiFlags & SF_ENEMY_AMBUSH_LOCATION )
|
||||||
iChance += 20;
|
iChance += 20;
|
||||||
|
|
||||||
@@ -695,24 +694,12 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
else
|
else
|
||||||
{ //Are enemies invading a town, or just encountered the player.
|
{ //Are enemies invading a town, or just encountered the player.
|
||||||
if( GetTownIdForSector( gubPBSectorX, gubPBSectorY ) )
|
if( GetTownIdForSector( gubPBSectorX, gubPBSectorY ) )
|
||||||
{
|
|
||||||
gubEnemyEncounterCode = ENEMY_INVASION_CODE;
|
gubEnemyEncounterCode = ENEMY_INVASION_CODE;
|
||||||
}
|
//SAM sites not in towns will also be considered to be important
|
||||||
|
else if( pSector->uiFlags & SF_SAM_SITE )
|
||||||
|
gubEnemyEncounterCode = ENEMY_INVASION_CODE;
|
||||||
else
|
else
|
||||||
{
|
gubEnemyEncounterCode = ENEMY_ENCOUNTER_CODE;
|
||||||
switch( SECTOR( gubPBSectorX, gubPBSectorY ) )
|
|
||||||
{
|
|
||||||
case SEC_D2:
|
|
||||||
case SEC_D15:
|
|
||||||
case SEC_G8:
|
|
||||||
//SAM sites not in towns will also be considered to be important
|
|
||||||
gubEnemyEncounterCode = ENEMY_INVASION_CODE;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
gubEnemyEncounterCode = ENEMY_ENCOUNTER_CODE;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -771,7 +758,6 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
|
|||||||
if( gubEnemyEncounterCode == ENEMY_ENCOUNTER_CODE )
|
if( gubEnemyEncounterCode == ENEMY_ENCOUNTER_CODE )
|
||||||
{ //we know how many enemies are here, so until we leave the sector, we will continue to display the value.
|
{ //we know how many enemies are here, so until we leave the sector, we will continue to display the value.
|
||||||
//the flag will get cleared when time advances after the fEnemyInSector flag is clear.
|
//the flag will get cleared when time advances after the fEnemyInSector flag is clear.
|
||||||
pSector = &SectorInfo[ SECTOR( gubPBSectorX, gubPBSectorY ) ];
|
|
||||||
|
|
||||||
// ALWAYS use these 2 statements together, without setting the boolean, the flag will never be cleaned up!
|
// ALWAYS use these 2 statements together, without setting the boolean, the flag will never be cleaned up!
|
||||||
pSector->uiFlags |= SF_PLAYER_KNOWS_ENEMIES_ARE_HERE;
|
pSector->uiFlags |= SF_PLAYER_KNOWS_ENEMIES_ARE_HERE;
|
||||||
|
|||||||
@@ -3660,6 +3660,7 @@ void GetSectorIDString( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ , STR16 zS
|
|||||||
if ( fSamSiteFound[ x ] )
|
if ( fSamSiteFound[ x ] )
|
||||||
{
|
{
|
||||||
fSAMSiteKnown = TRUE;
|
fSAMSiteKnown = TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user