From 304907ddf13ee6fc3a865384a98c944951b8c3d3 Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Tue, 4 Feb 2020 14:09:48 +0200 Subject: [PATCH] Reset banzai tile state on pickup --- .../InteractionBattleBanzaiTile.java | 19 +++++++++++++++++++ .../items/MoodLightSaveSettingsEvent.java | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java index 24e98ed6..8e364615 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/games/battlebanzai/InteractionBattleBanzaiTile.java @@ -99,4 +99,23 @@ public class InteractionBattleBanzaiTile extends HabboItem { return super.canStackAt(room, itemsAtLocation); } + + @Override + public void onPickUp(Room room) { + super.onPickUp(room); + + this.setExtradata("0"); + room.updateItem(this); + } + + @Override + public void onPlace(Room room) { + super.onPlace(room); + + BattleBanzaiGame game = (BattleBanzaiGame) room.getGame(BattleBanzaiGame.class); + + if (game != null && game.getState() != GameState.IDLE) { + this.setExtradata("1"); + } + } } diff --git a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java index 3c2e8d4e..105152da 100644 --- a/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java +++ b/src/main/java/com/eu/habbo/messages/incoming/rooms/items/MoodLightSaveSettingsEvent.java @@ -13,7 +13,7 @@ public class MoodLightSaveSettingsEvent extends MessageHandler { public void handle() throws Exception { Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom(); - if ((room.getGuildId() > 0 && room.guildRightLevel(this.client.getHabbo()) < 2) && !room.hasRights(this.client.getHabbo())) + if ((room.getGuildId() <= 0 && room.guildRightLevel(this.client.getHabbo()) < 2) && !room.hasRights(this.client.getHabbo())) return; int id = this.packet.readInt();