From 9d4829ef5ab1091b99a01964517aecf257107c9b Mon Sep 17 00:00:00 2001 From: Sevenfm Date: Sun, 25 Apr 2021 13:58:32 +0000 Subject: [PATCH] Fix: incorrect cursor when using wire cutters (by Shadooow). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8978 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Handle UI.cpp | 7 +++++++ Tactical/UI Cursors.cpp | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index c662ceb2..e1c9c9c2 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -4794,6 +4794,13 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier ) { return( TRUE ); } + else if (IsStructureDeconstructItem(pSoldier->inv[HANDPOS].usItem, usMapPos, pSoldier)) + { + if (FindStructure(usMapPos, (STRUCTURE_GENERIC | STRUCTURE_WIREFENCE))) + { + return(TRUE); + } + } // Flugente: if there is tripwire here that we know of, allow handling else if ( FindWorldItemForTripwireInGridNo( usMapPos, pSoldier->pathing.bLevel, TRUE ) != -1 ) { diff --git a/Tactical/UI Cursors.cpp b/Tactical/UI Cursors.cpp index 93d8d36b..1708c258 100644 --- a/Tactical/UI Cursors.cpp +++ b/Tactical/UI Cursors.cpp @@ -2077,7 +2077,13 @@ UINT8 HandleWirecutterCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 uiCur { return( GOOD_WIRECUTTER_UICURSOR ); } - + else if (IsStructureDeconstructItem(pSoldier->inv[HANDPOS].usItem, sGridNo, pSoldier)) + { + if (FindStructure(sGridNo, (STRUCTURE_GENERIC | STRUCTURE_WIREFENCE))) + { + return(GOOD_WIRECUTTER_UICURSOR); + } + } return( BAD_WIRECUTTER_UICURSOR ); } @@ -2898,8 +2904,10 @@ UINT8 GetActionModeCursor( SOLDIERTYPE *pSoldier ) // Flugente: cursor for constructing/deconstructing // at the moment the gridno is not required in these functions, thus 1 suffices - if ( IsStructureConstructItem( usInHand, 1, pSoldier ) || IsStructureDeconstructItem( usInHand, 1, pSoldier ) ) + if (!Item[usInHand].wirecutters && (IsStructureConstructItem(usInHand, 1, pSoldier) || IsStructureDeconstructItem(usInHand, 1, pSoldier))) + { ubCursor = FORTICURS; + } // Flugente: cursor for handcuffs if ( gGameExternalOptions.fAllowPrisonerSystem && HasItemFlag(usInHand, HANDCUFFS) )