]> git.localhorst.tv Git - blank.git/blobdiff - src/shared/cli.cpp
unified location handling
[blank.git] / src / shared / cli.cpp
index aa6629f34741221e9cd45fe10ac71360333e58d3..6942f78704ec3a887dabff21fd35df37e0a6ba51 100644 (file)
@@ -72,12 +72,8 @@ CLI::Command::~Command() {
 
 void TeleportCommand::Execute(CLI &cli, Player &player, TokenStreamReader &args) {
        glm::vec3 pos(args.GetFloat(), args.GetFloat(), args.GetFloat());
-       glm::ivec3 chunk(pos);
-       chunk /= Chunk::Extent();
-       pos -= chunk;
        EntityState state = player.GetEntity().GetState();
-       state.chunk_pos = chunk;
-       state.block_pos = pos;
+       state.pos = ExactLocation(pos).Sanitize();
        player.GetEntity().SetState(state);
 }