From a6f0a48f84d21bb2961c54351257b27abb4fbc7e Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Mon, 28 Nov 2011 00:29:38 +0100 Subject: [PATCH] Added a swap function to the expression parser. --- .../sk89q/worldedit/expression/runtime/Functions.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java b/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java index fcf165de3..4bb811a13 100644 --- a/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java +++ b/src/main/java/com/sk89q/worldedit/expression/runtime/Functions.java @@ -257,7 +257,16 @@ public final class Functions { x.assign(xOld * cosF - yOld * sinF); y.assign(xOld * sinF + yOld * cosF); - return 0; + return 0.0; + } + + public static final double swap(LValue x, LValue y) throws EvaluationException { + final double tmp = x.getValue(); + + x.assign(y.getValue()); + y.assign(tmp); + + return 0.0; }