mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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
This commit is contained in:
+11
-7
@@ -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<INT8, OBJECTTYPE*> 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user