mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
CTRL+LeftClick on an item with an attachment in the hand cursor would attach it without any AP costs. Now the game will deduct the correct attachment AP.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6974 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3946,7 +3946,16 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
|
|
||||||
for (UINT8 i = 0; i<cnt;i++)
|
for (UINT8 i = 0; i<cnt;i++)
|
||||||
{
|
{
|
||||||
gpSMCurrentMerc->inv[ uiHandPos ].AttachObject(gpSMCurrentMerc,gpItemPointer,TRUE,i);
|
// silversurfer: This didn't cost any AP. Why? CTRL + LeftClick should deduct the same AP as manual attachment in the EDB.
|
||||||
|
usCostToMoveItem = AttachmentAPCost( gpItemPointer->usItem, gpSMCurrentMerc->inv[ uiHandPos ].usItem, gpSMCurrentMerc );
|
||||||
|
// Flugente: backgrounds
|
||||||
|
usCostToMoveItem = (usCostToMoveItem * (100 + gpSMCurrentMerc->GetBackgroundValue(BG_INVENTORY))) / 100;
|
||||||
|
// do we have enough AP?
|
||||||
|
if ( !EnoughPoints( gpSMCurrentMerc, usCostToMoveItem, 0, FALSE ) )
|
||||||
|
return;
|
||||||
|
// only deduct AP if attachment was placed successfully.
|
||||||
|
if ( gpSMCurrentMerc->inv[ uiHandPos ].AttachObject(gpSMCurrentMerc,gpItemPointer,TRUE,i) )
|
||||||
|
gpSMCurrentMerc->bActionPoints -= usCostToMoveItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user