From 96d0b1d3124b2a52fc5716f07da1b581ef36a4a5 Mon Sep 17 00:00:00 2001 From: Flugente Date: Sat, 2 May 2015 17:19:46 +0000 Subject: [PATCH] Fix: a bomb object could be cloned if unsucessfully apllied to someone else git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7842 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Control.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index 5340cc49..00777cf1 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -1985,11 +1985,11 @@ INT16 SOLDIERTYPE::CalcActionPoints( void ) // HEADROCK HAM 3.6: This was the wrong place to put AP_MIN_LIMIT. The value here should be AP_MINIMUM, which is // the minimum amount of APs a character can GAIN each turn on top of what he had last turn. AP_MIN_LIMIT has been // moved to CalcNewActionPoints() where it belongs. - if ( ubPoints < APBPConstants[AP_MINIMUM] ) + if (ubPoints < APBPConstants[AP_MINIMUM]) ubPoints = APBPConstants[AP_MINIMUM]; - + // make sure action points doesn't exceed the permitted maximum - ubMaxAPs = gubMaxActionPoints[this->ubBodyType]; + ubMaxAPs = gubMaxActionPoints[ this->ubBodyType ]; //if (GameOption[INCREASEDAP] % 2 == 1) // maxAPs += APBPConstants[AP_INCREASE]; @@ -20078,18 +20078,18 @@ void SOLDIERTYPE::EVENT_SoldierApplyItemToPerson( INT32 sGridNo, UINT8 ubDirecti // Dirty fInterfacePanelDirty = DIRTYLEVEL2; } - else if ( Item[usItem].usItemClass == IC_BOMB ) + else if ( Item[ usItem ].usItemClass == IC_BOMB ) { - success = AutoPlaceObjectAnywhere( pSoldier, pObj, FALSE ); + success = AutoPlaceObject( pSoldier, pObj, FALSE ); } - - this->DoMercBattleSound( BATTLE_SOUND_COOL1 ); } DeductPoints( this, GetAPsToApplyItem( this, sGridNo ), APBPConstants[BP_APPLYITEM], AFTERACTION_INTERRUPT ); if ( !success ) - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[MSG113_COULD_NOT_APPLY], this->GetName( ), Item[usItem].szLongItemName, pSoldier->GetName( ) ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, New113Message[ MSG113_COULD_NOT_APPLY ], this->GetName(), Item[usItem].szLongItemName, pSoldier->GetName() ); + else + this->DoMercBattleSound( BATTLE_SOUND_COOL1 ); } else {