mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Fix:
- large MOLLE pockets didn't display their volume in EDB - attaching a filled MOLLE pocket didn't show its contents. Now the contents will be removed and put in the soldiers inventory or on the ground if there is no space. Enhancement: Detaching filled MOLLE pockets is possible again. The contents will be moved to soldier inventory (if pocket was on the soldier before) or to the ground (in case of sector inventory manipulation). git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7788 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+40
-1
@@ -4907,7 +4907,46 @@ BOOLEAN OBJECTTYPE::AttachObjectNAS( SOLDIERTYPE * pSoldier, OBJECTTYPE * pAttac
|
||||
pAttachment->MoveThisObjectTo(attachmentObject,1,pSoldier,NUM_INV_SLOTS,1);
|
||||
}
|
||||
} else {
|
||||
pAttachment->MoveThisObjectTo(attachmentObject,1,pSoldier,NUM_INV_SLOTS,1);
|
||||
// if this is an active LBE (holding an item) it must be a MOLLE pocket. We need to move the item out of this pocket or it will be invisible.
|
||||
if ( pAttachment->IsActiveLBE(subObject) )
|
||||
{
|
||||
std::vector<INT8> LBESlots;
|
||||
switch( LoadBearingEquipment[Item[pAttachment->usItem].ubClassIndex].lbeClass )
|
||||
{
|
||||
case THIGH_PACK:
|
||||
GetLBESlots( LTHIGHPOCKPOS, LBESlots );
|
||||
break;
|
||||
case VEST_PACK:
|
||||
GetLBESlots( VESTPOCKPOS, LBESlots );
|
||||
break;
|
||||
case COMBAT_PACK:
|
||||
GetLBESlots( CPACKPOCKPOS, LBESlots );
|
||||
break;
|
||||
case BACKPACK:
|
||||
GetLBESlots( BPACKPOCKPOS, LBESlots );
|
||||
break;
|
||||
// this should never happen
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
LBENODE* pLBE = pAttachment->GetLBEPointer(0);
|
||||
for(unsigned int i=0; i<LBESlots.size(); i++)
|
||||
{
|
||||
// Is there an item in this LBE pocket?
|
||||
if( pLBE->inv[i].exists() )
|
||||
{
|
||||
// place in soldiers inventory
|
||||
if( !AutoPlaceObject(pSoldier, &pLBE->inv[i], FALSE) )
|
||||
// that didn't work. Place it on the ground instead.
|
||||
AutoPlaceObjectToWorld( pSoldier, &pLBE->inv[i], TRUE );
|
||||
}
|
||||
}
|
||||
// finished removing items. Now attach the MOLLE pocket to its carrier.
|
||||
pAttachment->MoveThisObjectTo(attachmentObject,1,pSoldier,NUM_INV_SLOTS,1);
|
||||
}
|
||||
else
|
||||
pAttachment->MoveThisObjectTo(attachmentObject,1,pSoldier,NUM_INV_SLOTS,1);
|
||||
}
|
||||
|
||||
//WarmSteel - Because we want every attachment to stay in place in NAS, we must first delete the "null" attachment, then insert the new one.
|
||||
|
||||
Reference in New Issue
Block a user