From 4cab0e2bdf35aeb4ebb54f03b4914a5a859185c1 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sun, 14 Mar 2021 18:33:06 +0000 Subject: [PATCH] Experimental tweak: stop muzzle flash at the end of the attack, to allow visibility check and interrupt to work correctly. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8954 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Handle UI.cpp | 3 ++- Tactical/Overhead.cpp | 3 ++- Tactical/Points.cpp | 6 ++++++ Tactical/Soldier Control.cpp | 6 ++++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index d813c585f..c5c33560c 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -6361,7 +6361,8 @@ UINT32 UIHandleLAEndLockOurTurn( UI_EVENT *pUIEvent ) guiPendingOverrideEvent = M_ON_TERRAIN; HandleTacticalUI( ); - TurnOffTeamsMuzzleFlashes( gbPlayerNum ); + // sevenfm: stop muzzle flash in InternalReduceAttackBusyCount instead + //TurnOffTeamsMuzzleFlashes( gbPlayerNum ); // UnPause time! UnLockPauseState(); diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp index 978aab377..f7c08f38d 100644 --- a/Tactical/Overhead.cpp +++ b/Tactical/Overhead.cpp @@ -9762,7 +9762,8 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( ) DequeueAllDemandGameEvents( TRUE ); // if we're in realtime, turn off the attacker's muzzle flash at this point - if ( !(gTacticalStatus.uiFlags & INCOMBAT) && pSoldier ) + // sevenfm: always stop muzzle flash at the end of attack + if (pSoldier) // &&!(gTacticalStatus.uiFlags & INCOMBAT) { EndMuzzleFlash( pSoldier ); } diff --git a/Tactical/Points.cpp b/Tactical/Points.cpp index 3c770e8ca..9d30c0517 100644 --- a/Tactical/Points.cpp +++ b/Tactical/Points.cpp @@ -992,6 +992,12 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, UINT8 ub pSoldier->usSoldierFlagMask2 |= SOLDIER_SPENT_AP; pSoldier->StopChatting(); + + // sevenfm: stop muzzle flash + if (pSoldier->flags.fMuzzleFlash) + { + EndMuzzleFlash(pSoldier); + } } // in real time, there IS no AP cost, (only breath cost) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index f86558ea7..4ff92ca75 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -17946,6 +17946,12 @@ void SOLDIERTYPE::SoldierPropertyUpkeep( ) HandleInitialRedAlert( ENEMY_TEAM, FALSE ); } + // sevenfm: stop muzzle flash + if (this->flags.fMuzzleFlash) + { + EndMuzzleFlash(this); + } + if ( HasBackgroundFlag( BACKGROUND_EXP_UNDERGROUND ) && this->bSectorZ ) ++bExtraExpLevel;