From: MirceaKitsune Date: Tue, 19 Jul 2011 12:10:02 +0000 (+0300) Subject: Crosshair style based on weapon and firing type X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=40ba7c2d6ab7ca70caca775eaaa8e606b47f6329;p=voretournament%2Fvoretournament.git Crosshair style based on weapon and firing type --- diff --git a/data/defaultVT.cfg b/data/defaultVT.cfg index 198f5679..c73f43cc 100644 --- a/data/defaultVT.cfg +++ b/data/defaultVT.cfg @@ -107,7 +107,9 @@ _cl_color 187 _cl_name "Player" _cl_playermodel models/player/vixen.zym _cl_playerskin 0 -crosshair 13 +seta crosshair 13 +seta crosshair_primary 14 +seta crosshair_secondary 15 seta crosshair_color "1 1 0.5" seta crosshair_alpha 1 seta crosshair_size 0.35 diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index c5d359ad..aed53ade 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -1113,7 +1113,15 @@ void CSQC_UpdateView(float w, float h) else if(swallow_indicator < 0) wcross_style = "_canswallow_no.tga"; else - wcross_style = cvar_string("crosshair"); + { + // normal crosshair, based on what weapon we have and what firing type we can use + if(!activeweapon) + wcross_style = cvar_string("crosshair"); + else if(getstati(STAT_CROSSHAIR_STYLE)) + wcross_style = cvar_string("crosshair_secondary"); + else + wcross_style = cvar_string("crosshair_primary"); + } if (wcross_style != "0") { vector wcross_color, wcross_size; diff --git a/data/qcsrc/server/w_grabber.qc b/data/qcsrc/server/w_grabber.qc index 26f37948..4de8425b 100644 --- a/data/qcsrc/server/w_grabber.qc +++ b/data/qcsrc/server/w_grabber.qc @@ -82,9 +82,9 @@ float w_grabber(float req) W_SetupShot (self, TRUE, 0, "", 0); // do this to update w_shotorg WarpZone_traceline_antilag(self, w_shotorg, w_shotorg + w_shotdir * cvar("g_balance_grabber_secondary_radius"), FALSE, self, ANTILAG_LATENCY(self)); if(trace_fraction < 1) - dprint("!!!!!!!!!!!!!!!!!!!!!!!\n"); + self.stat_crosshair_style = 1; else - dprint("#######################\n"); + self.stat_crosshair_style = 0; grabbered_fuel = cvar("g_balance_grabber_primary_grabbered_fuel"); // forced reload