From b9f083969f6763dad543f96abae8d6a0dff17fcb Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sun, 20 Nov 2016 17:18:17 +1100 Subject: [PATCH] Core: Fix /tp not working when target player is outside map. --- MCGalaxy/Network/Player.Networking.cs | 9 --------- MCGalaxy/Player/Player.Handlers.cs | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/MCGalaxy/Network/Player.Networking.cs b/MCGalaxy/Network/Player.Networking.cs index 970ac9e77..0353d3a12 100644 --- a/MCGalaxy/Network/Player.Networking.cs +++ b/MCGalaxy/Network/Player.Networking.cs @@ -370,15 +370,6 @@ namespace MCGalaxy { /// Sends a packet indicating an absolute position + orientation change for an enity. public void SendPos(byte id, ushort x, ushort y, ushort z, byte rotx, byte roty) { - if ( x < 0 ) x = 32; - if ( y < 0 ) y = 32; - if ( z < 0 ) z = 32; - if ( x > level.Width * 32 ) x = (ushort)( level.Width * 32 - 32 ); - if ( z > level.Length * 32 ) z = (ushort)( level.Length * 32 - 32 ); - if ( x > 32767 ) x = 32730; - if ( y > 32767 ) y = 32730; - if ( z > 32767 ) z = 32730; - pos = new ushort[3] { x, y, z }; rot = new byte[2] { rotx, roty }; diff --git a/MCGalaxy/Player/Player.Handlers.cs b/MCGalaxy/Player/Player.Handlers.cs index 6174e1fcb..4e030a9c7 100644 --- a/MCGalaxy/Player/Player.Handlers.cs +++ b/MCGalaxy/Player/Player.Handlers.cs @@ -306,7 +306,7 @@ namespace MCGalaxy { bool movedY = Math.Abs((short)y - (short)pos[1]) > 40; // moved more than 1.25 blocks vertically bool movedZ = Math.Abs((short)z - (short)pos[2]) > 4; // moved more than 0.125 blocks horizontally if (movedX || movedY || movedZ) { - SendPos(Entities.SelfID, pos[0], pos[1], pos[2], rotx, roty); + SendPos(Entities.SelfID, pos[0], pos[1], pos[2], rotx, roty); } return; }