BUGFIX 551: Prior fix would allow items to be auto placed into the wrong sector if you had a sector inventory panel already open. The code should now realize that the wrong sector inventory screen is displayed, close that screen, switch to the correct sector, and then open the sector inventory panel before placing the item into sector inventory.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4573 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2011-07-14 16:46:14 +00:00
parent 49a7405861
commit 75e797f9ae
2 changed files with 19 additions and 0 deletions
+12
View File
@@ -1008,6 +1008,18 @@ void DumpSectorDifficultyInfo( void );
void DumpItemsList( void );
#endif
BOOLEAN IsMercInActiveSector(SOLDIERTYPE * pSoldier)
{
if(pSoldier->sSectorX != sSelMapX)
return( FALSE );
if(pSoldier->sSectorY != sSelMapY)
return( FALSE );
if(pSoldier->bSectorZ != iCurrentMapSectorZ)
return( FALSE );
return( TRUE );
}
void BeginSellAllCallBack( UINT8 bExitValue )
{
INT32 iPrice = 0;
+7
View File
@@ -6283,6 +6283,7 @@ BOOLEAN AutoPlaceObjectAnywhere(SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, BOOLE
return FALSE;
}
extern BOOLEAN IsMercInActiveSector(SOLDIERTYPE * pSoldier);
extern void CreateDestroyMapInventoryPoolButtons( BOOLEAN fExitFromMapScreen );
BOOLEAN AutoPlaceObjectToWorld(SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, INT8 bVisible)
{
@@ -6294,6 +6295,12 @@ BOOLEAN AutoPlaceObjectToWorld(SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, INT8 b
if( guiCurrentScreen == MAP_SCREEN )
{
if(fShowMapInventoryPool && !IsMercInActiveSector(pSoldier) )
{
fShowMapInventoryPool = FALSE;
CreateDestroyMapInventoryPoolButtons(FALSE);
}
ChangeSelectedMapSector(pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ);
if(!fShowMapInventoryPool)
{
fShowMapInventoryPool = TRUE;