From 74a97e0ca031e2337474b3a4bd38ff15fae105bd Mon Sep 17 00:00:00 2001 From: walterhiggins Date: Sat, 17 Jan 2015 09:30:53 +0000 Subject: [PATCH] Fix issue #198 --- src/main/js/modules/utils/utils.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/js/modules/utils/utils.js b/src/main/js/modules/utils/utils.js index 5fb9d08..068d9ca 100644 --- a/src/main/js/modules/utils/utils.js +++ b/src/main/js/modules/utils/utils.js @@ -130,12 +130,13 @@ A JSON object in the above form. ***/ var _locationToJSON = function( location ) { + var yaw = __plugin.bukkit ? location.yaw : (__plugin.canary ? location.rotation : 0); return { world: ''+location.world.name, x: location.x, y: location.y, z: location.z, - yaw: location.yaw, + yaw: yaw, pitch: location.pitch }; }; @@ -185,10 +186,10 @@ exports.locationFromJSON = function( json ) { if (__plugin.canary){ world = _world( json.world ); var cmLocation = Packages.net.canarymod.api.world.position.Location; - return new cmLocation(world, json.x, json.y, json.z, json.pitch, json.yaw); + return new cmLocation(world, json.x, json.y, json.z, json.pitch?json.pitch:0, json.yaw?json.yaw:0); } else { world = _world( json.world ); - return new bkLocation( world, json.x, json.y , json.z, json.yaw, json.pitch ); + return new bkLocation( world, json.x, json.y , json.z, json.yaw?json.yaw:0, json.pitch?json.pitch:0 ); } } };