From 4ef5b58107b25d4e4d43587925f85f2e9acc824f Mon Sep 17 00:00:00 2001 From: silversurfer Date: Wed, 1 Apr 2015 09:56:47 +0000 Subject: [PATCH] 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 --- Tactical/Items.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index dbbbc089..d02b36d7 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -14356,10 +14356,12 @@ void GetScopeLists( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, std::mapinv[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::mapusItem, 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