-Fix for throwing explosives with attachments (by Sevenfm)

Weight is now considered correctly.

-Civilians now take care not to step on player placed tripwire. (by Sevenfm)


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6585 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2013-11-12 11:46:45 +00:00
parent 010e967948
commit 8257d11276
6 changed files with 23 additions and 14 deletions
+7 -3
View File
@@ -11090,7 +11090,7 @@ void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInv
}
INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed )
INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed, OBJECTTYPE* pObject)
{
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"calcmaxtossrange");
INT32 iRange = 0;
@@ -11147,7 +11147,11 @@ INT32 CalcMaxTossRange( SOLDIERTYPE * pSoldier, UINT16 usItem, BOOLEAN fArmed )
// Altered by Digicrab on 14 March, 2004
// Reversed a Ja2Gold change that made grenades of weight 3 or more have the same throw distance as those of weight 3.
INT32 iThrowingStrength = ( EffectiveStrength( pSoldier, FALSE ) * 2 + 100 ) / 3;
iRange = 2 + ( iThrowingStrength / (3 + (Item[usItem].ubWeight) / 3 ));
// sevenfm: calculate total weight of object with all attachments
if(pObject!= NULL)
iRange = 2 + ( iThrowingStrength / (3 + (CalculateObjectWeight(pObject)) / 3 ));
else
iRange = 2 + ( iThrowingStrength / (3 + (Item[usItem].ubWeight) / 3 ));
}
else
{ // not as aerodynamic!
@@ -11401,7 +11405,7 @@ UINT32 CalcThrownChanceToHit(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
}
else
{
iMaxRange = CalcMaxTossRange( pSoldier, usHandItem , TRUE ) * CELL_X_SIZE;
iMaxRange = CalcMaxTossRange( pSoldier, usHandItem , TRUE , &pSoldier->inv[HANDPOS]) * CELL_X_SIZE;
//NumMessage("MAX RANGE = ",maxRange);