Enhancement for scope mode fix in r7792: It is now allowed to use any scope mode except scopes while dual wielding guns.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7804 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2015-04-01 09:56:47 +00:00
parent a572703bf9
commit 4ef5b58107
+8 -2
View File
@@ -14356,10 +14356,12 @@ void GetScopeLists( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, std::map<INT8, O
arScopeMap[i] = NULL;
}
// dual wielding only allows iron sights
// dual wielding only allows iron sights or similar attachments
BOOLEAN bDualWielding = FALSE;
if( (Item[pSoldier->inv[HANDPOS].usItem].usItemClass & IC_GUN && !Item[pSoldier->inv[HANDPOS].usItem].twohanded)
&& (Item[pSoldier->inv[SECONDHANDPOS].usItem].usItemClass & IC_GUN && !Item[pSoldier->inv[SECONDHANDPOS].usItem].twohanded) )
return;
bDualWielding = TRUE;
// certain attachments prohibit the use of an iron sight once they are installed (flip-up built-in sights)
BOOLEAN noironsight = ( Item[pObj->usItem].blockironsight == TRUE );
@@ -14374,6 +14376,10 @@ void GetScopeLists( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, std::map<INT8, O
if ( IsAttachmentClass(iter->usItem, AC_SCOPE|AC_SIGHT|AC_IRONSIGHT ) )
{
// dual wielding only allows iron sights or similar attachments
if( bDualWielding && IsAttachmentClass(iter->usItem, AC_SCOPE) )
continue;
FLOAT magfactor = Item[iter->usItem].scopemagfactor;
// fix: if there is no scopemagfactor (or suspiciously small one), assume it to be 1.0f