mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +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:
@@ -6344,17 +6344,23 @@ void ItemDescAttachmentsCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
if( &(*iter) == pAttachment )
|
||||
{
|
||||
std::vector<UINT16> usAttachmentSlotIndexVector = GetItemSlots(gpItemDescObject);
|
||||
// if the attachments pocket is not empty then do not allow to remove this attachment
|
||||
|
||||
if( gpItemDescObject->IsActiveLBE(gubItemDescStatusIndex) ) // not worn by the soldier
|
||||
{
|
||||
LBENODE* pLBE = gpItemDescObject->GetLBEPointer(gubItemDescStatusIndex);
|
||||
// we have an item in this pocket
|
||||
if( pLBE->inv[(AttachmentSlots[usAttachmentSlotIndexVector[slotCount]].ubPocketMapping -1)].exists() )
|
||||
return;
|
||||
// place item on the ground
|
||||
AutoPlaceObjectToWorld(gpItemDescSoldier, &pLBE->inv[(AttachmentSlots[usAttachmentSlotIndexVector[slotCount]].ubPocketMapping -1)], TRUE);
|
||||
}
|
||||
else // the soldier is wearing the LBE
|
||||
{
|
||||
// we have an item in this pocket
|
||||
if( gpItemDescSoldier->inv[pocketKey[(AttachmentSlots[usAttachmentSlotIndexVector[slotCount]].ubPocketMapping -1)]].exists() )
|
||||
return;
|
||||
// place in soldiers inventory
|
||||
if( !AutoPlaceObject(gpItemDescSoldier, &gpItemDescSoldier->inv[pocketKey[(AttachmentSlots[usAttachmentSlotIndexVector[slotCount]].ubPocketMapping -1)]], FALSE) )
|
||||
// that didn't work. Place on ground instead.
|
||||
AutoPlaceObjectToWorld(gpItemDescSoldier, &gpItemDescSoldier->inv[pocketKey[(AttachmentSlots[usAttachmentSlotIndexVector[slotCount]].ubPocketMapping -1)]], TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user