diff options
author | Erik Broes <erikbroes@grum.nl> | 2012-01-04 09:17:05 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2012-01-04 09:17:33 +0100 |
commit | 2312c4d25845fac6d2a3bbd564af3cc30cef8232 (patch) | |
tree | 11816c2016a90e7d94cf9217e65a3dfa10f796c9 | |
parent | c5063fa024ed954533d00a22c912fad467b101a2 (diff) | |
download | bukkit-2312c4d25845fac6d2a3bbd564af3cc30cef8232.tar bukkit-2312c4d25845fac6d2a3bbd564af3cc30cef8232.tar.gz bukkit-2312c4d25845fac6d2a3bbd564af3cc30cef8232.tar.lz bukkit-2312c4d25845fac6d2a3bbd564af3cc30cef8232.tar.xz bukkit-2312c4d25845fac6d2a3bbd564af3cc30cef8232.zip |
Vector.getMidpoint should not modify the current Vector. Thanks TomyLobo for noticing.
-rw-r--r-- | src/main/java/org/bukkit/util/Vector.java | 6 |
1 files changed, 3 insertions, 3 deletions
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); } |