Repository navigation
feat: deletion restrictions - #1611
Draft
aronwk-aaron wants to merge 1 commit into
Draft
aronwk-aaron wants to merge 1 commit into
aronwk-aaron wants to merge 1 commit into
Conversation
EmosewaMC
reviewed
Jun 7, 2024
| void LoadValuesFromDatabase(); | ||
| const CDDeletionRestriction& GetByID(uint32_t id); | ||
|
|
||
| static CDDeletionRestriction Default; |
Collaborator
There was a problem hiding this comment.
It would be great if this could be not public, and instead use a getter which returns a const reference to a default struct so this cannot be modified accidentally, alongside removing a static variable in place for a static function and an unnamed namespace member.
Member
Author
There was a problem hiding this comment.
Tell that to itemComponentTable
Collaborator
|
thank you for adding the new table! Let's try and clean it up a bit since I know our table reading in other places is quite messy and tends to spider web to other tables. Some extra feedback was left on the logic for the check as well :) |
aronwk-aaron
force-pushed
the
issue-960
branch
from
October 17, 2026 02:08
bf58cf8 to
d2d5e5b
Compare
Deleting an item now follows the item's DeletionRestrictions row (ItemComponent.delResIndex), as the client's LWOInventoryComponent_Common::CanRemoveFromInventory (0x00ce0d20) and CheckDeletionRestrictionIndex (0x00c94c20) do: an item the player is driving or riding can't be deleted, an operator can delete anything, and otherwise the row decides: - LOTS_INCLUDED: only while the player has another item of any of the LOTs (the last rocket can't be deleted) - LOTS_EXCLUDED: only while the player has other items of all of the LOTs - ANY_RESTRICTION / ALL_RESTRICTIONS: any / all of the listed rows allow it (a row that names itself again allows it) - ZONE: only in the listed zones - ALWAYS_RESTRICTED: never A missing, unrestricted or bad row (no valid ids, unknown check type) allows it. The client checks first and shows the row's failure reason; the server checks again and ignores a client's forceDeletion. Refs issue 960 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aronwk-aaron
force-pushed
the
issue-960
branch
from
October 17, 2026 02:10
d2d5e5b to
221dd36
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On behalf of @aronwk-aaron (written by Claude).
Deleting an item now follows the item's
DeletionRestrictionsrow (ItemComponent.delResIndex), as the client'sLWOInventoryComponent_Common::CanRemoveFromInventory(0x00ce0d20) andCheckDeletionRestrictionIndex(0x00c94c20) do. This is what keeps a player from deleting their last rocket and getting stranded.LOTS_INCLUDED: only while the player has another item of any of the LOTs (rows 1-3: the rocket and its parts)LOTS_EXCLUDED: only while the player has other items of all of the LOTsANY_RESTRICTION/ALL_RESTRICTIONS: any / all of the listed rows allow it (a row that names itself again allows it)ZONE: only in the listed zonesALWAYS_RESTRICTED: neverHandleRemoveItemFromInventorychecks again and ignores a client'sforceDeletion.Tests cover each check type, row combinations, a self-referencing row and bad rows.
Refs issue 960
🤖 Generated with Claude Code