From 53b13b7133dc608bf8c39f37e831270bf23a2733 Mon Sep 17 00:00:00 2001 From: Alejandro <25-alejandro@users.noreply.git.krews.org> Date: Thu, 30 May 2019 13:43:23 +0300 Subject: [PATCH] Fix too small z positions --- src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java b/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java index d7a5c7ab..213b3124 100644 --- a/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java +++ b/src/main/java/com/eu/habbo/habbohotel/users/HabboItem.java @@ -180,7 +180,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers { } public void setZ(double z) { - if (z > 9999) return; + if (z > 9999 || z < -9999) return; this.z = z; } @@ -246,7 +246,7 @@ public abstract class HabboItem implements Runnable, IEventTriggers { statement.setString(3, this.wallPosition); statement.setInt(4, this.x); statement.setInt(5, this.y); - statement.setDouble(6, Math.min(9999, Math.round(this.z * Math.pow(10, 6)) / Math.pow(10, 6))); + statement.setDouble(6, Math.max(-9999, Math.min(9999, Math.round(this.z * Math.pow(10, 6)) / Math.pow(10, 6)))); statement.setInt(7, this.rotation); statement.setString(8, this instanceof InteractionGuildGate ? "" : this.getDatabaseExtraData()); statement.setString(9, this.limitedStack + ":" + this.limitedSells);