From 7599fb436d5231494142d771a40b831dc12f8957 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 29 Mar 2014 04:35:12 +0100 Subject: [PATCH] Fixed #1365 --- src/PocketMine/math/Vector2.php | 5 +---- src/build/compile.sh | 24 ++++++++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/PocketMine/math/Vector2.php b/src/PocketMine/math/Vector2.php index 6aa4f7049..44eb7f236 100644 --- a/src/PocketMine/math/Vector2.php +++ b/src/PocketMine/math/Vector2.php @@ -50,10 +50,7 @@ class Vector2{ if(($x instanceof Vector2) === true){ return $this->add($x->x, $x->y); }else{ - $this->x += $x; - $this->y += $y; - - return new Vector3($this->x + $x, $this->y + $y); + return new Vector2($this->x + $x, $this->y + $y); } } diff --git a/src/build/compile.sh b/src/build/compile.sh index 98d69f0e9..e13133f17 100644 --- a/src/build/compile.sh +++ b/src/build/compile.sh @@ -152,7 +152,7 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then TOOLCHAIN_PREFIX="arm-linux-gnueabihf" [ -z "$march" ] && march=armv6zk; [ -z "$mtune" ] && mtune=arm1176jzf-s; - [ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp"; + CFLAGS="$CFLAGS -mfloat-abi=hard -mfpu=vfp"; if [ "$DO_OPTIMIZE" == "yes" ]; then CFLAGS="$CFLAGS -mfloat-abi=hard -mfpu=vfp" fi @@ -164,13 +164,15 @@ if [ "$IS_CROSSCOMPILE" == "yes" ]; then elif [ "$COMPILE_TARGET" == "mac" ]; then [ -z "$march" ] && march=prescott; [ -z "$mtune" ] && mtune=generic; - [ -z "$CFLAGS" ] && CFLAGS="-fomit-frame-pointer"; + CFLAGS="$CFLAGS -fomit-frame-pointer"; TOOLCHAIN_PREFIX="i686-apple-darwin10" export CC="$TOOLCHAIN_PREFIX-gcc" CONFIGURE_FLAGS="--host=$TOOLCHAIN_PREFIX" #zlib doesn't use the correct ranlib RANLIB=$TOOLCHAIN_PREFIX-ranlib OPENSSL_TARGET="darwin64-x86_64-cc" + CFLAGS="$CFLAGS -Qunused-arguments -Wno-error=unused-command-line-argument-hard-error-in-future" + ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" echo "[INFO] Cross-compiling for Intel MacOS" elif [ "$COMPILE_TARGET" == "ios" ] || [ "$COMPILE_TARGET" == "ios-armv6" ]; then [ -z "$march" ] && march=armv6; @@ -210,26 +212,28 @@ elif [ "$COMPILE_TARGET" == "linux64" ]; then elif [ "$COMPILE_TARGET" == "rpi" ]; then [ -z "$march" ] && march=armv6zk; [ -z "$mtune" ] && mtune=arm1176jzf-s; - [ -z "$CFLAGS" ] && CFLAGS="-mfloat-abi=hard -mfpu=vfp"; + CFLAGS="$CFLAGS -mfloat-abi=hard -mfpu=vfp"; OPENSSL_TARGET="linux-armv4" echo "[INFO] Compiling for Raspberry Pi ARMv6zk hard float" elif [ "$COMPILE_TARGET" == "mac" ] || [ "$COMPILE_TARGET" == "mac32" ]; then - #[ -z "$march" ] && march=prescott; - #[ -z "$mtune" ] && mtune=generic; - [ -z "$march" ] && march=i686; + [ -z "$march" ] && march=prescott; [ -z "$mtune" ] && mtune=generic; - [ -z "$CFLAGS" ] && CFLAGS="-m32 -arch x86 -fomit-frame-pointer -mmacosx-version-min=10.5"; - [ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib"; + CFLAGS="$CFLAGS -m32 -arch i386 -fomit-frame-pointer -mmacosx-version-min=10.5"; + LDFLAGS="$LDFLAGS -Wl,-rpath,@loader_path/../lib"; export DYLD_LIBRARY_PATH="@loader_path/../lib" OPENSSL_TARGET="darwin-i386-cc" + CFLAGS="$CFLAGS -Qunused-arguments -Wno-error=unused-command-line-argument-hard-error-in-future" + ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" echo "[INFO] Compiling for Intel MacOS x86" elif [ "$COMPILE_TARGET" == "mac64" ]; then [ -z "$march" ] && march=core2; [ -z "$mtune" ] && mtune=generic; - [ -z "$CFLAGS" ] && CFLAGS="-m64 -arch x86-64 -fomit-frame-pointer -mmacosx-version-min=10.5"; - [ -z "$LDFLAGS" ] && LDFLAGS="-Wl,-rpath,@loader_path/../lib"; + CFLAGS="$CFLAGS -m64 -arch x86-64 -fomit-frame-pointer -mmacosx-version-min=10.5"; + LDFLAGS="$LDFLAGS -Wl,-rpath,@loader_path/../lib"; export DYLD_LIBRARY_PATH="@loader_path/../lib" OPENSSL_TARGET="darwin64-x86_64-cc" + CFLAGS="$CFLAGS -Qunused-arguments -Wno-error=unused-command-line-argument-hard-error-in-future" + ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future" echo "[INFO] Compiling for Intel MacOS x86_64" elif [ "$COMPILE_TARGET" == "ios" ]; then [ -z "$march" ] && march=armv7-a;