🧩 Scratch Crate - Patch Notes v1.2
🔧 Bug Fixes & Logical Improvements 🎯 Fixed duplicate reward issue Rewards are now only given in the onClose event if the player has actually won. Previously, the reward could be given in both onClick and onClose.
🛡️ Prevented early close exploit If the player closes the crate before using all attempts without winning, the crate menu is reopened until all 3 scratch chances are used.
🔂 Centralized reward detection and distribution The reward is no longer given immediately on click; now it's processed only once during inventory close for consistency and exploit prevention.
🧼 Reduced code repetition & improved readability Simplified logic flow and cleaned up ItemStack and meta handling for better code maintainability.
🔊 Fixed overlapping sound effects The winning sound no longer overlaps or repeats unnecessarily. Sound tasks are properly canceled after execution.
🧠 Improved item match logic for winning condition Previously, incorrect slots could be considered for win checks. Now the system accurately verifies whether the player revealed 2 matching items.