@@ -1414,10 +1414,10 @@ private static void TeleportHandler(Player player, CommandReader cmd) {
14141414 Vector3I P = player . World . map . HighestFreeSpace ( zone . Bounds . XCentre ,
14151415 zone . Bounds . YCentre , zone . Bounds . ZCentre ) ;
14161416 Position zPos = new Position ( P . X * 32 + 16 , P . Y * 32 + 16 , P . Z * 32 + ( 51 + 1 ) ) ;
1417- if ( player . World != null ) {
1418- player . LastWorld = player . World ;
1419- player . LastPosition = player . Position ;
1420- }
1417+ if ( player . World != null ) {
1418+ player . LastWorld = player . World ;
1419+ player . LastPosition = player . Position ;
1420+ }
14211421 player . TeleportTo ( ( zPos ) ) ;
14221422 player . Message ( "Teleporting you to zone " + zone . ClassyName ) ;
14231423 return ;
@@ -1430,10 +1430,10 @@ private static void TeleportHandler(Player player, CommandReader cmd) {
14301430 int z = ( player . Position . Z - 51 ) / 32 ;
14311431 Vector3I P = player . WorldMap . HighestFreeSpace ( x , y , z ) ;
14321432
1433- if ( player . World != null ) {
1434- player . LastWorld = player . World ;
1435- player . LastPosition = player . Position ;
1436- }
1433+ if ( player . World != null ) {
1434+ player . LastWorld = player . World ;
1435+ player . LastPosition = player . Position ;
1436+ }
14371437 player . TeleportTo ( new Position {
14381438 X = ( P . X * 32 + 16 ) ,
14391439 Y = ( P . Y * 32 + 16 ) ,
@@ -1465,22 +1465,18 @@ private static void TeleportHandler(Player player, CommandReader cmd) {
14651465 }
14661466 }
14671467 }
1468- if ( x <= - 1024 || x >= 1024 || y <= - 1024 || y >= 1024 || z <= - 1024 || z >= 1024 ) {
1469- player . Message ( "Coordinates are outside the valid range!" ) ;
1470-
1471- } else {
1472- if ( player . World != null ) {
1473- player . LastWorld = player . World ;
1474- player . LastPosition = player . Position ;
1475- }
1476- player . TeleportTo ( new Position {
1477- X = ( x * 32 + 16 ) ,
1478- Y = ( y * 32 + 16 ) ,
1479- Z = ( z * 32 + 48 ) ,
1480- R = ( byte ) rot ,
1481- L = ( byte ) lot
1482- } ) ;
1468+
1469+ if ( player . World != null ) {
1470+ player . LastWorld = player . World ;
1471+ player . LastPosition = player . Position ;
14831472 }
1473+ player . TeleportTo ( new Position {
1474+ X = ( x * 32 + 16 ) ,
1475+ Y = ( y * 32 + 16 ) ,
1476+ Z = ( z * 32 + 52 ) ,
1477+ R = ( byte ) rot ,
1478+ L = ( byte ) lot
1479+ } ) ;
14841480 } else {
14851481 CdTeleport . PrintUsage ( player ) ;
14861482 }
@@ -1514,11 +1510,11 @@ private static void TeleportHandler(Player player, CommandReader cmd) {
15141510 return ;
15151511 }
15161512
1517- if ( targetWorld == player . World ) {
1518- if ( player . World != null ) {
1519- player . LastWorld = player . World ;
1520- player . LastPosition = player . Position ;
1521- }
1513+ if ( targetWorld == player . World ) {
1514+ if ( player . World != null ) {
1515+ player . LastWorld = player . World ;
1516+ player . LastPosition = player . Position ;
1517+ }
15221518 player . TeleportTo ( target . Position ) ;
15231519
15241520 } else {
0 commit comments