- Bugfix: Fixed CTD when throwing item (grenade, rock, throwing knife, ...) in tactical when item description box is open

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3299 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2009-10-31 17:33:15 +00:00
parent 8f1f24499b
commit ea1b814e8f
4 changed files with 51 additions and 33 deletions
+11 -2
View File
@@ -1402,9 +1402,18 @@ INT16 BaseAPsToShootOrStab( INT16 bAPs, INT16 bAimSkill, OBJECTTYPE * pObj )
//{
// Top *= 100;
//}
Bottom = (INT32)(( 100 + bAimSkill ) * rof);
// WANNE : Fixed CTD that occurs when trowing item (grenade, throwing knife, ...)
// with open description box in tactical
INT16 baseAPsToShootOrStab = -1;
if (rof > 0)
{
Bottom = (INT32)(( 100 + bAimSkill ) * rof);
baseAPsToShootOrStab = ( Top + Bottom / 2 ) / Bottom;
}
// (this will round to the nearest integer)
return ( Top + Bottom / 2 ) / Bottom;
return baseAPsToShootOrStab;
}
void GetAPChargeForShootOrStabWRTGunRaises( SOLDIERTYPE *pSoldier, INT16 sGridNo, UINT8 ubAddTurningCost, BOOLEAN *pfChargeTurning, BOOLEAN *pfChargeRaise )