Possible fix for the intermittent sector inventory right-click issue.

Fixed the display AP cost for shooting (when you also have to change facing and/or ready a weapon) so that it correctly matches the APs that are really charged.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2298 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-08-08 23:26:20 +00:00
parent a1a00fbf59
commit 382fff0437
4 changed files with 87 additions and 30 deletions
@@ -835,20 +835,36 @@ 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))
{
if(OK_CONTROLLABLE_MERC( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] ))
{
if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1)
{
fShowInventoryFlag = TRUE;
MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
}
else if(gpItemPointer == NULL || gpItemPointer->usItem == twItem->object.usItem || ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE || ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE)
{
InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
fTeamPanelDirty=TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
//CHRISL: The old setup had a flaw I didn't consider. if, for some reason, the ItemSlotLimit = 0
// nothing might happen. Now we setup a flag to determine if our cursor is value for the item we're
// clicking on. If it's not valid, we can't do anything so all conditions rely on it being true.
//if(ItemSlotLimit( &twItem->object, STACK_SIZE_LIMIT ) == 1)
if(gpItemPointer == NULL)
fValidPointer = true;
else
{
if(gpItemPointer->usItem == twItem->object.usItem)
fValidPointer = true;
if(ValidAttachment(gpItemPointer->usItem, twItem->object.usItem) == TRUE)
fValidPointer = true;
if(ValidAmmoType(twItem->object.usItem, gpItemPointer->usItem) == TRUE)
fValidPointer = true;
}
if(twItem->object.ubNumberOfObjects == 1 && fValidPointer)
{
fShowInventoryFlag = TRUE;
MAPInternalInitItemDescriptionBox( &twItem->object, 0, MercPtrs[gCharactersList[bSelectedInfoChar].usSolID] );
}
else if(fValidPointer)
{
InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
fTeamPanelDirty=TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
}
}
}