From b20c9a9de95ccd5a408ae5b5c4ee38172f1816f7 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sun, 11 Mar 2018 12:36:27 +0000 Subject: [PATCH] Fix: If 'forced turn mode' is active, sometimes enemy groups already present in an enemy-occupied sector are interpreted as pending reinforcements, causing them to spawn at the sector edges instead of inside the sector. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8544 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Add.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tactical/Soldier Add.cpp b/Tactical/Soldier Add.cpp index b2301057f..f5fcc4155 100644 --- a/Tactical/Soldier Add.cpp +++ b/Tactical/Soldier Add.cpp @@ -1661,7 +1661,11 @@ void AddSoldierToSectorGridNo( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubDir if ( gGameSettings.fOptions[ TOPTION_TOGGLE_TURN_MODE ]) { ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_FTM_ENTER_COMBAT ] ); - if( Random( 100 ) >= Random( 100 ) ) // give a chance for either to go first + + // Flugente 2018-03-11: this part is problematic. If the enemy enters combat first, it is possible for enemie groups that are already present to be counted as pending + // reinfocements, causing them to spawn at the edges of a sector instead. + // I am thus changing this so that the player team always gets the first turn if combat has not yet been started + if ( !(gTacticalStatus.uiFlags & INCOMBAT) || Random( 100 ) >= Random( 100 ) ) EnterCombatMode( OUR_TEAM ); else EnterCombatMode( ENEMY_TEAM );