@@ -58,7 +58,7 @@ void Client::SendBulkParcels()
58
58
p.second .aug_slot_6
59
59
));
60
60
if (inst) {
61
- inst->SetCharges (p.second .quantity > 0 ? p. second . quantity : 1 );
61
+ inst->SetCharges (p.second .quantity );
62
62
inst->SetMerchantCount (1 );
63
63
inst->SetMerchantSlot (p.second .slot_id );
64
64
if (inst->IsStackable ()) {
@@ -161,7 +161,7 @@ void Client::SendParcel(Parcel_Struct &parcel_in)
161
161
p.aug_slot_6
162
162
));
163
163
if (inst) {
164
- inst->SetCharges (p.quantity > 0 ? p. quantity : 1 );
164
+ inst->SetCharges (p.quantity );
165
165
inst->SetMerchantCount (1 );
166
166
inst->SetMerchantSlot (p.slot_id );
167
167
if (inst->IsStackable ()) {
@@ -272,6 +272,10 @@ void Client::SendParcelStatus()
272
272
273
273
void Client::DoParcelSend (const Parcel_Struct *parcel_in)
274
274
{
275
+ if (IsCasting ()) {
276
+ StopCasting ();
277
+ }
278
+
275
279
auto send_to_client = CharacterParcelsRepository::GetParcelCountAndCharacterName (database, parcel_in->send_to );
276
280
auto merchant = entity_list.GetMob (parcel_in->npc_id );
277
281
if (!merchant) {
@@ -382,7 +386,7 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in)
382
386
quantity = parcel_in->quantity ;
383
387
}
384
388
else {
385
- quantity = inst->GetCharges () > 0 ? inst->GetCharges () : parcel_in->quantity ;
389
+ quantity = inst->GetCharges () >= 0 ? inst->GetCharges () : parcel_in->quantity ;
386
390
}
387
391
388
392
CharacterParcelsRepository::CharacterParcels parcel_out{};
@@ -434,13 +438,13 @@ void Client::DoParcelSend(const Parcel_Struct *parcel_in)
434
438
cpc.aug_slot_5 = augs.at (4 );
435
439
cpc.aug_slot_6 = augs.at (5 );
436
440
}
437
- cpc.quantity = kv.second ->GetCharges () > 0 ? kv.second ->GetCharges () : 1 ;
441
+ cpc.quantity = kv.second ->GetCharges () >= 0 ? kv.second ->GetCharges () : 1 ;
438
442
all_entries.push_back (cpc);
439
443
}
440
444
CharacterParcelsContainersRepository::InsertMany (database, all_entries);
441
445
}
442
446
443
- RemoveItemBySerialNumber (inst->GetSerialNumber (), parcel_out.quantity );
447
+ RemoveItemBySerialNumber (inst->GetSerialNumber (), parcel_out.quantity == 0 ? 1 : parcel_out. quantity );
444
448
std::unique_ptr<EQApplicationPacket> outapp (new EQApplicationPacket (OP_ShopSendParcel));
445
449
QueuePacket (outapp.get ());
446
450
@@ -642,9 +646,9 @@ void Client::DoParcelRetrieve(const ParcelRetrieve_Struct &parcel_in)
642
646
if (p != m_parcels.end ()) {
643
647
uint32 item_id = parcel_in.parcel_item_id ;
644
648
uint32 item_quantity = p->second .quantity ;
645
- if (!item_id || !item_quantity ) {
649
+ if (!item_id) {
646
650
LogError (
647
- " Attempt to retrieve parcel with erroneous item id or quantity for client character id {}." ,
651
+ " Attempt to retrieve parcel with erroneous item id for client character id {}." ,
648
652
CharacterID ()
649
653
);
650
654
SendParcelRetrieveAck ();
0 commit comments