Bugfix for JaggZilla Bug #635

- NPCs that turn neutral cannot end a battle for an entire sector anymore if there is other enemies around.
- Enemies that bled to death won't stop the code anymore to grant us victory.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6476 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-10-09 19:32:19 +00:00
parent fa56d63ce4
commit e59e951e31
2 changed files with 11 additions and 3 deletions
+9 -2
View File
@@ -186,6 +186,7 @@ BOOLEAN InternalInitiateConversation( SOLDIERTYPE *pDestSoldier, SOLDIERTYPE *pS
extern void EndGameMessageBoxCallBack( UINT8 ubExitValue ); extern void EndGameMessageBoxCallBack( UINT8 ubExitValue );
extern INT32 FindNearestOpenableNonDoor( INT32 sStartGridNo ); extern INT32 FindNearestOpenableNonDoor( INT32 sStartGridNo );
extern void RecalculateOppCntsDueToBecomingNeutral( SOLDIERTYPE * pSoldier ); extern void RecalculateOppCntsDueToBecomingNeutral( SOLDIERTYPE * pSoldier );
extern UINT8 NumCapableEnemyInSector( );
#ifdef JA2UB #ifdef JA2UB
//JA25 UB //JA25 UB
@@ -3016,7 +3017,10 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
break; break;
case NPC_ACTION_END_COMBAT: case NPC_ACTION_END_COMBAT:
ExitCombatMode(); // silversurfer: Bugfix for JaggZilla Bug #635
// We can't end combat just because this one guy is now not hostile anymore. What about the rest of the sector?
if ( NumCapableEnemyInSector() == 0 )
ExitCombatMode();
break; break;
case NPC_ACTION_BECOME_FRIENDLY_END_COMBAT: case NPC_ACTION_BECOME_FRIENDLY_END_COMBAT:
@@ -3029,7 +3033,10 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
RecalculateOppCntsDueToBecomingNeutral( pSoldier ); RecalculateOppCntsDueToBecomingNeutral( pSoldier );
if ( gTacticalStatus.bNumFoughtInBattle[ CIV_TEAM ] == 0 ) if ( gTacticalStatus.bNumFoughtInBattle[ CIV_TEAM ] == 0 )
{ {
gTacticalStatus.fEnemyInSector = FALSE; // silversurfer: Bugfix for JaggZilla Bug #635
// Function CheckForEndOfBattle() will set this IF the sector is really free of enemies.
//gTacticalStatus.fEnemyInSector = FALSE;
CheckForEndOfBattle( FALSE );
} }
if ( !gTacticalStatus.fEnemyInSector ) if ( !gTacticalStatus.fEnemyInSector )
{ {
+2 -1
View File
@@ -6995,7 +6995,8 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
// OK, KILL any enemies that are incompacitated // OK, KILL any enemies that are incompacitated
if ( KillIncompacitatedEnemyInSector( ) ) if ( KillIncompacitatedEnemyInSector( ) )
{ {
return( FALSE ); // silversurfer: Why this? The rest of our enemies just bled to death so go on with the code!
//return( FALSE );
} }
} }