From c29e070ccf401552e90dfe69636a88db7115e926 Mon Sep 17 00:00:00 2001 From: Shadooow Date: Wed, 26 Jan 2022 16:12:06 +0000 Subject: [PATCH] Fixes the missing muzzle flash lighting when firing in the dark. The flag was actually never set when using NCTH, and UseGunNCTH() that was supposed to set it gets called after the animation control checks whether a muzzleflash is true or not, so I had to add the setting the flag just before that check (by Asdow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9279 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Ani.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index b610cdfa0..186f93610 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -77,7 +77,7 @@ class SOLDIERTYPE; #include "connect.h" #include "fresh_header.h" #define NO_JUMP 0 -#define MAX_ANIFRAMES_PER_FLASH 2 +#define MAX_ANIFRAMES_PER_FLASH 3 //#define TIME_FOR_RANDOM_ANIM_CHECK 10 #define TIME_FOR_RANDOM_ANIM_CHECK 1 @@ -592,6 +592,18 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier ) break; } + { + OBJECTTYPE* pObjAttHand = pSoldier->GetUsedWeapon(&pSoldier->inv[pSoldier->ubAttackingHand]); + if (IsFlashSuppressor(pObjAttHand, pSoldier)) + { + pSoldier->flags.fMuzzleFlash = FALSE; + } + else + { + pSoldier->flags.fMuzzleFlash = TRUE; + } + DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("UseGun: Muzzle flash = %d", pSoldier->flags.fMuzzleFlash)); + } if ( !pSoldier->flags.fMuzzleFlash ) { break;