From ad5f3e933c5d5276e95da979aa853b6ce6b9210d Mon Sep 17 00:00:00 2001 From: Flugente Date: Wed, 22 Apr 2015 18:46:09 +0000 Subject: [PATCH] - Fix: Launchers launch things that aren't supposed to be launched, like attached scopes - Fix: mercs complain about non-useable structure construction items, even though these don't care about the useability threshold git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7829 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Handle Items.cpp | 2 +- Tactical/Items.cpp | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp index ce4c41d4..7ed1776e 100644 --- a/Tactical/Handle Items.cpp +++ b/Tactical/Handle Items.cpp @@ -5280,7 +5280,7 @@ BOOLEAN HandItemWorks( SOLDIERTYPE *pSoldier, INT8 bSlot ) // shape to be usable, and doesn't break during use. // Exception: land mines. You can bury them broken, they just won't blow! // if ( (Item[ pObj->usItem ].fFlags & ITEM_DAMAGEABLE) && (pObj->usItem != MINE) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && pObj->usItem != GAS_CAN ) - if ( (Item[ pObj->usItem ].damageable ) && (!Item[pObj->usItem].mine ) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && !Item[pObj->usItem].gascan ) + if ( Item[pObj->usItem].damageable && !Item[pObj->usItem].mine && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !Item[pObj->usItem].gascan && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) ) { // if it's still usable, check whether it breaks if ( (*pObj)[0]->data.objectStatus >= USABLE) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index e3c58c35..0b3296c6 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -2704,9 +2704,11 @@ BOOLEAN TwoHandedItem( UINT16 usItem ) BOOLEAN ValidLaunchable( UINT16 usLaunchable, UINT16 usItem ) { INT32 iLoop = 0; + // Flugente: as this would cause launchers to happily launch attachments around the landscape, we really have to check the list of launchables + // if a modder decides to define launchables via attachment points, slap him and tell him not to do that //Madd: Common Attachment Framework - if ( IsAttachmentPointAvailable(usItem, usLaunchable) ) - return TRUE; + //if ( IsAttachmentPointAvailable(usItem, usLaunchable) ) + //return TRUE; //DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("ValidLaunchable: launchable=%d, item=%d",usLaunchable,usItem)); // look for the section of the array pertaining to this launchable item... @@ -2716,7 +2718,7 @@ BOOLEAN ValidLaunchable( UINT16 usLaunchable, UINT16 usItem ) { break; } - iLoop++; + ++iLoop; if (Launchable[iLoop][0] == 0) { // the proposed item cannot be attached to anything! @@ -2731,7 +2733,7 @@ BOOLEAN ValidLaunchable( UINT16 usLaunchable, UINT16 usItem ) { break; } - iLoop++; + ++iLoop; if (Launchable[iLoop][0] != usLaunchable) { // the proposed item cannot be attached to the item in question