diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index 1051b8c9..47472f01 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -4074,18 +4074,21 @@ void HandleExplosionQueue( void ) if ( (*pObj)[0]->data.ubWireNetworkFlag & ARTILLERY_STRIKE_COUNT_2 ) cnt += 2; if ( (*pObj)[0]->data.ubWireNetworkFlag & ARTILLERY_STRIKE_COUNT_4 ) cnt += 4; - // determine gridno to attack - smoke signal required. Otherwise, it is assumed the radio operator ordered the bombing of his OWN position - // if we cannot even find a radio operator, all bets are off - target a random gridno - // the usual +/- 2 shenanigans - UINT16 usOwner = max( 0, (*pObj)[0]->data.misc.ubBombOwner - 2 ); - INT32 sTargetGridNo = -1; - if ( GetRandomSignalSmokeGridNo( &sTargetGridNo ) || GetRadioOperatorSignal( usOwner, &sTargetGridNo ) || (sTargetGridNo = RandomGridNo( )) ) - { - for ( UINT8 i = 0; i < cnt; ++i) - ArtilleryStrike( pObj->usItem, usOwner, sGridNo, sTargetGridNo ); - } + // determine gridno to attack - smoke signal required. Otherwise, it is assumed the radio operator ordered the bombing of his OWN position + // if we cannot even find a radio operator, all bets are off - target a random gridno + // the usual +/- 2 shenanigans + UINT16 usOwner = NOBODY; + if ( (*pObj)[0]->data.misc.ubBombOwner > 1 ) + usOwner = (*pObj)[0]->data.misc.ubBombOwner - 2; - // not needed anymore + INT32 sTargetGridNo = NOWHERE; + if ( GetRandomSignalSmokeGridNo( &sTargetGridNo ) || GetRadioOperatorSignal( usOwner, &sTargetGridNo ) || (sTargetGridNo = RandomGridNo( )) ) + { + for ( UINT8 i = 0; i < cnt; ++i) + ArtilleryStrike( pObj->usItem, usOwner, sGridNo, sTargetGridNo ); + } + + // not needed anymore RemoveItemFromPool( sGridNo, gWorldBombs[ uiWorldBombIndex ].iItemIndex, ubLevel ); } else