mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
-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:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user