From 2cb33a5ec6519e2d30867f971d7f3e42699227e3 Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Tue, 4 Feb 2020 20:52:17 +0200 Subject: [PATCH] Make game timers end the game at 00:00 --- .../items/interactions/games/InteractionGameTimer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java index 94e01be1..6c0ff65e 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/InteractionGameTimer.java @@ -153,16 +153,20 @@ public class InteractionGameTimer extends HabboItem implements Runnable { return; } + this.timeNow--; + if (this.timeNow < 0) this.timeNow = 0; + if (this.timeNow > 0) { this.threadActive = true; Emulator.getThreading().run(this, 1000); - this.timeNow--; - room.updateItem(this); } else { this.threadActive = false; + this.timeNow = 0; this.endGame(room); WiredHandler.handle(WiredTriggerType.GAME_ENDS, null, room, new Object[]{}); } + + room.updateItem(this); } @Override