fix(inventory): the ridden object and the mount item can't be deleted, as the client

LWOInventoryComponent_Common::CanRemoveFromInventory (0x00ce0d20) refuses
the possessed object (GetPossessedObject) and the mount item
(GetMountInventoryID) before the operator bypass and the deletion
restrictions. The server let a player delete the mount they were riding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-10-02 10:21:15 -05:00
parent ea875d859c
commit 5bf637b02e
3 changed files with 22 additions and 1 deletions

View File

@@ -2405,6 +2405,10 @@ namespace {
}
bool InventoryComponent::CanDelete(const Item& item) const {
// The object being ridden and the mount item are never deleted, not even by operators
const auto* const possessor = m_Parent->GetComponent<PossessorComponent>();
if (possessor && (possessor->GetPossessable() == item.GetId() || possessor->GetMountItemID() == item.GetId())) return false;
if (m_Parent->GetGMLevel() == eGameMasterLevel::OPERATOR) return true;
const auto row = static_cast<int32_t>(item.GetInfo().delResIndex);