Fix: Inventory popups for LBE slots didn't work properly. LBE slots are supposed to return a pocket type of -1 because they are no pockets. Instead they returned 2 (Knife pocket).

Fix: Inventory slots didn't show possible item amount anymore since r7600.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7619 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-10-30 16:11:24 +00:00
parent 4e1c24c2d0
commit 08af7cca36
+12 -9
View File
@@ -1767,7 +1767,8 @@ INT16 pocketTypeInSlot(SOLDIERTYPE *pSoldier, INT16 sPocket){
: LoadBearingEquipment[Item[pSoldier->inv[icLBE[sPocket]].usItem].ubClassIndex].lbePocketIndex[icPocket[sPocket]]; : LoadBearingEquipment[Item[pSoldier->inv[icLBE[sPocket]].usItem].ubClassIndex].lbePocketIndex[icPocket[sPocket]];
break; break;
case LBE_POCKET: // silversurfer: LBE slots are NOT pockets!
/* case LBE_POCKET:
if ( sPocket == VESTPOCKPOS ) if ( sPocket == VESTPOCKPOS )
lbePocket = 0; lbePocket = 0;
else if ( sPocket == LTHIGHPOCKPOS ) else if ( sPocket == LTHIGHPOCKPOS )
@@ -1779,11 +1780,13 @@ INT16 pocketTypeInSlot(SOLDIERTYPE *pSoldier, INT16 sPocket){
else if ( sPocket == BPACKPOCKPOS ) else if ( sPocket == BPACKPOCKPOS )
lbePocket = 4; lbePocket = 4;
break;*/
case OTHER_POCKET: case OTHER_POCKET:
if ( sPocket == GUNSLINGPOCKPOS ) // Gun Sling if ( sPocket == GUNSLINGPOCKPOS ) // Gun Sling
lbePocket = 1; lbePocket = 1;
else else // Knife
lbePocket = 2; lbePocket = 2;
break; break;
@@ -2332,7 +2335,7 @@ POPUP * createPopupForPocket( SOLDIERTYPE *pSoldier, INT16 sPocket ){
INT16 sX, sY; INT16 sX, sY;
// get pocket type under cursor // get pocket type under cursor
INT16 lbePocket = pocketTypeInSlot(pSoldier, sPocket); //INT16 lbePocket = pocketTypeInSlot(pSoldier, sPocket);
/* /*
if ( lbePocket != -1 ) { if ( lbePocket != -1 ) {
*/ */
@@ -2702,7 +2705,7 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
} }
else if ( !gfSMDisableForItems ) else if ( !gfSMDisableForItems )
{ {
if ( gpItemPointer != NULL && !CanItemFitInPosition( pSoldier, gpItemPointer, (INT8)sPocket, FALSE ) ) if ( gpItemPointer != NULL )
{ {
// CHRISL: Display pocket capacity if we're holding something in the cursor // CHRISL: Display pocket capacity if we're holding something in the cursor
if ( UsingNewInventorySystem( ) ) if ( UsingNewInventorySystem( ) )
@@ -2717,15 +2720,15 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
} }
// CHRISL: Change whether we hatch a pocket to be dependant on the current item // CHRISL: Change whether we hatch a pocket to be dependant on the current item
if ( (!UsingNewAttachmentSystem( ) && !ValidAttachment( gpItemPointer->usItem, pObject )) || if ( CanItemFitInPosition( pSoldier, gpItemPointer, (INT8)sPocket, FALSE ) )
{
fHatchItOut = FALSE;
}
else if (!UsingNewAttachmentSystem( ) && !ValidAttachment( gpItemPointer->usItem, pObject ) ||
(UsingNewAttachmentSystem( ) && !ValidItemAttachmentSlot( pObject, gpItemPointer->usItem, FALSE, FALSE )) ) (UsingNewAttachmentSystem( ) && !ValidItemAttachmentSlot( pObject, gpItemPointer->usItem, FALSE, FALSE )) )
{ {
fHatchItOut = TRUE; fHatchItOut = TRUE;
} }
else
{
fHatchItOut = FALSE;
}
} }
else if ( pObject->exists( ) ) else if ( pObject->exists( ) )
{ {