mirror of
https://github.com/1dot13/source.git
synced 2026-08-05 14:00:23 +02:00
Fixed a bug in the "sell all" strategic inventory screen options. Money now gets sold without modification and unreachable items can't accidentally be sold.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2039 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+18
-15
@@ -1075,23 +1075,26 @@ void BeginSellAllCallBack( UINT8 bExitValue )
|
||||
}
|
||||
for(UINT32 wItem = 0; wItem < guiNumWorldItems; wItem++)
|
||||
{
|
||||
if(0 == pInventoryPoolList[wItem].object.MoveThisObjectTo(gItemPointer,-1,0,NUM_INV_SLOTS,MAX_OBJECTS_PER_SLOT))
|
||||
if(pInventoryPoolList[wItem].object.exists() == true && (pInventoryPoolList[wItem].usFlags & WORLD_ITEM_REACHABLE))
|
||||
{
|
||||
if (pInventoryPoolList[wItem].object.exists() == false) {
|
||||
pInventoryPoolList[wItem].object.initialize();
|
||||
if(0 == pInventoryPoolList[wItem].object.MoveThisObjectTo(gItemPointer,-1,0,NUM_INV_SLOTS,MAX_OBJECTS_PER_SLOT))
|
||||
{
|
||||
if (pInventoryPoolList[wItem].object.exists() == false) {
|
||||
pInventoryPoolList[wItem].object.initialize();
|
||||
}
|
||||
// Dirty interface
|
||||
fMapPanelDirty = TRUE;
|
||||
gpItemPointer = &gItemPointer;
|
||||
// Sell Item
|
||||
iPrice += SellItem( gItemPointer );
|
||||
gpItemPointer = NULL;
|
||||
fMapInventoryItem = FALSE;
|
||||
if (iPrice == 0) {
|
||||
iPrice = 1;
|
||||
}
|
||||
anythingSold = true;
|
||||
HandleButtonStatesWhileMapInventoryActive();
|
||||
}
|
||||
// Dirty interface
|
||||
fMapPanelDirty = TRUE;
|
||||
gpItemPointer = &gItemPointer;
|
||||
// Sell Item
|
||||
iPrice += SellItem( gItemPointer );
|
||||
gpItemPointer = NULL;
|
||||
fMapInventoryItem = FALSE;
|
||||
if (iPrice == 0) {
|
||||
iPrice = 1;
|
||||
}
|
||||
anythingSold = true;
|
||||
HandleButtonStatesWhileMapInventoryActive();
|
||||
}
|
||||
}
|
||||
if(anythingSold == true)
|
||||
|
||||
Reference in New Issue
Block a user