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:
silversurfer
2014-02-25 09:13:39 +00:00
parent f00bc1aa14
commit 4ba2976817
+10 -1
View File
@@ -3946,7 +3946,16 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
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;
}
}
}