Fixed crash when /teleporting with yaw/pitch

This commit is contained in:
Dylan K. Taylor 2017-07-03 13:26:15 +01:00
parent b4a149cce8
commit dca7efa03c

View File

@ -111,8 +111,8 @@ class TeleportCommand extends VanillaCommand{
$pitch = $target->getPitch(); $pitch = $target->getPitch();
if(count($args) === 6 or (count($args) === 5 and $pos === 3)){ if(count($args) === 6 or (count($args) === 5 and $pos === 3)){
$yaw = $args[$pos++]; $yaw = (float) $args[$pos++];
$pitch = $args[$pos++]; $pitch = (float) $args[$pos++];
} }
$target->teleport(new Vector3($x, $y, $z), $yaw, $pitch); $target->teleport(new Vector3($x, $y, $z), $yaw, $pitch);