X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fcmd.qc;h=beb04103628d7e52e3a0b5890e7d5fb9772fb6cb;hb=88713a575bd27dabc5926d636542b6145ab6f51c;hp=4548bbf9bb87a8b902f32f8ad2775ede7d18230a;hpb=44968fcb5b31c35a0e662906a8b9542ab3933561;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index 4548bbf9b..beb041036 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -378,6 +378,46 @@ void ClientCommand_mobspawn(float request, float argc) } } +void ClientCommand_physics(float request, float argc) +{ + switch(request) + { + case CMD_REQUEST_COMMAND: + { + string command = strtolower(argv(1)); + + if(!autocvar_g_physics_clientselect) + { + sprint(self, "Client physics selection is currently disabled.\n"); + return; + } + + if(command == "list" || command == "help") + { + sprint(self, strcat("Available physics sets: \n\n", autocvar_g_physics_clientselect_options, " default\n")); + return; + } + + if(Physics_Valid(command) || command == "default") + { + stuffcmd(self, strcat("\nseta cl_physics ", command, "\nsendcvar cl_physics\n")); + sprint(self, strcat("^2Physics set successfully changed to ^3", command, "\n")); + return; + } + } + + default: + sprint(self, strcat("Current physics set: ^3", self.cvar_cl_physics, "\n")); + case CMD_REQUEST_USAGE: + { + sprint(self, "\nUsage:^3 cmd physics \n"); + sprint(self, " See 'cmd physics list' for available physics sets.\n"); + sprint(self, " Argument 'default' resets to standard physics.\n"); + return; + } + } +} + void ClientCommand_ready(float request) // todo: anti-spam for toggling readyness { switch(request) @@ -770,6 +810,7 @@ void ClientCommand_(float request) CLIENT_COMMAND("mobedit", ClientCommand_mobedit(request, arguments), "Edit your monster's properties") \ CLIENT_COMMAND("mobkill", ClientCommand_mobkill(request), "Kills your monster") \ CLIENT_COMMAND("mobspawn", ClientCommand_mobspawn(request, arguments), "Spawn monsters infront of yourself") \ + CLIENT_COMMAND("physics", ClientCommand_physics(request, arguments), "Change physics set") \ CLIENT_COMMAND("ready", ClientCommand_ready(request), "Qualify as ready to end warmup stage (or restart server if allowed)") \ CLIENT_COMMAND("say", ClientCommand_say(request, arguments, command), "Print a message to chat to all players") \ CLIENT_COMMAND("say_team", ClientCommand_say_team(request, arguments, command), "Print a message to chat to all team mates") \