SteamWar/BauSystem2.0
Archiviert
12
0

Fixed laufbau first tnt bug #246

Zusammengeführt
YoyoNow hat 1 Commits von fix-laufbau nach master 2024-05-01 13:44:47 +02:00 zusammengeführt
2 geänderte Dateien mit 4 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -90,11 +90,10 @@ public class ProcessingTracesState implements LaufbauState {
Location location = current.getLocation(); Location location = current.getLocation();
if (current.getPrevious().isPresent()) { if (current.getPrevious().isPresent()) {
Vector velocity = current.getPrevious().get().getVelocity();
Location previousLocation = current.getPrevious().get().getLocation(); Location previousLocation = current.getPrevious().get().getLocation();
Location movement = location.clone().subtract(previousLocation); 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)); 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(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)); 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 { } else {

Datei anzeigen

@ -219,6 +219,9 @@ public class TNTPoint implements Externalizable {
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (!(obj instanceof TNTPoint)) return false; if (!(obj instanceof TNTPoint)) return false;
TNTPoint record = (TNTPoint) obj; 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.isExplosion() != explosion) return false;
if (!record.getLocation().equals(location)) return false; if (!record.getLocation().equals(location)) return false;
if (!record.getVelocity().equals(velocity)) return false; if (!record.getVelocity().equals(velocity)) return false;