|
@@ -4069,11 +4069,13 @@ int8 PlayerItemList::FindFreeBankSlot() {
|
|
|
}
|
|
|
|
|
|
void PlayerItemList::ResetPackets() {
|
|
|
+ MPlayerItems.writelock(__FUNCTION__, __LINE__);
|
|
|
safe_delete_array(orig_packet);
|
|
|
safe_delete_array(xor_packet);
|
|
|
orig_packet = 0;
|
|
|
xor_packet = 0;
|
|
|
packet_count = 0;
|
|
|
+ MPlayerItems.writelock(__FUNCTION__, __LINE__);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -4177,10 +4179,12 @@ EquipmentItemList::~EquipmentItemList(){
|
|
|
}
|
|
|
|
|
|
void EquipmentItemList::ResetPackets() {
|
|
|
+ MEquipmentItems.lock();
|
|
|
safe_delete_array(orig_packet);
|
|
|
safe_delete_array(xor_packet);
|
|
|
orig_packet = 0;
|
|
|
xor_packet = 0;
|
|
|
+ MEquipmentItems.unlock();
|
|
|
}
|
|
|
|
|
|
bool EquipmentItemList::AddItem(int8 slot, Item* item){
|
|
@@ -4275,6 +4279,7 @@ EQ2Packet* EquipmentItemList::serialize(int16 version, Player* player){
|
|
|
EQ2Packet* app = 0;
|
|
|
Item* item = 0;
|
|
|
PacketStruct* packet = configReader.getStruct("WS_UpdateInventory", version);
|
|
|
+ MEquipmentItems.lock();
|
|
|
if(packet){
|
|
|
int8 packet_size = 0;
|
|
|
PacketStruct* packet2 = configReader.getStruct("Substruct_Item", version);
|
|
@@ -4288,7 +4293,6 @@ EQ2Packet* EquipmentItemList::serialize(int16 version, Player* player){
|
|
|
memset(xor_packet, 0, packet_size* num_slots);
|
|
|
memset(orig_packet, 0, packet_size* num_slots);
|
|
|
}
|
|
|
- MEquipmentItems.lock();
|
|
|
int32 menu_data = 3;
|
|
|
int32 effective_level = player->GetInfoStructUInt("effective_level");
|
|
|
|
|
@@ -4384,11 +4388,11 @@ EQ2Packet* EquipmentItemList::serialize(int16 version, Player* player){
|
|
|
}
|
|
|
packet->setSubstructArrayDataByName("items", "index", i, 0, i);
|
|
|
}
|
|
|
- MEquipmentItems.unlock();
|
|
|
packet->setDataByName("equip_flag", GetAppearanceType() ? 2 : 1);
|
|
|
app = packet->serializeCountPacket(version, 1, orig_packet, xor_packet);
|
|
|
safe_delete(packet);
|
|
|
}
|
|
|
+ MEquipmentItems.unlock();
|
|
|
return app;
|
|
|
}
|
|
|
ItemStatsValues* EquipmentItemList::CalculateEquipmentBonuses(Entity* entity){
|