Missing Inventory Space Validation Leading to Item Loss #2
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Orangemart plugin fails to check available inventory space before giving currency items to players, potentially causing item loss when player inventories are full. Items are given using
basePlayer.GiveItem()
without validation, which can fail silently.Root Cause Analysis
Affected Methods
1. RewardPlayer() Method (Lines ~440-465)
2. ReturnCurrency() Method (Lines ~480-495)
Issue Details
Problem 1: Silent Item Loss
basePlayer.GiveItem()
returnsfalse
if inventory is fullProblem 2: Partial Stack Issues
Problem 3: No Fallback Mechanism
Impact
Steps to Reproduce
/buyblood 1000
command (large amount)Proposed Fix
Solution 1: Pre-Purchase Inventory Validation
Add inventory checks before creating invoices:
Solution 2: Smart Item Distribution with Fallback
Improve item giving with ground drop fallback:
Solution 3: Partial Stack Handling
Handle cases where only some items fit:
Required Language Additions
Add these messages to
LoadDefaultMessages()
:Environment
Severity
🔴 Critical - Players lose real money when items are destroyed
Additional Notes
This issue affects player trust and can lead to chargebacks or disputes when players pay but don't receive items. The fix should prioritize never losing paid-for items even if it means dropping them on the ground.
Fixed on 0.4.0