mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-16 16:55:27 +00:00
fix(inventory): UpdateInventoryGroupContents CLEAR empties the group, as the client
LWOInventoryComponent_Common::msgUpdateInventoryGroupContents (0x00ce1f50) takes ADD, REMOVE and CLEAR; CLEAR removes every LOT from the group. The server logged CLEAR as an invalid action and kept the LOTs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2032,6 +2032,10 @@ void InventoryComponent::UpdateGroup(const GroupUpdate& groupUpdate) {
|
||||
groupItr->lots.erase(groupUpdate.lot);
|
||||
break;
|
||||
}
|
||||
case GroupUpdateCommand::CLEAR_LOTS: {
|
||||
groupItr->lots.clear();
|
||||
break;
|
||||
}
|
||||
case GroupUpdateCommand::MODIFY: {
|
||||
groupItr->groupName = groupUpdate.groupName;
|
||||
break;
|
||||
@@ -2420,6 +2424,7 @@ void InventoryComponent::OnUpdateInventoryGroupContents(const GameMessages::Upda
|
||||
|
||||
if (msg.action == "ADD") groupUpdate.command = GroupUpdateCommand::ADD_LOT;
|
||||
else if (msg.action == "REMOVE") groupUpdate.command = GroupUpdateCommand::REMOVE_LOT;
|
||||
else if (msg.action == "CLEAR") groupUpdate.command = GroupUpdateCommand::CLEAR_LOTS;
|
||||
else {
|
||||
LOG("Invalid action %s", msg.action.c_str());
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user