mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
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:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user