]> git.localhorst.tv Git - blank.git/blobdiff - src/shared/cli.cpp
add TCP based CLI
[blank.git] / src / shared / cli.cpp
index 9663cb2c4efb192e5e7f0ee36768c84b737db437..cb46cfc264c289fcb73abb9b89caceaefd60af1e 100644 (file)
@@ -64,6 +64,11 @@ CLI::Command::~Command() {
 
 
 void TeleportCommand::Execute(CLI &, CLIContext &ctx, TokenStreamReader &args) {
+       if (!ctx.HasPlayer()) {
+               ctx.Error("teleport needs player to operate on");
+               return;
+       }
+
        glm::vec3 pos(args.GetFloat(), args.GetFloat(), args.GetFloat());
        EntityState state = ctx.GetPlayer().GetEntity().GetState();
        state.pos = ExactLocation(pos).Sanitize();