From 2312c4d25845fac6d2a3bbd564af3cc30cef8232 Mon Sep 17 00:00:00 2001 From: Erik Broes Date: Wed, 4 Jan 2012 09:17:05 +0100 Subject: Vector.getMidpoint should not modify the current Vector. Thanks TomyLobo for noticing. --- src/main/java/org/bukkit/util/Vector.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/bukkit/util/Vector.java b/src/main/java/org/bukkit/util/Vector.java index 215e2222..4ff0b501 100644 --- a/src/main/java/org/bukkit/util/Vector.java +++ b/src/main/java/org/bukkit/util/Vector.java @@ -220,9 +220,9 @@ public class Vector implements Cloneable, ConfigurationSerializable { * @return a new midpoint vector */ public Vector getMidpoint(Vector other) { - x = (x + other.x) / 2; - y = (y + other.y) / 2; - z = (z + other.z) / 2; + double x = (this.x + other.x) / 2; + double y = (this.y + other.y) / 2; + double z = (this.z + other.z) / 2; return new Vector(x, y, z); } -- cgit v1.2.3