summaryrefslogtreecommitdiff
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to 'src/net')
-rw-r--r--src/net/ea/inventoryitem.h22
-rw-r--r--src/net/eathena/inventoryrecv.cpp4
2 files changed, 25 insertions, 1 deletions
diff --git a/src/net/ea/inventoryitem.h b/src/net/ea/inventoryitem.h
index da0f63283..193500d60 100644
--- a/src/net/ea/inventoryitem.h
+++ b/src/net/ea/inventoryitem.h
@@ -92,11 +92,31 @@ class InventoryItem final
cards[f] = cards0[f];
}
+ InventoryItem(const InventoryItem &c) :
+ slot(c.slot),
+ id(c.id),
+ type(c.type),
+ cards(),
+ options(ItemOptionsList::copy(c.options)),
+ quantity(c.quantity),
+ refine(c.refine),
+ color(c.color),
+ identified(c.identified),
+ damaged(c.damaged),
+ favorite(c.favorite),
+ equip(c.equip)
+ {
+ if (!c.cards)
+ return;
+ for (int f = 0; f < 4; f ++)
+ cards[f] = c.cards[f];
+ }
+
A_DEFAULT_COPY(InventoryItem)
~InventoryItem()
{
- delete [] options;
+ delete options;
}
};
diff --git a/src/net/eathena/inventoryrecv.cpp b/src/net/eathena/inventoryrecv.cpp
index d068b674a..5403e773b 100644
--- a/src/net/eathena/inventoryrecv.cpp
+++ b/src/net/eathena/inventoryrecv.cpp
@@ -727,6 +727,7 @@ void InventoryRecv::processPlayerStorageEquip(Net::MessageIn &msg)
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),
Equipm_false));
+ delete options;
}
BLOCK_END("InventoryRecv::processPlayerStorageEquip")
}
@@ -787,6 +788,7 @@ void InventoryRecv::processPlayerStorageAdd(Net::MessageIn &msg)
Ea::InventoryRecv::mStorage->setOptions(index, options);
}
}
+ delete options;
BLOCK_END("InventoryRecv::processPlayerStorageAdd")
}
@@ -1009,6 +1011,7 @@ void InventoryRecv::processPlayerCartAdd(Net::MessageIn &msg)
Favorite_false,
Equipm_false));
}
+ delete options;
BLOCK_END("InventoryRecv::processPlayerCartAdd")
}
@@ -1091,6 +1094,7 @@ void InventoryRecv::processPlayerCartEquip(Net::MessageIn &msg)
fromBool(flags.bits.isDamaged, Damaged),
fromBool(flags.bits.isFavorite, Favorite),
Equipm_false));
+ delete options;
}
BLOCK_END("InventoryRecv::processPlayerCartEquip")
}