-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
+10 -9
View File
@@ -5464,22 +5464,23 @@ void HandleAttachedExplosions(UINT8 ubOwner, INT16 sX, INT16 sY, INT16 sZ, INT32
}
}
if( !binderFound )
return;
// search for attached explosives
for (iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
{
if ( iter->exists() && Item[iter->usItem].usItemClass & (IC_GRENADE|IC_BOMB) )
{
if(Item[iter->usItem].directional && ubDirection == DIRECTION_IRRELEVANT)
direction=Random(8);
else
direction=ubDirection;
if( Explosive[Item[iter->usItem].ubClassIndex].ubVolatility > 0 )
// no need for binder if both item and attachment are tripwire-activated
if( ( Item[pObj->usItem].tripwireactivation && Item[iter->usItem].tripwireactivation ) ||
( binderFound && Explosive[Item[iter->usItem].ubClassIndex].ubVolatility > 0 ) )
{
if(Item[iter->usItem].directional && ubDirection == DIRECTION_IRRELEVANT)
direction=Random(8);
else
direction=ubDirection;
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, Item[iter->usItem].uiIndex, bLevel, direction , NULL );
}
}
if ( gGameExternalOptions.bAllowSpecialExplosiveAttachments && iter->exists() && Item[iter->usItem].usItemClass & IC_MISC )
if ( binderFound && gGameExternalOptions.bAllowSpecialExplosiveAttachments && iter->exists() && Item[iter->usItem].usItemClass & IC_MISC )
{
if(Item[iter->usItem].gascan)
IgniteExplosion( ubOwner, sX, sY, sZ, sGridNo, GAS_EXPLOSION, bLevel, DIRECTION_IRRELEVANT , NULL );
+1 -1
View File
@@ -2194,7 +2194,7 @@ FLOAT CalculateSoldierMaxForce( SOLDIERTYPE *pSoldier, FLOAT dDegrees , OBJECTTY
dDegrees = (FLOAT)( PI/4 );
uiMaxRange = CalcMaxTossRange( pSoldier, pItem->usItem, fArmed );
uiMaxRange = CalcMaxTossRange( pSoldier, pItem->usItem, fArmed, pItem );
dMagForce = CalculateForceFromRange( pItem->usItem, (INT16) uiMaxRange, dDegrees );