Fixed a crash/freeze that could occur when trying to Sell All or Delete All items while the item description box was open.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2471 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2009-01-06 16:33:16 +00:00
parent de508be6a2
commit 8505cd45cd
+27 -21
View File
@@ -1069,7 +1069,7 @@ void BeginSellAllCallBack( UINT8 bExitValue )
if( bExitValue == MSG_BOX_RETURN_YES )
{
fRestoreBackgroundForMessageBox = TRUE;
if ( gpItemPointer != NULL )
if ( gpItemPointer != NULL || InSectorStackPopup( ) || InItemStackPopup( ) || InItemDescriptionBox( ) || InKeyRingPopup( ) )
{
return;
}
@@ -1107,7 +1107,7 @@ void BeginDeleteAllCallBack( UINT8 bExitValue )
if( bExitValue == MSG_BOX_RETURN_YES )
{
fRestoreBackgroundForMessageBox = TRUE;
if ( gpItemPointer != NULL )
if ( gpItemPointer != NULL || InSectorStackPopup( ) || InItemStackPopup( ) || InItemDescriptionBox( ) || InKeyRingPopup( ) )
{
return;
}
@@ -6272,16 +6272,19 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
case 'D':
if( fCtrl )
{
//CHRISL: Delete all items
if(!fShowMapInventoryPool)
if ( !InSectorStackPopup( ) && !InItemStackPopup( ) && !InItemDescriptionBox( ) && !InKeyRingPopup( ) )
{
fShowMapInventoryPool = TRUE;
CreateDestroyMapInventoryPoolButtons( TRUE );
}
DoMessageBox( MSG_BOX_BASIC_STYLE, NewInvMessage[NIV_DELETE_ALL], guiCurrentScreen, ( UINT8 )MSG_BOX_FLAG_YESNO, BeginDeleteAllCallBack, NULL );
if(fShowMapInventoryPool)
{
fShowMapInventoryPool = FALSE;
//CHRISL: Delete all items
if(!fShowMapInventoryPool)
{
fShowMapInventoryPool = TRUE;
CreateDestroyMapInventoryPoolButtons( TRUE );
}
DoMessageBox( MSG_BOX_BASIC_STYLE, NewInvMessage[NIV_DELETE_ALL], guiCurrentScreen, ( UINT8 )MSG_BOX_FLAG_YESNO, BeginDeleteAllCallBack, NULL );
if(fShowMapInventoryPool)
{
fShowMapInventoryPool = FALSE;
}
}
}
break;
@@ -6625,18 +6628,21 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
case 'S':
if( fCtrl )
{
//CHRISL: Sell all items
if(gGameExternalOptions.fSellAll == TRUE)
if ( !InSectorStackPopup( ) && !InItemStackPopup( ) && !InItemDescriptionBox( ) && !InKeyRingPopup( ) )
{
if(!fShowMapInventoryPool)
//CHRISL: Sell all items
if(gGameExternalOptions.fSellAll == TRUE)
{
fShowMapInventoryPool = TRUE;
CreateDestroyMapInventoryPoolButtons( TRUE );
}
DoMessageBox( MSG_BOX_BASIC_STYLE, NewInvMessage[NIV_SELL_ALL], guiCurrentScreen, ( UINT8 )MSG_BOX_FLAG_YESNO, BeginSellAllCallBack, NULL );
if(fShowMapInventoryPool)
{
fShowMapInventoryPool = FALSE;
if(!fShowMapInventoryPool)
{
fShowMapInventoryPool = TRUE;
CreateDestroyMapInventoryPoolButtons( TRUE );
}
DoMessageBox( MSG_BOX_BASIC_STYLE, NewInvMessage[NIV_SELL_ALL], guiCurrentScreen, ( UINT8 )MSG_BOX_FLAG_YESNO, BeginSellAllCallBack, NULL );
if(fShowMapInventoryPool)
{
fShowMapInventoryPool = FALSE;
}
}
}
}