mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Bugfixes (by Buggler)
- Fixed shopkeeper ignoring stack prices - Fixed missing initialize for uiDiscountValue - Fixed auto-attach in tactical screen for equipped slots git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6371 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3516,32 +3516,6 @@ BOOLEAN HandleNailsVestFetish( SOLDIERTYPE *pSoldier, UINT32 uiHandPos, UINT16 u
|
|||||||
|
|
||||||
BOOLEAN UIHandleItemPlacement( UINT8 ubHandPos, UINT16 usOldItemIndex, UINT16 usNewItemIndex, BOOLEAN fDeductPoints )
|
BOOLEAN UIHandleItemPlacement( UINT8 ubHandPos, UINT16 usOldItemIndex, UINT16 usNewItemIndex, BOOLEAN fDeductPoints )
|
||||||
{
|
{
|
||||||
if ( _KeyDown(CTRL) )
|
|
||||||
{
|
|
||||||
if ( gpItemPointer->exists() && gpSMCurrentMerc->inv[ ubHandPos ].exists() )
|
|
||||||
{
|
|
||||||
if ( gpItemPointer->usItem == gpSMCurrentMerc->inv[ ubHandPos ].usItem )
|
|
||||||
CleanUpStack( &( gpSMCurrentMerc->inv[ ubHandPos ] ), gpItemPointer );
|
|
||||||
else // Madd: attach / merge object, merge only works on single objects for now
|
|
||||||
{
|
|
||||||
UINT8 cnt = gpSMCurrentMerc->inv[ ubHandPos ].ubNumberOfObjects;
|
|
||||||
if ( gpItemPointer->ubNumberOfObjects < cnt )
|
|
||||||
cnt = gpItemPointer->ubNumberOfObjects;
|
|
||||||
|
|
||||||
for (UINT8 i = 0; i<cnt;i++)
|
|
||||||
{
|
|
||||||
gpSMCurrentMerc->inv[ ubHandPos ].AttachObject(gpSMCurrentMerc,gpItemPointer,TRUE,i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( gpItemPointer->exists() == false )
|
|
||||||
{
|
|
||||||
EndItemPointer( );
|
|
||||||
}
|
|
||||||
return( TRUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to place here
|
// Try to place here
|
||||||
if ( PlaceObject( gpSMCurrentMerc, ubHandPos, gpItemPointer ) )
|
if ( PlaceObject( gpSMCurrentMerc, ubHandPos, gpItemPointer ) )
|
||||||
{
|
{
|
||||||
@@ -3943,14 +3917,40 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
|
|
||||||
if ( fOKToGo )
|
if ( fOKToGo )
|
||||||
{
|
{
|
||||||
|
usOldItemIndex = gpSMCurrentMerc->inv[ uiHandPos ].usItem;
|
||||||
|
usNewItemIndex = gpItemPointer->usItem;
|
||||||
|
|
||||||
// OK, check if this is Nails, and we're in the vest position , don't allow it to come off....
|
// OK, check if this is Nails, and we're in the vest position , don't allow it to come off....
|
||||||
if ( HandleNailsVestFetish( gpSMCurrentMerc, uiHandPos, gpItemPointer->usItem ) )
|
if ( HandleNailsVestFetish( gpSMCurrentMerc, uiHandPos, usNewItemIndex ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
usOldItemIndex = gpSMCurrentMerc->inv[ uiHandPos ].usItem;
|
if ( _KeyDown(CTRL) )
|
||||||
usNewItemIndex = gpItemPointer->usItem;
|
{
|
||||||
|
if ( gpItemPointer->exists() && gpSMCurrentMerc->inv[ uiHandPos ].exists() )
|
||||||
|
{
|
||||||
|
if ( gpItemPointer->usItem == gpSMCurrentMerc->inv[ uiHandPos ].usItem )
|
||||||
|
CleanUpStack( &( gpSMCurrentMerc->inv[ uiHandPos ] ), gpItemPointer );
|
||||||
|
else // Madd: attach / merge object, merge only works on single objects for now
|
||||||
|
{
|
||||||
|
UINT8 cnt = gpSMCurrentMerc->inv[ uiHandPos ].ubNumberOfObjects;
|
||||||
|
if ( gpItemPointer->ubNumberOfObjects < cnt )
|
||||||
|
cnt = gpItemPointer->ubNumberOfObjects;
|
||||||
|
|
||||||
|
for (UINT8 i = 0; i<cnt;i++)
|
||||||
|
{
|
||||||
|
gpSMCurrentMerc->inv[ uiHandPos ].AttachObject(gpSMCurrentMerc,gpItemPointer,TRUE,i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( gpItemPointer->exists() == false )
|
||||||
|
{
|
||||||
|
EndItemPointer( );
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( uiHandPos == HANDPOS || uiHandPos == SECONDHANDPOS || uiHandPos == HELMETPOS || uiHandPos == VESTPOS || uiHandPos == LEGPOS )
|
if ( uiHandPos == HANDPOS || uiHandPos == SECONDHANDPOS || uiHandPos == HELMETPOS || uiHandPos == VESTPOS || uiHandPos == LEGPOS )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3275,7 +3275,7 @@ UINT32 CalcShopKeeperItemPrice( BOOLEAN fDealerSelling, BOOLEAN fUnitPriceOnly,
|
|||||||
UINT8 ubCnt;
|
UINT8 ubCnt;
|
||||||
UINT32 uiUnitPrice = 0;
|
UINT32 uiUnitPrice = 0;
|
||||||
UINT32 uiTotalPrice = 0;
|
UINT32 uiTotalPrice = 0;
|
||||||
UINT32 uiDiscountValue;
|
UINT32 uiDiscountValue = 0;
|
||||||
// UINT32 uiDifFrom10 = 0;
|
// UINT32 uiDifFrom10 = 0;
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
UINT8 ubItemsNotCounted = 0; //ja25 UB
|
UINT8 ubItemsNotCounted = 0; //ja25 UB
|
||||||
@@ -3387,7 +3387,6 @@ UINT8 ubItemsNotCounted = 0; //ja25 UB
|
|||||||
// and sells for more!
|
// and sells for more!
|
||||||
uiItemPrice[ubCnt] += uiDiscountValue;
|
uiItemPrice[ubCnt] += uiDiscountValue;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
// Flugente: backgrounds
|
// Flugente: backgrounds
|
||||||
else if ( Item [ usItemID ].usItemClass & (IC_MAPFILTER_MELEE|IC_MAPFILTER_KIT|IC_MAPFILTER_LBE|IC_MAPFILTER_ARMOR|IC_MAPFILTER_MISC) )
|
else if ( Item [ usItemID ].usItemClass & (IC_MAPFILTER_MELEE|IC_MAPFILTER_KIT|IC_MAPFILTER_LBE|IC_MAPFILTER_ARMOR|IC_MAPFILTER_MISC) )
|
||||||
@@ -3404,7 +3403,6 @@ UINT8 ubItemsNotCounted = 0; //ja25 UB
|
|||||||
// and sell for more!
|
// and sell for more!
|
||||||
uiItemPrice[ubCnt] += uiDiscountValue;
|
uiItemPrice[ubCnt] += uiDiscountValue;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if it's the dealer selling this, make sure the item is worth at least $1
|
// if it's the dealer selling this, make sure the item is worth at least $1
|
||||||
|
|||||||
Reference in New Issue
Block a user