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