X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fshared%2Fcli.cpp;h=cb46cfc264c289fcb73abb9b89caceaefd60af1e;hb=b07f3c123fff221edeffb4864bab7db88d0d1f4d;hp=9663cb2c4efb192e5e7f0ee36768c84b737db437;hpb=20d0a76d2519c71009c3b3babec0df27529f8142;p=blank.git diff --git a/src/shared/cli.cpp b/src/shared/cli.cpp index 9663cb2..cb46cfc 100644 --- a/src/shared/cli.cpp +++ b/src/shared/cli.cpp @@ -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();