From 3784f56ce1feca19bd68376302a39d504c7afb02 Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sat, 1 May 2021 16:13:40 +0000 Subject: [PATCH] Fix: small GUI issue where the body silhouette in merc inventory turned dark after moving applicable item onto it and then out of it (by Shadooow). Fix: GUI issue where the body silhouette wasn't lit up with some of the new consumable items such as energy drinks, etc. Also, empty canteen will no longer lit up the body silhouette anymore (by Shadooow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8994 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Items.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp index 8657cb6f..9a9707c8 100644 --- a/Tactical/Interface Items.cpp +++ b/Tactical/Interface Items.cpp @@ -2827,20 +2827,18 @@ BOOLEAN CompatibleGunForAmmo( OBJECTTYPE *pTryObject, OBJECTTYPE *pTestObject ) return( FALSE ); } -BOOLEAN CompatibleItemForApplyingOnMerc( OBJECTTYPE *pTestObject ) +BOOLEAN CompatibleItemForApplyingOnMerc(OBJECTTYPE *pTestObject) { UINT16 usItem = pTestObject->usItem; // ATE: If in mapscreen, return false always.... - if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) + if (guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN) { - return( FALSE ); + return(FALSE); } - - // ATE: Would be nice to have flag here to check for these types.... - if ( Item[usItem].camouflagekit || usItem == ADRENALINE_BOOSTER || usItem == REGEN_BOOSTER || - usItem == SYRINGE_3 || usItem == SYRINGE_4 || usItem == SYRINGE_5 || - Item[usItem].alcohol > 0.0f || Item[usItem].canteen || usItem == JAR_ELIXIR || (usItem == 1022 && gGameExternalOptions.fCamoRemoving) ) // Added rag usable on self - SANDRO + //Shadooow: rewritten to use new item flags and check canteen not empty + if (((HasItemFlag(usItem, CAMO_REMOVAL) && gGameExternalOptions.fCamoRemoving) || Item[usItem].camouflagekit || usItem == JAR_ELIXIR || + Item[usItem].clothestype || Item[usItem].drugtype || Item[usItem].foodtype) && (!Item[usItem].canteen || (*pTestObject)[0]->data.objectStatus > 1)) { return( TRUE ); } @@ -2987,6 +2985,7 @@ BOOLEAN HandleCompatibleAmmoUIForMapScreen( SOLDIERTYPE *pSoldier, INT32 bInvPos { if ( CompatibleItemForApplyingOnMerc( gpItemPointer ) ) { + /*// Shadooow: disabled, probably a remnant of past when this didn't happen automatically when hovering/picking item // OK, Light up portrait as well..... if ( fOn ) { @@ -2996,6 +2995,7 @@ BOOLEAN HandleCompatibleAmmoUIForMapScreen( SOLDIERTYPE *pSoldier, INT32 bInvPos { gbCompatibleApplyItem = FALSE; } + */ fFound = TRUE; } @@ -3253,6 +3253,7 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest { if ( CompatibleItemForApplyingOnMerc( gpItemPointer ) ) { + /*// Shadooow: disabled, probably a remnant of past when this didn't happen automatically when hovering/picking item // OK, Light up portrait as well..... if ( fOn ) { @@ -3262,6 +3263,7 @@ BOOLEAN InternalHandleCompatibleAmmoUI( SOLDIERTYPE *pSoldier, OBJECTTYPE *pTest { gbCompatibleApplyItem = FALSE; } + */ fFound = TRUE; }