From 1b00117b7e38fa68dbe916e9be77098bda8ca5af Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 15 May 2013 23:04:09 +0000 Subject: [PATCH] when using alternate weapon holding under NCTH, still apply projection factor from non-scope/sight attachments git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6079 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Items.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index e6245213..40cf9ea3 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -12732,12 +12732,12 @@ FLOAT GetProjectionFactor( OBJECTTYPE * pObj ) // Flugente: projection factor while using scope modes excludes those factors coming from not-used scopes and sights FLOAT GetScopeModeProjectionFactor( SOLDIERTYPE *pSoldier, OBJECTTYPE * pObj ) { - if ( !gGameExternalOptions.fScopeModes || !pSoldier || pSoldier->bTeam != gbPlayerNum || !pObj || !pObj->exists() || Item[pObj->usItem].usItemClass != IC_GUN ) - return GetProjectionFactor(pObj); - - if ( !UsingNewCTHSystem() || pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD ) + if ( !UsingNewCTHSystem() || !pObj || !pObj->exists() || Item[pObj->usItem].usItemClass != IC_GUN ) return 1.0; + if ( !gGameExternalOptions.fScopeModes || !pSoldier || pSoldier->bTeam != gbPlayerNum ) + return GetProjectionFactor(pObj); + // Flugente: check for scope mode std::map ObjList; GetScopeLists(pObj, ObjList); @@ -12750,9 +12750,13 @@ FLOAT GetScopeModeProjectionFactor( SOLDIERTYPE *pSoldier, OBJECTTYPE * pObj ) { if (iter->exists()) { - // if attachment is scope/sight and not used, ignore it! - if ( IsAttachmentClass(iter->usItem, AC_SCOPE|AC_SIGHT|AC_IRONSIGHT ) && iter->usItem != ObjList[pSoldier->bScopeMode]->usItem ) - continue; + // if attachment is scope/sight... + if ( IsAttachmentClass(iter->usItem, AC_SCOPE|AC_SIGHT|AC_IRONSIGHT) ) + { + // ignore sight if not using it + if ( pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD || iter->usItem != ObjList[pSoldier->bScopeMode]->usItem ) + continue; + } BestFactor = __max(BestFactor, Item[iter->usItem].projectionfactor); }