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
This commit is contained in:
Sevenfm
2021-04-25 13:58:32 +00:00
parent 72c20b724f
commit 9d4829ef5a
2 changed files with 17 additions and 2 deletions
+7
View File
@@ -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 )
{
+10 -2
View File
@@ -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) )