mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
BUGFIX 536 - Fixed it so we don't lose items when attempting to hand an invalid item to an NPC.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4516 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -4206,12 +4206,15 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
else
|
||||
{
|
||||
//CHRISL: The item we're handing over potentially came from an inventory slot but was placed into the cursor. So why are we deleting any remaining
|
||||
// items left in the inventory slot we started from. When we moved the item from a stack into the cursor, we created a seperate stack and it's this
|
||||
// new stack we should be exclusively working with. Not the stack we took items from.
|
||||
// Erase!
|
||||
if ( bInvPos != NO_SLOT )
|
||||
{
|
||||
DeleteObj(&pSoldier->inv[ bInvPos ]);
|
||||
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
|
||||
}
|
||||
// if ( bInvPos != NO_SLOT )
|
||||
// {
|
||||
// DeleteObj(&pSoldier->inv[ bInvPos ]);
|
||||
// DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
|
||||
// }
|
||||
|
||||
// Now intiate conv
|
||||
InitiateConversation( pTSoldier, pSoldier, APPROACH_GIVINGITEM, (INT32)&gTempObject );
|
||||
|
||||
@@ -6353,15 +6353,16 @@ BOOLEAN HandleItemPointerClick( INT32 usMapPos )
|
||||
sAPCost = GetAPsToGiveItem( gpItemPointerSoldier, usMapPos );
|
||||
}
|
||||
|
||||
//CHRISL: This doesn't make sense to me. If we take an item out of a stack and then click on something, why would we first attempt to put the item
|
||||
// back in the stack we took it from. The item in the cursor should be recognized as a seperate stack at this point.
|
||||
// Place it back in our hands!
|
||||
|
||||
gTempObject = *gpItemPointer;
|
||||
|
||||
if ( gbItemPointerSrcSlot != NO_SLOT )
|
||||
{
|
||||
PlaceObject( gpItemPointerSoldier, gbItemPointerSrcSlot, gpItemPointer );
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
}
|
||||
// if ( gbItemPointerSrcSlot != NO_SLOT )
|
||||
// {
|
||||
// PlaceObject( gpItemPointerSoldier, gbItemPointerSrcSlot, gpItemPointer );
|
||||
// fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
// }
|
||||
/*
|
||||
//if the user just clicked on an arms dealer
|
||||
if( IsMercADealer( MercPtrs[ ubSoldierID ]->ubProfile ) )
|
||||
|
||||
Reference in New Issue
Block a user