mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Merged from revision: 7290
- Fixed inaccessible or lost items for moving items from mercs to sector inventory when a different tactical map is loaded (by Buggler & anv) - Revert fix on queen reinforcement pool being replenished on depletion when playing with limited enemy troops setting (by Buggler) git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7291 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1592,11 +1592,30 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// HEADROCK HAM 5: A LOT of functions rely on these flags being set. So set them!!
|
||||
pInventoryPoolList[(iCurrentInventoryPoolPage*MAP_INVENTORY_POOL_SLOT_COUNT)+iCounter].bVisible = TRUE;
|
||||
pInventoryPoolList[(iCurrentInventoryPoolPage*MAP_INVENTORY_POOL_SLOT_COUNT)+iCounter].fExists = TRUE;
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ)//dnl ch51 091009
|
||||
|
||||
/*if(gGameExternalOptions.fEnableInventoryPoolQ)//dnl ch51 091009
|
||||
{
|
||||
if(!GridNoOnVisibleWorldTile(sObjectSourceGridNo))
|
||||
sObjectSourceGridNo = gMapInformation.sCenterGridNo;
|
||||
}
|
||||
}*/
|
||||
|
||||
// set a grid no for item from mercs with invalid grid no in sector inventory, e.g. merc arriving in sector with a different tactical map loaded
|
||||
if(!GridNoOnVisibleWorldTile(sObjectSourceGridNo))
|
||||
{
|
||||
// use the grid no of the first visible, reachable item
|
||||
for(UINT32 i = 0; i < pInventoryPoolList.size(); i++ )
|
||||
{
|
||||
if( pInventoryPoolList[i].bVisible == 1 && pInventoryPoolList[i].fExists == TRUE && pInventoryPoolList[i].usFlags & WORLD_ITEM_REACHABLE )
|
||||
{
|
||||
sObjectSourceGridNo = pInventoryPoolList[i].sGridNo;
|
||||
break;
|
||||
}
|
||||
|
||||
// empty sector to use the center grid no of the loaded tactical sector, hope that it's accessible
|
||||
if(!GridNoOnVisibleWorldTile(sObjectSourceGridNo))
|
||||
sObjectSourceGridNo = gMapInformation.sCenterGridNo;
|
||||
}
|
||||
}
|
||||
|
||||
//CHRISL: Make sure we put the item at the same level as the merc
|
||||
if(gpItemPointerSoldier->exists() == true)
|
||||
@@ -2492,7 +2511,7 @@ BOOLEAN AutoPlaceObjectInInventoryStash( OBJECTTYPE *pItemPtr, INT32 sGridNo )
|
||||
if(sGridNo != 0)
|
||||
{
|
||||
pInventoryPoolList[cnt].sGridNo = sGridNo;
|
||||
pInventoryPoolList[cnt].usFlags = 512;
|
||||
pInventoryPoolList[cnt].usFlags |= WORLD_ITEM_REACHABLE;
|
||||
pInventoryPoolList[cnt].bVisible = 1;
|
||||
pInventoryPoolList[cnt].fExists = TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user