Skip to content

Commit 0282666

Browse files
Fix relative /tp always moving you up a block or two
1 parent 7b3e796 commit 0282666

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

fCraft/Commands/ModerationCommands.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1466,9 +1466,9 @@ static void TeleportToCoords(Player player, CommandReader cmd) {
14661466
rot = player.Position.R;
14671467
lot = player.Position.L;
14681468

1469-
if (cmd.NextCoord(player.Position.ToBlockCoords().X, out x)
1470-
&& cmd.NextCoord(player.Position.ToBlockCoords().Y, out y)
1471-
&& cmd.NextCoord(player.Position.ToBlockCoords().Z, out z)) {
1469+
if (cmd.NextCoord(player.Position.BlockX, out x)
1470+
&& cmd.NextCoord(player.Position.BlockY, out y)
1471+
&& cmd.NextCoord(player.Position.BlockFeetZ, out z)) {
14721472

14731473
if (cmd.CountRemaining >= 2) {
14741474
if (cmd.NextInt(out rot) && cmd.NextInt(out lot)) {

fCraft/Commands/ZoneCommands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ static void ZoneRenameHandler( Player player, CommandReader cmd ) {
867867
return;
868868
}
869869

870-
if (!SpecialZone.CanManage(oldZone.Name.ToLower(), player, "rename a")) return;
870+
if (!SpecialZone.CanManage(oldZone.Name, player, "rename a")) return;
871871
if (!SpecialZone.CanManage(newName, player, "rename to a")) return;
872872

873873
// Check if a zone with "newName" name already exists

fCraft/Player/Position.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ public static Position FromString(string text) {
137137
public int BlockX { get { return X >> 5; } }
138138
public int BlockY { get { return Y >> 5; } }
139139
public int BlockZ { get { return Z >> 5; } }
140+
public int BlockFeetZ { get { return (Z - Player.CharacterHeight) >> 5; } }
140141

141142

142143
public Vector3I ToBlockCoords() {

0 commit comments

Comments
 (0)