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
This commit is contained in:
Shadooow
2022-01-26 16:12:06 +00:00
parent 5c938440c2
commit c29e070ccf
+13 -1
View File
@@ -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;