From: <ral...@us...> - 2015-01-03 04:24:37
|
Revision: 9688 http://sourceforge.net/p/planeshift/code/9688 Author: ralphcampbell Date: 2015-01-03 04:24:29 +0000 (Sat, 03 Jan 2015) Log Message: ----------- Fix 6728 - Attacking with two-handed items also gives attacks with Melee Modified Paths: -------------- trunk/src/server/bulkobjects/pscharinventory.cpp Modified: trunk/src/server/bulkobjects/pscharinventory.cpp =================================================================== --- trunk/src/server/bulkobjects/pscharinventory.cpp 2015-01-01 06:35:39 UTC (rev 9687) +++ trunk/src/server/bulkobjects/pscharinventory.cpp 2015-01-03 04:24:29 UTC (rev 9688) @@ -1287,6 +1287,16 @@ if(equipment[slot].itemIndexEquipped==0 && (equipment[slot].EquipmentFlags & PSCHARACTER_EQUIPMENTFLAG_ATTACKIFEMPTY)) { + // but not if other hand is holding an item that + // requires both hands. + INVENTORY_SLOT_NUMBER otherSlot = + slot == PSCHARACTER_SLOT_RIGHTHAND ? + PSCHARACTER_SLOT_LEFTHAND : PSCHARACTER_SLOT_RIGHTHAND; + if(equipment[otherSlot].itemIndexEquipped==0) + return true; + psItem* item = inventory[equipment[otherSlot].itemIndexEquipped].item; + if(item->FitsInSlot(PSCHARACTER_SLOT_BOTHHANDS)) + return false; return true; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |