mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +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;
|
||||
}
|
||||
|
||||
@@ -3313,7 +3313,6 @@ void EvaluateQueenSituation()
|
||||
break;
|
||||
}
|
||||
|
||||
/* // Buggler: Unlimited troops setting will have a constant pool value, limited troops setting should not be able to recruit new troops
|
||||
if( !giReinforcementPool )
|
||||
{ //Queen has run out of reinforcements. Simulate recruiting and training new troops
|
||||
uiOffset *= 10;
|
||||
@@ -3321,7 +3320,7 @@ void EvaluateQueenSituation()
|
||||
giReinforcementPool += ( gGameExternalOptions.guiBaseQueenPoolIncrement * gGameOptions.ubDifficultyLevel ) * ( 100 + CurrentPlayerProgressPercentage() ) / 100 ;
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, GetWorldTotalMin() + uiOffset, 0 );
|
||||
return;
|
||||
}*/
|
||||
}
|
||||
|
||||
//Re-post the event
|
||||
AddStrategicEvent( EVENT_EVALUATE_QUEEN_SITUATION, GetWorldTotalMin() + uiOffset, 0 );
|
||||
|
||||
@@ -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