From 2e3e13501897d3ccd46ebcb82451104135b33069 Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Sat, 30 Oct 2010 16:47:08 +0300 Subject: [PATCH] You know how in some games the crosshair grows and shrinks back when you pickup an item? Well... yeah :) First part: The stat that sends the info you picked something up (don't think I can use WriteByte here, and stat seems ok). --- qcsrc/common/constants.qh | 3 ++- qcsrc/server/defs.qh | 2 ++ qcsrc/server/g_world.qc | 1 + qcsrc/server/t_items.qc | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index b4b92ff8b..4f60c427b 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -310,7 +310,8 @@ const float STAT_SHOTORG = 46; // compressShotOrigin const float STAT_LEADLIMIT = 47; const float STAT_BULLETS_LOADED = 48; const float STAT_NEX_CHARGE = 49; -const float STAT_HUD = 50; +const float STAT_PICKUP_CROSSHAIR = 50; +const float STAT_HUD = 51; // see DP source, quakedef.h const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222; diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 5be04141d..93f1d7bd4 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -603,6 +603,8 @@ string matchid; .float stats_hit[WEP_MAXCOUNT]; // for hitscan bullets hit .float stats_fired[WEP_MAXCOUNT]; // for hitscan bullets fired +.float stat_pickup_crosshair; + FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(stats_hit); FTEQCC_YOU_SUCK_THIS_IS_NOT_UNREFERENCED(stats_fired); diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 73ae5605f..1226c0d2e 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -641,6 +641,7 @@ void spawnfunc_worldspawn (void) addstat(STAT_SHOTORG, AS_INT, stat_shotorg); addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit); addstat(STAT_BULLETS_LOADED, AS_INT, campingrifle_bulletcounter); + addstat(STAT_PICKUP_CROSSHAIR, AS_INT, stat_pickup_crosshair); addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge); diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index ba0cb8bb3..65e9a5044 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -489,6 +489,8 @@ void Item_Touch (void) if(!Item_GiveTo(self, other)) return; + self.stat_pickup_crosshair = time; + pointparticles(particleeffectnum("item_pickup"), self.origin, '0 0 0', 1); if (self.classname == "droppedweapon") -- 2.39.2