mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
1. Bugfix - one more pSoldier->bScopeMode != NULL check added
2. Bugfix - removing attachments which created new slots and had attachments in those slots which were also able to go into existing slots in the base item was resulting in duplication of the base attachment and loss of the attached attachment. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5295 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -6364,9 +6364,12 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
|
||||
std::map<INT8, OBJECTTYPE*> ObjList;
|
||||
GetScopeLists((&(pSoldier->inv[pSoldier->ubAttackingHand])), ObjList);
|
||||
|
||||
iPenalty = (Item[ObjList[pSoldier->bScopeMode]->usItem].aimbonus * (iRange - Item[ObjList[pSoldier->bScopeMode]->usItem].minrangeforaimbonus)) / 1000;
|
||||
iPenalty = min(AIM_BONUS_PRONE, iPenalty);
|
||||
iChance -= iPenalty;
|
||||
if ( ObjList[pSoldier->bScopeMode] != NULL )
|
||||
{
|
||||
iPenalty = (Item[ObjList[pSoldier->bScopeMode]->usItem].aimbonus * (iRange - Item[ObjList[pSoldier->bScopeMode]->usItem].minrangeforaimbonus)) / 1000;
|
||||
iPenalty = min(AIM_BONUS_PRONE, iPenalty);
|
||||
iChance -= iPenalty;
|
||||
}
|
||||
}
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
Reference in New Issue
Block a user