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:
@@ -59,6 +59,7 @@
|
||||
#include "Sys Globals.h"//dnl ch74 201013
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
#include "DisplayCover.h" // added by Flugente
|
||||
#include "Map Information.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
@@ -6919,6 +6920,25 @@ BOOLEAN AutoPlaceObjectToWorld(SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, INT8 b
|
||||
fShowMapInventoryPool = TRUE;
|
||||
CreateDestroyMapInventoryPoolButtons(FALSE);
|
||||
}
|
||||
|
||||
// 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(sGridNo))
|
||||
{
|
||||
// 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 )
|
||||
{
|
||||
sGridNo = pInventoryPoolList[i].sGridNo;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// empty sector to use the center grid no of the loaded tactical sector, hope that it's accessible
|
||||
if(!GridNoOnVisibleWorldTile(sGridNo))
|
||||
sGridNo = gMapInformation.sCenterGridNo;
|
||||
}
|
||||
|
||||
fMapPanelDirty = TRUE;
|
||||
return( AutoPlaceObjectInInventoryStash(pObj, sGridNo) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user