mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
************************************************************
* Merged Source Code from Development Trunk: Revision 4063 * ************************************************************ - Source Code is merged from: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - This will be the Source for the Beta 2011 Test git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4064 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -849,7 +849,10 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
//CHRISL: Make it possible to right click and pull up stack popup and/or item description boxes
|
||||
WORLDITEM * twItem = &(pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ]);
|
||||
bool fValidPointer = false;
|
||||
if ( !InSectorStackPopup( ) && !InItemStackPopup( ) && !InItemDescriptionBox( ) && !InKeyRingPopup( ) && twItem->object.exists() == true && (bSelectedInfoChar != -1 && gCharactersList[bSelectedInfoChar].fValid))
|
||||
//CHRISL: Try to update InSector value so we don't have to "activate" a sector
|
||||
if(MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->sSectorX == sSelMapX && MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->sSectorY == sSelMapY && MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->bSectorZ == iCurrentMapSectorZ && !MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->flags.fBetweenSectors)
|
||||
MercPtrs[gCharactersList[bSelectedInfoChar].usSolID]->bInSector=TRUE;
|
||||
if ( !InSectorStackPopup( ) && !InItemStackPopup( ) /*&& !InItemDescriptionBox( ) */ && !InKeyRingPopup( ) && twItem->object.exists() == true && (bSelectedInfoChar != -1 && gCharactersList[bSelectedInfoChar].fValid))
|
||||
{
|
||||
if(OK_CONTROL_MERC( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ))
|
||||
{
|
||||
@@ -863,7 +866,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if(gpItemPointer->usItem == twItem->object.usItem)
|
||||
fValidPointer = true;
|
||||
if(ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE)
|
||||
if(ValidAttachment(gpItemPointer->usItem, &(twItem->object)) == TRUE)
|
||||
fValidPointer = true;
|
||||
if(ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE)
|
||||
fValidPointer = true;
|
||||
@@ -871,6 +874,12 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
if(twItem->object.ubNumberOfObjects == 1 && fValidPointer)
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
|
||||
if (InItemDescriptionBox( ))
|
||||
{
|
||||
DeleteItemDescriptionBox();
|
||||
}
|
||||
|
||||
MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
|
||||
}
|
||||
else if(fValidPointer)
|
||||
@@ -1007,6 +1016,17 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
usNewItemIndex = gpItemPointer->usItem;
|
||||
iOldNumberOfObjects = pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].object.ubNumberOfObjects;
|
||||
|
||||
//CHRISL: Allow CTRL+LMB to clean up stacks just like we do with personal inventory
|
||||
//Curretly, screen isn't automatically refreshing. You have to move your cursor after CTRL+LMB to see the results.
|
||||
if ( _KeyDown(CTRL) )
|
||||
{
|
||||
CleanUpStack( &( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].object ), gpItemPointer );
|
||||
if ( gpItemPointer->exists() == false )
|
||||
{
|
||||
MAPEndItemPointer( );
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Else, try to place here
|
||||
if ( PlaceObjectInInventoryStash( &( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].object ), gpItemPointer ) )
|
||||
@@ -2672,7 +2692,8 @@ INT32 SellItem( OBJECTTYPE& object, BOOLEAN useModifier )
|
||||
}
|
||||
iPrice += ( itemPrice * object[bLoop]->data.objectStatus / 100 );
|
||||
for (attachmentList::iterator iter = object[bLoop]->attachments.begin(); iter != object[bLoop]->attachments.end(); ++iter) {
|
||||
iPrice += SellItem(*iter, FALSE);
|
||||
if(iter->exists())
|
||||
iPrice += SellItem(*iter, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2683,7 +2704,8 @@ INT32 SellItem( OBJECTTYPE& object, BOOLEAN useModifier )
|
||||
{
|
||||
iPrice += ( itemPrice * object[bLoop]->data.objectStatus / 100 );
|
||||
for (attachmentList::iterator iter = object[bLoop]->attachments.begin(); iter != object[bLoop]->attachments.end(); ++iter) {
|
||||
iPrice += SellItem(*iter, FALSE);
|
||||
if(iter->exists())
|
||||
iPrice += SellItem(*iter, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user