Merged from revision: 7219

Fixes (anv & Buggler)
- fix: backpacks stacked in the same sector inventory slot would share ownership, causing soldier to pick-up both of them, now when stacking ownership is automatically disabled,
- fix: when manually reorganizing backpacks in inventory slots, ownerships are properly swapped too,
- fix: when using auto pick-up backpack feature function was looping through non-existing items in sector inventory, possibly creating duplicates,
- fix: "drop all backpacks" feature was limited to 18 mercs, now it works for all player-controlled characters.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7220 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-05-19 19:00:14 +00:00
parent f05dfc0b1e
commit 0fcbed45b3
2 changed files with 47 additions and 7 deletions
+2 -2
View File
@@ -4374,7 +4374,7 @@ BOOLEAN ChangeDropPackStatus(SOLDIERTYPE *pSoldier, BOOLEAN newStatus)
// have a CTD, so lets resolve that here.
if(Item[gWorldItems[wi].object.usItem].usItemClass != IC_LBEGEAR)
gWorldItems[wi].soldierID = -1;
if(gWorldItems[wi].soldierID == pSoldier->ubID && gWorldItems[wi].object.exists() == true && Item[gWorldItems[wi].object.usItem].usItemClass == IC_LBEGEAR && LoadBearingEquipment[Item[gWorldItems[wi].object.usItem].ubClassIndex].lbeClass == BACKPACK)
if(gWorldItems[wi].soldierID == pSoldier->ubID && gWorldItems[wi].fExists == TRUE && Item[gWorldItems[wi].object.usItem].usItemClass == IC_LBEGEAR && LoadBearingEquipment[Item[gWorldItems[wi].object.usItem].ubClassIndex].lbeClass == BACKPACK)
{
for (int x = 0; x < gWorldItems[wi].object.ubNumberOfObjects; ++x) {
// Is the item we dropped in this sector and does it have an active LBENODE flag?
@@ -4653,7 +4653,7 @@ void BtnDropPackCallback(GUI_BUTTON *btn,INT32 reason)
if ( _KeyDown( SHIFT ) )
{
INT8 bAssignment = gpSMCurrentMerc->bAssignment;
for(int x=0; x<18; x++)
for( int x = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; x <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; x++ )
{
/* Is DropPackFlag currently false and is there something in the backpack pocket? If so, we haven't
dropped a pack yet and apparently want to*/