From fc82db6decc0f7dbe72a9224f824c2bcc1fddd0c Mon Sep 17 00:00:00 2001 From: brenoepic <59066707+brenoepics@users.noreply.github.com> Date: Fri, 29 Apr 2022 22:24:54 -0300 Subject: [PATCH] sync FreezeGamePlayer --- .../com/eu/habbo/habbohotel/games/freeze/FreezeGame.java | 2 +- .../eu/habbo/habbohotel/games/freeze/FreezeGamePlayer.java | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java b/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java index 993e2457..1f341d45 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGame.java @@ -255,7 +255,7 @@ public class FreezeGame extends Game { scoreboard.setExtradata("0"); } - int oldScore = Integer.valueOf(scoreboard.getExtradata()); + int oldScore = Integer.parseInt(scoreboard.getExtradata()); if (oldScore == totalScore) continue; diff --git a/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGamePlayer.java b/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGamePlayer.java index a701a023..1b736b98 100644 --- a/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGamePlayer.java +++ b/src/main/java/com/eu/habbo/habbohotel/games/freeze/FreezeGamePlayer.java @@ -38,7 +38,7 @@ public class FreezeGamePlayer extends GamePlayer { } @Override - public void addScore(int amount) { + public synchronized void addScore(int amount) { super.addScore(amount); if (amount > 0) { @@ -122,10 +122,7 @@ public class FreezeGamePlayer extends GamePlayer { } public boolean canGetFrozen() { - if (this.isFrozen() || this.isProtected()) - return false; - - return true; + return !this.isFrozen() && !this.isProtected(); } public void addProtection() {