mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
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:
+8
-2
@@ -14356,10 +14356,12 @@ void GetScopeLists( SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, std::map<INT8, O
|
|||||||
arScopeMap[i] = NULL;
|
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)
|
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) )
|
&& (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)
|
// 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 );
|
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 ) )
|
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;
|
FLOAT magfactor = Item[iter->usItem].scopemagfactor;
|
||||||
|
|
||||||
// fix: if there is no scopemagfactor (or suspiciously small one), assume it to be 1.0f
|
// fix: if there is no scopemagfactor (or suspiciously small one), assume it to be 1.0f
|
||||||
|
|||||||
Reference in New Issue
Block a user