From 96d1177e318ee696441e695c58d4eb02e23bca0b Mon Sep 17 00:00:00 2001 From: Flugente Date: Mon, 17 Aug 2015 21:09:44 +0000 Subject: [PATCH] Fix: sectors can't be selected in GETITEM menu git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7978 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index f2447ca9..7bd89f0f 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -222,7 +222,7 @@ MOUSE_REGION gContractMenuRegion[ MAX_CONTRACT_MENU_STRING_COUNT ]; MOUSE_REGION gRemoveMercAssignRegion[ MAX_REMOVE_MERC_COUNT ]; MOUSE_REGION gEpcMenuRegion[ MAX_EPC_MENU_STRING_COUNT ]; MOUSE_REGION gRepairMenuRegion[ 20 ]; -MOUSE_REGION gMoveItem[ 20 ]; +MOUSE_REGION gMoveItem[MOVEITEM_MAX_SECTORS_WITH_MODIFIER + 1]; MOUSE_REGION gDisease[DISEASE_MENU_CANCEL + 1]; UINT16 usMoveItemSectors[MOVEITEM_MAX_SECTORS_WITH_MODIFIER]; @@ -20934,6 +20934,8 @@ BOOLEAN DisplayMoveItemsMenu( SOLDIERTYPE *pSoldier ) } // a second run, this time the same sectors with the option to not take militia gear + iCount = 0; + if ( gGameExternalOptions.fMilitiaUseSectorInventory ) { for ( UINT16 X = 0; X < 256; ++X ) @@ -21066,7 +21068,7 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) // only in towns if ( bTownId != BLANK_SECTOR && pSoldier->bSectorZ == 0 ) { - for ( UINT i = 0; i < MOVEITEM_MAX_SECTORS_WITH_MODIFIER; ++i ) + for ( UINT8 i = 0; i < MOVEITEM_MAX_SECTORS_WITH_MODIFIER; ++i ) { // this includes MOVEITEM_SECTOR_OFFSET ! UINT16 val = usMoveItemSectors[i]; @@ -21075,7 +21077,7 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) { // add mouse region for each line of text..and set user data MSYS_DefineRegion( &gMoveItem[ iCount ], - ( INT16 )( iBoxXPosition ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * iCount ), ( INT16 )( iBoxXPosition + iBoxWidth ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * ( iCount + 1 ) ), + ( INT16 )( iBoxXPosition ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghMoveBox ) + ( iFontHeight ) * iCount ), ( INT16 )( iBoxXPosition + iBoxWidth ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * ( iCount + 1 ) ), MSYS_PRIORITY_HIGHEST - 4 , MSYS_NO_CURSOR, MoveItemMenuMvtCallback, MoveItemMenuBtnCallback ); // first data is for entry in usMoveItemSectors, second is for regiondate number @@ -21090,7 +21092,7 @@ void CreateDestroyMouseRegionForMoveItemMenu( void ) } // cancel - MSYS_DefineRegion( &gMoveItem[ iCount ], ( INT16 )( iBoxXPosition ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * iCount ), ( INT16 )( iBoxXPosition + iBoxWidth ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + ( iFontHeight ) * ( iCount + 1 ) ), MSYS_PRIORITY_HIGHEST - 4 , + MSYS_DefineRegion( &gMoveItem[iCount], (INT16)(iBoxXPosition), (INT16)(iBoxYPosition + GetTopMarginSize( ghMoveBox ) + (iFontHeight)* iCount), (INT16)(iBoxXPosition + iBoxWidth), (INT16)(iBoxYPosition + GetTopMarginSize( ghAssignmentBox ) + (iFontHeight)* (iCount + 1)), MSYS_PRIORITY_HIGHEST - 4, MSYS_NO_CURSOR, MoveItemMenuMvtCallback, MoveItemMenuBtnCallback ); MSYS_SetRegionUserData( &gMoveItem[iCount], 0, MOVEITEM_MENU_CANCEL );