mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-15 16:27:14 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user