From 0e56cba7a1555eb820452bd1098b1c76a719834c Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Mon, 13 May 2019 13:56:47 -0400 Subject: [PATCH] Fix number formatting error in toggle furni effect --- .../wired/effects/WiredEffectToggleFurni.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java index 5da0bd05..1f2d95ad 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/wired/effects/WiredEffectToggleFurni.java @@ -146,7 +146,15 @@ public class WiredEffectToggleFurni extends InteractionWiredEffect { if (item.getBaseItem().getStateCount() > 1 || item instanceof InteractionGameTimer) { - item.onClick(habbo != null && !(item instanceof InteractionGameTimer) ? habbo.getClient() : null, room, new Object[]{item.getExtradata().length() == 0 ? 0 : Integer.valueOf(item.getExtradata()), this.getType()}); + int state = 0; + if (!item.getExtradata().isEmpty()) { + try { + state = Integer.valueOf(item.getExtradata()); // assumes that extradata is state, could be something else for trophies etc. + } catch (NumberFormatException ignored) { + + } + } + item.onClick(habbo != null && !(item instanceof InteractionGameTimer) ? habbo.getClient() : null, room, new Object[]{state, this.getType()}); } } catch (Exception e)