mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-17 17:25:27 +00:00
fix(inventory): an opened package reports success in UseItemResult, as live
Item::UseNonEquip declared a second `success` inside the package branch, so the UseItemResult it sent (and its log line) was always false, even when the package opened and its contents were given. The client (LWOInventoryComponent_Client::sub_00c1bb20 (0x00c1bb20)) plays the item's audioEventUse on true and a failure sound on false; live sent true for 183 of the 187 UseItemResult in the captures. Test: UseItemResultTests.AnOpenedPackageReportsSuccess. Check in game: opening a package (e.g. a starter pack or a reward bag) plays its open sound rather than the failure sound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -384,7 +384,7 @@ void Item::UseNonEquip(Item* item) {
|
||||
auto* packCompTable = CDClientManager::GetTable<CDPackageComponentTable>();
|
||||
auto packages = packCompTable->Query([=](const CDPackageComponent entry) {return entry.id == static_cast<uint32_t>(packageComponentId); });
|
||||
|
||||
auto success = !packages.empty();
|
||||
success = !packages.empty();
|
||||
if (success) {
|
||||
if (this->GetPreconditionExpression()->Check(playerInventoryComponent->GetParent())) {
|
||||
auto* entityParent = playerInventoryComponent->GetParent();
|
||||
|
||||
Reference in New Issue
Block a user