From d5ab11addd60235389a294c05fb7648708f6b787 Mon Sep 17 00:00:00 2001 From: D4rkr34lm Date: Wed, 1 May 2024 13:42:44 +0200 Subject: [PATCH] Fixed laufbau first tnt bug --- .../features/slaves/laufbau/states/ProcessingTracesState.java | 3 +-- .../src/de/steamwar/bausystem/features/tracer/TNTPoint.java | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ProcessingTracesState.java b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ProcessingTracesState.java index cec4c2cb..c2893964 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ProcessingTracesState.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/slaves/laufbau/states/ProcessingTracesState.java @@ -90,11 +90,10 @@ public class ProcessingTracesState implements LaufbauState { Location location = current.getLocation(); if (current.getPrevious().isPresent()) { - Vector velocity = current.getPrevious().get().getVelocity(); Location previousLocation = current.getPrevious().get().getLocation(); Location movement = location.clone().subtract(previousLocation); calculateCuboid(new Cuboid(previousLocation.getX() - 0.49, Math.min(previousLocation.getY(), location.getY()), previousLocation.getZ() - 0.49, 0.98, Math.abs(movement.getY()) + 0.98, 0.98)); - if (velocity.getX() >= velocity.getZ()) { + if (movement.getX() >= movement.getZ()) { calculateCuboid(new Cuboid(Math.min(previousLocation.getX(), location.getX()) - 0.49, location.getY(), previousLocation.getZ() - 0.49, Math.abs(movement.getX()) + 0.98, 0.98, 0.98)); calculateCuboid(new Cuboid(location.getX() - 0.49, location.getY(), Math.min(previousLocation.getZ(), location.getZ()) - 0.49, 0.98, 0.98, Math.abs(movement.getZ()) + 0.98)); } else { diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java index 7a5d5425..ed0f1306 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/TNTPoint.java @@ -219,6 +219,9 @@ public class TNTPoint implements Externalizable { public boolean equals(Object obj) { if (!(obj instanceof TNTPoint)) return false; TNTPoint record = (TNTPoint) obj; + if (record.getTntId() != tntId) return false; + if (record.getFuse() != fuse) return false; + if (record.getTicksSinceStart() != ticksSinceStart) return false; if (record.isExplosion() != explosion) return false; if (!record.getLocation().equals(location)) return false; if (!record.getVelocity().equals(velocity)) return false; -- 2.39.5