From 62ff9034a613f42ef941f35397f6b34db889a96e Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Sat, 1 Aug 2015 12:33:40 +0100 Subject: [PATCH] Fix issue #261 --- build.properties | 2 +- build.xml | 8 ++++++++ release-notes.md | 5 +++++ src/main/js/modules/minigames/scoreboard.js | 9 +++++++-- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/build.properties b/build.properties index 2c587ce..7676db9 100644 --- a/build.properties +++ b/build.properties @@ -1 +1 @@ -scriptcraft-version=3.1.8 +scriptcraft-version=3.1.9 diff --git a/build.xml b/build.xml index f76a9ff..67d81da 100644 --- a/build.xml +++ b/build.xml @@ -57,6 +57,13 @@ + + + diff --git a/release-notes.md b/release-notes.md index f5cf6e7..86fe309 100644 --- a/release-notes.md +++ b/release-notes.md @@ -1,5 +1,10 @@ RELEASE NOTES ============= +3.1.9 Release (2015 08 01) +-------------------------- +Bug fix: minigames/scoreboard.js module's updatePlayerScore() function did not work with latest version of CanaryMod. +Using /scoreboard command instead. See https://github.com/walterhiggins/ScriptCraft/issues/261 + 3.1.8 Release (2015 06 07) -------------------------- Bug fix: Fixes drone on Spigot 1.8.7 with JDK 7 see diff --git a/src/main/js/modules/minigames/scoreboard.js b/src/main/js/modules/minigames/scoreboard.js index 988718d..8d7d524 100644 --- a/src/main/js/modules/minigames/scoreboard.js +++ b/src/main/js/modules/minigames/scoreboard.js @@ -49,8 +49,13 @@ function addPlayerToTeam( objectiveName, teamName, playerName ){ } function updatePlayerScore( objectiveName, playerName, score ){ - var sc = sb['getScore(String, ScoreObjective)']( playerName, sb.getScoreObjective( objectiveName) ); - sc.score = score; + /* + wph 20150801 - this fails with CanaryMod 1.8.2 so use command instead - messy for ops but non-ops won't see messages + + var sc = sb['getScore(String, ScoreObjective)']( playerName, sb.getScoreObjective( objectiveName) ); + sc.score = score; + */ + execCommand('scoreboard players set ' + playerName + ' ' + objectiveName + score); } function removeTeamFromScoreboard( teamName ){