From 9997d10e2250e2b84f957eb156bf228d580c18f5 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 9 Apr 2023 10:17:44 +0200 Subject: [PATCH] Fix Region Detection --- src/de/steamwar/lobby/boatrace/BoatRace.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/lobby/boatrace/BoatRace.java b/src/de/steamwar/lobby/boatrace/BoatRace.java index 34d7fdf..9aecb3e 100644 --- a/src/de/steamwar/lobby/boatrace/BoatRace.java +++ b/src/de/steamwar/lobby/boatrace/BoatRace.java @@ -153,10 +153,10 @@ public class BoatRace implements EventListener, Listener { double y1 = Math.min(loc1.getY(), loc2.getY()); double z1 = Math.min(loc1.getZ(), loc2.getZ()); - double x2 = Math.max(loc1.getX(), loc2.getX()); - double y2 = Math.max(loc1.getY(), loc2.getY()); - double z2 = Math.max(loc1.getZ(), loc2.getZ()); + double x2 = Math.max(loc1.getX(), loc2.getX()) + 1; + double y2 = Math.max(loc1.getY(), loc2.getY()) + 1; + double z2 = Math.max(loc1.getZ(), loc2.getZ()) + 1; - return p.getLocation().getX() >= x1 && p.getLocation().getY() >= y1 && p.getLocation().getZ() >= z1 && p.getLocation().getX() <= x2 && p.getLocation().getY() <= y2 && p.getLocation().getZ() <= z2; + return p.getLocation().getX() >= x1 && p.getLocation().getY() >= y1 && p.getLocation().getZ() >= z1 && p.getLocation().getX() < x2 && p.getLocation().getY() < y2 && p.getLocation().getZ() < z2; } }