Fix glitchy freeze scoreboards (negative scores)

This commit is contained in:
Alejandro 2020-02-04 22:17:08 +02:00
parent 2cb33a5ec6
commit fbdf56f22f

View File

@ -29,6 +29,9 @@ public class GamePlayer {
public synchronized void addScore(int amount) {
if (habbo.getHabboInfo().getGamePlayer() != null && this.habbo.getHabboInfo().getCurrentGame() != null && this.habbo.getHabboInfo().getCurrentRoom().getGame(this.habbo.getHabboInfo().getCurrentGame()).getTeamForHabbo(this.habbo) != null) {
this.score += amount;
if (this.score < 0) this.score = 0;
WiredHandler.handle(WiredTriggerType.SCORE_ACHIEVED, this.habbo.getRoomUnit(), this.habbo.getHabboInfo().getCurrentRoom(), new Object[]{this.habbo.getHabboInfo().getCurrentRoom().getGame(this.habbo.getHabboInfo().getCurrentGame()).getTeamForHabbo(this.habbo).getTotalScore(), amount});
}
}