]> git.localhorst.tv Git - blank.git/blobdiff - src/shared/cli.cpp
add TCP based CLI
[blank.git] / src / shared / cli.cpp
index d4cf525b90e5e1c346bd0dbc9e65356c85a41627..cb46cfc264c289fcb73abb9b89caceaefd60af1e 100644 (file)
@@ -63,7 +63,12 @@ CLI::Command::~Command() {
 }
 
 
-void TeleportCommand::Execute(CLI &cli, CLIContext &ctx, TokenStreamReader &args) {
+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();