From 1102106b785a2745a2cf6622a0bb805465d0221b Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 14 Oct 2014 22:15:44 +0000 Subject: [PATCH] Fix: ID on artillery shells was not set correctly. This caused all damage of an artillery strike to be attributed to the first merc. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7570 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 2 +- Tactical/Weapons.cpp | 6 +++--- Tactical/Weapons.h | 2 +- TileEngine/Explosion Control.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 5f5d3307..bbd1a89b 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -17935,7 +17935,7 @@ BOOLEAN SOLDIERTYPE::OrderArtilleryStrike( UINT32 usSectorNr, INT32 sTargetGridN // send a signal shell at first. This marks the area that the shells will come in static UINT16 usSignalShellIndex = 1700; if ( HasItemFlag( usSignalShellIndex, SIGNAL_SHELL ) || GetFirstItemWithFlag( &usSignalShellIndex, SIGNAL_SHELL ) ) - ArtilleryStrike( usSignalShellIndex, sStartingGridNo, sTargetGridNo ); + ArtilleryStrike( usSignalShellIndex, this->ubID, sStartingGridNo, sTargetGridNo ); else { ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_NO_SIGNAL_SHELL] ); diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index beaa9e96..9bb06236 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -13324,7 +13324,7 @@ FLOAT CalcNewChanceToHitAimTraitBonus(SOLDIERTYPE *pSoldier, FLOAT fAimCap, FLOA extern BOOLEAN IsRoofPresentAtGridNo( INT32 sGridNo ); // Flugente: fire item from A to B (intended for mortarshells and launchable grenades) -BOOLEAN ArtilleryStrike( UINT16 usItem, UINT32 usStartingGridNo, UINT32 usTargetMapPos ) +BOOLEAN ArtilleryStrike( UINT16 usItem, UINT8 ubOwnerID, UINT32 usStartingGridNo, UINT32 usTargetMapPos ) { FLOAT dForce, dDegrees; INT16 sDestX, sDestY, sSrcX, sSrcY; @@ -13385,8 +13385,8 @@ BOOLEAN ArtilleryStrike( UINT16 usItem, UINT32 usStartingGridNo, UINT32 usTarget { PlayJA2Sample( Weapon[ usItem ].sSound, RATE_11025, SoundVolume( HIGHVOLUME, usStartingGridNo ), 1, SoundDir( usStartingGridNo ) ); } - - INT32 iID = CreatePhysicalObject( &shellobj, -1, dX, dY, dZ, dForceX, dForceY, dForceZ, 0, THROW_ARM_ITEM, 0, FALSE ); + + INT32 iID = CreatePhysicalObject( &shellobj, -1, dX, dY, dZ, dForceX, dForceY, dForceZ, ubOwnerID, THROW_ARM_ITEM, 0, FALSE ); // OJW - 20091002 - Explosives /*if (is_networked && is_client) diff --git a/Tactical/Weapons.h b/Tactical/Weapons.h index 5d0db55a..b5eafdc3 100644 --- a/Tactical/Weapons.h +++ b/Tactical/Weapons.h @@ -541,6 +541,6 @@ FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj ); FLOAT GetOverheatDamageThresholdModifier( OBJECTTYPE *pObj ); FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj ); -BOOLEAN ArtilleryStrike( UINT16 usItem, UINT32 usStartingGridNo, UINT32 usTargetMapPos ); +BOOLEAN ArtilleryStrike( UINT16 usItem, UINT8 ubOwnerID, UINT32 usStartingGridNo, UINT32 usTargetMapPos ); #endif diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index 880b7bd5..e02f03c3 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -4053,7 +4053,7 @@ void HandleExplosionQueue( void ) if ( GetRandomSignalSmokeGridNo(&sTargetGridNo) || GetRadioOperatorSignal((*pObj)[0]->data.misc.ubBombOwner, &sTargetGridNo) || (sTargetGridNo = RandomGridNo()) ) { for ( UINT8 i = 0; i < cnt; ++i) - ArtilleryStrike(pObj->usItem, sGridNo, sTargetGridNo); + ArtilleryStrike( pObj->usItem, (*pObj)[0]->data.misc.ubBombOwner, sGridNo, sTargetGridNo ); } // not needed anymore