Bugfixes (by Flugente)

- fixed a bug that caused wrong cursors to be dispalyed in NCTH
- fixed an oversight that caused the scope mode toggle not to be working
- corrected fortification cursor issues


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5345 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2012-06-13 07:48:02 +00:00
parent 0749e468a4
commit 99d9567f35
6 changed files with 57 additions and 59 deletions
+9 -5
View File
@@ -2158,12 +2158,16 @@ UINT8 HandleFortificationCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 ui
// check if we have a shovel in our second hand
OBJECTTYPE* pShovelObj = &(pSoldier->inv[SECONDHANDPOS]);
if ( !pShovelObj || !(pShovelObj->exists()) || !HasItemFlag(pSoldier->inv[ SECONDHANDPOS ].usItem, (SHOVEL)) )
if ( pShovelObj && (pShovelObj->exists()) && HasItemFlag(pSoldier->inv[ SECONDHANDPOS ].usItem, (SHOVEL)) )
{
return( FORTIFICATION_RED_UICURSOR );
INT8 bOverTerrainType = GetTerrainType( sGridNo );
if( bOverTerrainType == FLAT_GROUND || bOverTerrainType == DIRT_ROAD || bOverTerrainType == LOW_GRASS )
{
return( FORTIFICATION_GREY_UICURSOR );
}
}
else
return( FORTIFICATION_RED_UICURSOR );
return( FORTIFICATION_RED_UICURSOR );
}
if ( HasItemFlag( (&(pSoldier->inv[HANDPOS]))->usItem, (SHOVEL)) )
@@ -2179,7 +2183,7 @@ UINT8 HandleFortificationCursor( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT32 ui
}
// can we build something here?
if ( IsFortificationPossibleAtGridNo( sGridNo, NULL ) && pSoldier->pathing.bLevel == 0 )
if ( IsFortificationPossibleAtGridNo( sGridNo ) )
{
return( FORTIFICATION_GREY_UICURSOR );
}