From b3b3fe05803993557ef677b05a3bee13217f4ad5 Mon Sep 17 00:00:00 2001 From: Flugente Date: Fri, 13 Feb 2015 20:25:04 +0000 Subject: [PATCH] If firing a one-shot rocket launcher creates a discarded RPG, drop it to the ground, as the object is useless anyway. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7734 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Weapons.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index 440d31f6c..70205fe50 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -2078,7 +2078,15 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) if ( Item[usUBItem].singleshotrocketlauncher ) { CreateItem( Item[usItemNum].discardedlauncheritem , (*pObjHand)[0]->data.objectStatus, pObjHand ); + + // Flugente: why would we keep a piece of scrap in our ahnds in the first place? just drop it to the ground + AddItemToPool( pSoldier->sGridNo, pObjHand, 1, pSoldier->pathing.bLevel, 0, -1 ); + + // Delete object + DeleteObj( pObjHand ); + DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 ); + if ( Item[usUBItem].usBuddyItem != 0 && Item[Item[usUBItem].usBuddyItem].usItemClass & IC_EXPLOSV ) { IgniteExplosion( pSoldier->ubID, CenterX( pSoldier->sGridNo ), CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, Item[usUBItem].usBuddyItem, pSoldier->pathing.bLevel ); @@ -2250,6 +2258,13 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) if ( Item[usUBItem].singleshotrocketlauncher ) { CreateItem( Item[usUBItem].discardedlauncheritem, (*pObjHand)[0]->data.objectStatus, pObjHand ); + + // Flugente: why would we keep a piece of scrap in our ahnds in the first place? just drop it to the ground + AddItemToPool( pSoldier->sGridNo, pObjHand, 1, pSoldier->pathing.bLevel, 0, -1 ); + + // Delete object + DeleteObj( pObjHand ); + DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 ); } @@ -2834,7 +2849,15 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) if ( Item[usUBItem].singleshotrocketlauncher ) { CreateItem( Item[usUBItem].discardedlauncheritem , (*pObjUsed)[0]->data.objectStatus, pObjUsed ); + + // Flugente: why would we keep a piece of scrap in our ahnds in the first place? just drop it to the ground + AddItemToPool( pSoldier->sGridNo, pObjUsed, 1, pSoldier->pathing.bLevel, 0, -1 ); + + // Delete object + DeleteObj( pObjUsed ); + DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 ); + if ( Item[usUBItem].usBuddyItem != 0 && Item[Item[usUBItem].usBuddyItem].usItemClass & IC_EXPLOSV ) { IgniteExplosion( pSoldier->ubID, CenterX( pSoldier->sGridNo ), CenterY( pSoldier->sGridNo ), 0, pSoldier->sGridNo, C1, pSoldier->pathing.bLevel ); @@ -2894,6 +2917,13 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) if ( Item[usUBItem].singleshotrocketlauncher ) { CreateItem( Item[usUBItem].discardedlauncheritem, (*pObjUsed)[0]->data.objectStatus, pObjUsed ); + + // Flugente: why would we keep a piece of scrap in our ahnds in the first place? just drop it to the ground + AddItemToPool( pSoldier->sGridNo, pObjUsed, 1, pSoldier->pathing.bLevel, 0, -1 ); + + // Delete object + DeleteObj( pObjUsed ); + DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 ); }