Skip to content
Permalink
Browse files

Allow tping to coords and setting portal past 1024, fix falling throu…

…gh block when tping to coord just above a block
  • Loading branch information...
UnknownShadow200 committed May 20, 2017
1 parent 702ef1b commit 8541f96c2c42aeff703d87fe10aa6620105a745a
Showing with 25 additions and 35 deletions.
  1. +24 −28 fCraft/Commands/ModerationCommands.cs
  2. +1 −7 fCraft/Commands/WorldCommands.cs
@@ -1414,10 +1414,10 @@ static void UnfreezeHandler(Player player, CommandReader cmd)
Vector3I P = player.World.map.HighestFreeSpace(zone.Bounds.XCentre,
zone.Bounds.YCentre, zone.Bounds.ZCentre);
Position zPos = new Position(P.X * 32 + 16, P.Y * 32 + 16, P.Z * 32 + (51 + 1));
if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
player.TeleportTo((zPos));
player.Message("Teleporting you to zone " + zone.ClassyName);
return;
@@ -1430,10 +1430,10 @@ static void UnfreezeHandler(Player player, CommandReader cmd)
int z = (player.Position.Z - 51) / 32;
Vector3I P = player.WorldMap.HighestFreeSpace(x, y, z);

if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
player.TeleportTo(new Position {
X = (P.X * 32 + 16),
Y = (P.Y * 32 + 16),
@@ -1465,22 +1465,18 @@ static void UnfreezeHandler(Player player, CommandReader cmd)
}
}
}
if (x <= -1024 || x >= 1024 || y <= -1024 || y >= 1024 || z <= -1024 || z >= 1024) {
player.Message("Coordinates are outside the valid range!");

} else {
if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
player.TeleportTo(new Position {
X = (x*32 + 16),
Y = (y*32 + 16),
Z = (z*32 + 48),
R = (byte) rot,
L = (byte) lot
});

if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
player.TeleportTo(new Position {
X = (x*32 + 16),
Y = (y*32 + 16),
Z = (z*32 + 52),
R = (byte) rot,
L = (byte) lot
});
} else {
CdTeleport.PrintUsage(player);
}
@@ -1514,11 +1510,11 @@ static void UnfreezeHandler(Player player, CommandReader cmd)
return;
}

if (targetWorld == player.World) {
if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
if (targetWorld == player.World) {
if (player.World != null) {
player.LastWorld = player.World;
player.LastPosition = player.Position;
}
player.TeleportTo(target.Position);

} else {
@@ -3678,13 +3678,7 @@ static void WorldClearHandler(Player player, CommandReader cmd)
lot = player.Position.L;
}
}

if (x < 0 || x >= 1024 || y < 0 || y >= 1024 || z < 0 || z >= 1024) {
player.Message("Coordinates are outside the valid range!");
return;
} else {
player.PortalTPPos = new Position(x * 32, y * 32, z * 32, (byte)rot, (byte)lot);
}
player.PortalTPPos = new Position(x * 32, y * 32, z * 32, (byte)rot, (byte)lot);
} else {
player.PortalTPPos = tpWorld.map == null ? new Position(0, 0, 0) : tpWorld.map.Spawn;
}

0 comments on commit 8541f96

Please sign in to comment.
You can’t perform that action at this time.