]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a hook for HUD commands
authorMario <mario@smbclan.net>
Mon, 28 Dec 2015 11:15:16 +0000 (21:15 +1000)
committerMario <mario@smbclan.net>
Mon, 28 Dec 2015 11:15:16 +0000 (21:15 +1000)
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/mutators/events.qh

index 11ee469efbac00effa9268b1ecd69d00fe86914d..c99db92687eb1cb49c01768edf78e97eab572de3 100644 (file)
@@ -257,6 +257,9 @@ void LocalCommand_hud(int request, int argc)
        {
                case CMD_REQUEST_COMMAND:
                {
+                       if(MUTATOR_CALLHOOK(HUD_Command, argc))
+                               return;
+
                        switch (argv(1))
                        {
                                case "configure":
index 937e3170b56e8368181906ab2851994b23786f59..51af588393c660ae0890eaf07c955406f76b5b49 100644 (file)
@@ -126,4 +126,11 @@ MUTATOR_HOOKABLE(Particles_VortexBeam, EV_Particles_VortexBeam);
 entity w_hitwep;
 MUTATOR_HOOKABLE(Weapon_ImpactEffect, EV_Weapon_ImpactEffect);
 
+/* NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
+*/
+#define EV_HUD_Command(i, o) \
+       /** also, argv() can be used */ i(int, cmd_argc) \
+       /**/
+MUTATOR_HOOKABLE(HUD_Command, EV_HUD_Command);
+
 #endif