[Bug Fix] Fix #parcels add subcommand (#4431)

The parcel object was not be initialized correctly resulting in the possibility of incorrect data being written for the uninitialized members.
This commit is contained in:
Mitch Freeman 2024-07-28 22:56:21 -03:00 committed by GitHub
parent 4c81321847
commit 6903205484
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -163,7 +163,7 @@ void command_parcels(Client *c, const Seperator *sep)
return;
}
CharacterParcelsRepository::CharacterParcels parcel_out;
auto parcel_out = CharacterParcelsRepository::NewEntity();
parcel_out.from_name = c->GetName();
parcel_out.note = note;
parcel_out.sent_date = time(nullptr);
@ -241,7 +241,7 @@ void command_parcels(Client *c, const Seperator *sep)
? inst->GetItem()->MaxCharges : (int16) quantity;
}
CharacterParcelsRepository::CharacterParcels parcel_out;
auto parcel_out = CharacterParcelsRepository::NewEntity();
parcel_out.from_name = c->GetName();
parcel_out.note = note.empty() ? "" : note;
parcel_out.sent_date = time(nullptr);