Skip to content
Browse files

Fixed: Issue with stacking equipped items with ItemStackCheat (the ne…

…w one would overwrite the existing one's enchantments, random stats...) - now they are not stackable.
  • Loading branch information...
1 parent 0b6a566 commit f92977adf86ad12d379f139ba4653391e6df9aa9 Whoami committed Aug 26, 2009
Showing with 33 additions and 2 deletions.
  1. +33 −2 src/arcemu-world/ItemInterface.cpp
View
35 src/arcemu-world/ItemInterface.cpp
@@ -3004,8 +3004,39 @@ void ItemInterface::SwapItemSlots(int8 srcslot, int8 dstslot)
//else
// sLog.outDebug( "Destination: Empty" );
- uint32 srcItemMaxStack = (SrcItem) ? ((SrcItem->GetOwner()->ItemStackCheat) ? 0x7fffffff : SrcItem->GetProto()->MaxCount) : 0;
- uint32 dstItemMaxStack = (DstItem) ? ((DstItem->GetOwner()->ItemStackCheat) ? 0x7fffffff : DstItem->GetProto()->MaxCount) : 0;
+ // don't stack equipped items (even with ItemStackCheat), just swap them
+ uint32 srcItemMaxStack, dstItemMaxStack;
+ if( SrcItem != NULL )
+ {
+ if( srcslot < INVENTORY_SLOT_BAG_END || !(SrcItem->GetOwner()->ItemStackCheat) )
+ {
+ srcItemMaxStack = SrcItem->GetProto()->MaxCount;
+ }
+ else
+ {
+ srcItemMaxStack = 0x7fffffff;
+ }
+ }
+ else
+ {
+ srcItemMaxStack = 0;
+ }
+ if( DstItem != NULL )
+ {
+ if( dstslot < INVENTORY_SLOT_BAG_END || !(DstItem->GetOwner()->ItemStackCheat) )
+ {
+ dstItemMaxStack = DstItem->GetProto()->MaxCount;
+ }
+ else
+ {
+ dstItemMaxStack = 0x7fffffff;
+ }
+ }
+ else
+ {
+ dstItemMaxStack = 0;
+ }
+
if( SrcItem != NULL && DstItem != NULL && SrcItem->GetEntry()==DstItem->GetEntry() && srcItemMaxStack > 1 && SrcItem->wrapped_item_id == 0 && DstItem->wrapped_item_id == 0 )
{
uint32 total = SrcItem->GetUInt32Value( ITEM_FIELD_STACK_COUNT ) + DstItem->GetUInt32Value( ITEM_FIELD_STACK_COUNT );

0 comments on commit f92977a

Please sign in to comment.
Something went wrong with that request. Please try again.