Fix for aim level calculations. Base weapon modifiers are now always applied except for shooting from hip. This fixes the problem that an optical attachment could remove base weapon modifiers completely and apply a bonus on top of that.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7084 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-03-18 08:19:41 +00:00
parent 1a47da6d4e
commit c45b5aa7f6
+6 -2
View File
@@ -10291,8 +10291,12 @@ INT32 GetObjectModifier( SOLDIERTYPE* pSoldier, OBJECTTYPE *pObj, UINT8 ubStance
GetScopeLists(pObj, ObjList);
// only use scope mode if gun is in hand, otherwise an error might occur!
if ( (&pSoldier->inv[HANDPOS]) == pObj && ObjList[pSoldier->bScopeMode] != NULL )
iModifier += GetItemModifier(ObjList[pSoldier->bScopeMode], ubRef, usType);
if ( (&pSoldier->inv[HANDPOS]) == pObj && ObjList[pSoldier->bScopeMode] != NULL )
// Do not apply weapon bonus/penalty because this will be added one step below. We don't want to apply it twice.
if ( pObj->usItem != ObjList[pSoldier->bScopeMode]->usItem )
iModifier += GetItemModifier(ObjList[pSoldier->bScopeMode], ubRef, usType);
// add weapon modifier
iModifier += GetItemModifier( pObj, ubRef, usType);
}
}
else