fix: prevent removal of items without expiry time in itemcollection sort - #546
Conversation
WalkthroughThis change updates the Changes
Estimated code review effort1 (~2 minutes) Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
Maple2.Server.Game/Manager/Items/InventoryManager.cs (2)
498-501: Leverage the existingItem.IsExpired()helper instead of duplicating the check
IsExpired()is used throughout this class (e.g., inConsumeItemComponentsandFind).
Sticking to the helper keeps the semantics in one place and makes future behaviour changes (e.g., introducing a grace period) trivial.- IList<Item> toRemove = items.Where(item => item.ExpiryTime > 0 && item.ExpiryTime <= now).ToList(); + IList<Item> toRemove = items.Where(item => item.IsExpired()).ToList();No functional difference today, just maintainability/readability.
312-312: Nit: orphaned comment outside anycaselabel hampers readabilityThis comment line now sits in the switch body but outside a
case.
Although legal (comments are ignored by the compiler), it visually suggests a missingcase 90000026:implementation.Either re-indent it under a
case(commented out) or move it above the closing brace to avoid confusion.- // case 90000026: // Unknown (Blank) + // case 90000026: // Unknown (Blank)(or drop the line entirely if the placeholder is no longer useful).
Summary by CodeRabbit