From 7be3219850b7925da8af19b747f007b2f33200ee Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Wed, 30 Jun 2010 16:40:26 +0300 Subject: [PATCH] Hook so the currently active weapon can be reported in the console. see cl_hook_activeweapon. Still not ready, need to do the firing type script too --- defaultXonotic.cfg | 1 + qcsrc/client/View.qc | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 970feba5e..71d2114d4 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -1708,6 +1708,7 @@ alias cl_hook_gamestart_rc alias cl_hook_gamestart_nexball alias cl_hook_gamestart_cts alias cl_hook_gameend +alias cl_hook_activeweapon alias _sv_hook_gamestart "set _sv_hook_gametype $1; _sv_hook_gamestart_stage2" alias _sv_hook_gamestart_stage2 "sv_hook_gamestart_all; sv_hook_gamestart_${_sv_hook_gametype}" diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 1056fd59a..d48306e05 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -474,6 +474,10 @@ void CSQC_UpdateView(float w, float h) if(last_weapon != activeweapon) { weapontime = time; last_weapon = activeweapon; + + entity e; + e = get_weaponinfo(activeweapon); + localcmd(strcat("\ncl_hook_activeweapon ", e.netname), ";"); } // ALWAYS Clear Current Scene First -- 2.39.2