diff --git a/CHANGELOG.md b/CHANGELOG.md index 8231716..a3f0469 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,9 @@ All notable changes to Peril Dice will be documented in this file. - **Race Condition Resolution**: Eliminated duplicate player entries from rapid multiple touches - **Game Disruption Prevention**: Stopped unwanted joins during critical game startup phase - **Consistent Game State**: All registration paths now properly validate timing and prevent duplicates +- **Duplicate Pick Prevention**: Fixed `continueCurrentRound()` function to properly rebuild `globalPickedNumbers` with uniqueness checks +- **Data Corruption Fix**: Resolved issue where `globalPickedNumbers` could contain duplicates, causing inconsistent bot pick validation +- **Delimiter Handling**: Enhanced parsing to correctly handle both comma (human) and semicolon (bot) pick delimiters ## [2.4.0] - 2025-08-08 diff --git a/CHANGELOG_Notecard.txt b/CHANGELOG_Notecard.txt index 040c541..54133fb 100644 --- a/CHANGELOG_Notecard.txt +++ b/CHANGELOG_Notecard.txt @@ -25,6 +25,9 @@ All notable changes to Peril Dice are documented in this file. - Race Condition Resolution: Eliminated duplicate player entries from rapid multiple touches - Game Disruption Prevention: Stopped unwanted joins during critical game startup phase - Consistent Game State: All registration paths now properly validate timing and prevent duplicates +- Duplicate Pick Prevention: Fixed continueCurrentRound() function to properly rebuild globalPickedNumbers with uniqueness checks +- Data Corruption Fix: Resolved issue where globalPickedNumbers could contain duplicates, causing inconsistent bot pick validation +- Delimiter Handling: Enhanced parsing to correctly handle both comma (human) and semicolon (bot) pick delimiters [2.4.0] - 2025-08-08 ==================== diff --git a/Main.lsl b/Main.lsl index 362487a..3277863 100644 --- a/Main.lsl +++ b/Main.lsl @@ -259,10 +259,23 @@ continueCurrentRound() { if (llGetListLength(parts) >= 2) { string picks = llList2String(parts, 1); if (picks != "") { - // Handle semicolon encoding for picks - string decodedPicks = llDumpList2String(llParseString2List(picks, [";"], []), ","); - list playerPicks = llParseString2List(decodedPicks, [","], []); - globalPickedNumbers += playerPicks; + // Handle both comma and semicolon delimiters + list playerPicks = []; + if (llSubStringIndex(picks, ";") != -1) { + // Bot picks use semicolons + playerPicks = llParseString2List(picks, [";"], []); + } else { + // Human picks use commas + playerPicks = llParseString2List(picks, [","], []); + } + // Add picks to global list, avoiding duplicates + integer j; + for (j = 0; j < llGetListLength(playerPicks); j++) { + string pick = llStringTrim(llList2String(playerPicks, j), STRING_TRIM); + if (pick != "" && llListFindList(globalPickedNumbers, [pick]) == -1) { + globalPickedNumbers += [pick]; + } + } } } } diff --git a/README.md b/README.md index abe4702..ba2ba93 100644 --- a/README.md +++ b/README.md @@ -94,6 +94,8 @@ Dice type is automatically chosen to ensure at least 3 picks per player: - **Startup Sequence Protection**: Eliminated timing window allowing unwanted joins during game initialization - **Enhanced Game Flow Control**: Better state management and user feedback during registration processes - **Race Condition Resolution**: Comprehensive fixes for all registration-related race conditions +- **Duplicate Pick Prevention**: Fixed intermittent duplicate number picks caused by data corruption in `globalPickedNumbers` +- **Data Integrity**: Enhanced `continueCurrentRound()` function to properly rebuild pick tracking with uniqueness validation ## Previous Improvements (v2.4.0) diff --git a/README_Notecard.txt b/README_Notecard.txt index 2a31e89..d55470b 100644 --- a/README_Notecard.txt +++ b/README_Notecard.txt @@ -95,6 +95,8 @@ RECENT IMPROVEMENTS (V2.5.0) - Startup Sequence Protection: Eliminated timing window allowing unwanted joins during game initialization - Enhanced Game Flow Control: Better state management and user feedback during registration processes - Race Condition Resolution: Comprehensive fixes for all registration-related race conditions +- Duplicate Pick Prevention: Fixed intermittent duplicate number picks caused by data corruption in globalPickedNumbers +- Data Integrity: Enhanced continueCurrentRound() function to properly rebuild pick tracking with uniqueness validation PREVIOUS IMPROVEMENTS (V2.4.0) ==============================