From c6f3df30f58fc3c58bd0f755e4fae3a3b7460a4f Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Tue, 25 Oct 2011 12:09:51 +0300 Subject: [PATCH] Add button8 (grab button) to keybinds.txt. Also document the use of grabbing and object_remove in the sandbox help system --- defaultXonotic.cfg | 1 + keybinds.txt | 1 + qcsrc/server/mutators/sandbox.qc | 10 ++++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index a5a035585..58f6d6873 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1044,6 +1044,7 @@ bind r reload bind BACKSPACE dropweapon bind g dropweapon bind f +use +bind v +button8 // drag object // misc bind e +hook diff --git a/keybinds.txt b/keybinds.txt index 2df89afae..2c89f704b 100644 --- a/keybinds.txt +++ b/keybinds.txt @@ -56,6 +56,7 @@ "spec" "enter spectator mode" "dropweapon" "drop weapon" "+use" "drop key / drop flag" +"+button8" "drag object" "" "" "" "User defined" "+userbind 1" "$userbind1" diff --git a/qcsrc/server/mutators/sandbox.qc b/qcsrc/server/mutators/sandbox.qc index 28017401a..7bb4ad1b2 100644 --- a/qcsrc/server/mutators/sandbox.qc +++ b/qcsrc/server/mutators/sandbox.qc @@ -15,6 +15,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) print_to(self, "You can use the following sandbox commands:"); print_to(self, "^7\"^2spawn_object ^3models/foo/bar.md3^7\" spawns a new object in front of the player, and gives it the specified model"); print_to(self, "^7\"^2spawn_item ^3item^7\" spawns the specified item in front of the player. Only weapons are currently supported"); + print_to(self, "^7\"^2remove_object^7\" removes the object the player is looking at. Players can only remove their own objects"); + print_to(self, "^1button8 ^7can be used to grab and carry objects. Players can only grab their own objects"); return TRUE; } else if(argv(1) == "spawn_object") @@ -53,7 +55,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) } else if(argv(1) == "spawn_item") { - // weapons are the only items currently supported + // only weapons are currently supported if(cmd_argc < 3) { @@ -79,7 +81,7 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerCommand) } } - print_to(self, "WARNING: Attempted to spawn an invalid or unsupported item. See 'g_sandbox help' for supported items"); + print_to(self, "WARNING: Attempted to spawn an invalid or unsupported item. See 'g_sandbox help' for allowed items"); return TRUE; } else if(argv(1) == "remove_object") @@ -114,8 +116,8 @@ MUTATOR_HOOKFUNCTION(sandbox_PlayerPreThink) // grab is TRUE if the object can be picked up. While an object is being carried, the Drag() function // must execute for it either way, otherwise it would cause bugs if it went out of the player's trace. - // This also makes sure that an object can only pe picked up if in range, but does not get dropped if it goes - // out of range while slinging it around. + // This also makes sure that an object can only pe picked up if in range, but does not get dropped if + // it goes out of range while slinging it around. if(trace_ent.classname == "object" && trace_ent.realowner == self && vlen(trace_ent.origin - self.origin) <= autocvar_g_sandbox_editor_distance_edit) grab = TRUE; // object can be picked up -- 2.39.2