From: TimePath Date: Sat, 7 Nov 2015 04:43:18 +0000 (+1100) Subject: Stats: register ALLOW_OLDVORTEXBEAM X-Git-Tag: xonotic-v0.8.2~1609^2~19 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=94baf63b0ead02a02098b196b835a9bd527ea476;p=xonotic%2Fxonotic-data.pk3dir.git Stats: register ALLOW_OLDVORTEXBEAM --- diff --git a/qcsrc/common/stats.qh b/qcsrc/common/stats.qh index 31a7ab618..1a9a38fc5 100644 --- a/qcsrc/common/stats.qh +++ b/qcsrc/common/stats.qh @@ -89,7 +89,7 @@ enum { STAT_LAST_VECTOR }; -const int REGISTERED_STATS = 7; +const int REGISTERED_STATS = 8; REGISTER_STAT(KH_KEYS, int) /** weapon requested to switch to; next WANTED weapon (for HUD) */ @@ -100,11 +100,12 @@ REGISTER_STAT(INVINCIBLE_FINISHED, float) /** arc heat in [0,1] */ REGISTER_STAT(ARC_HEAT, float) REGISTER_STAT(PRESSED_KEYS, int) +/** this stat could later contain some other bits of info, like, more server-side particle config */ +REGISTER_STAT(ALLOW_OLDVORTEXBEAM, bool) enum { STAT_FIRST_MAIN = (STAT_LAST_VECTOR - 1) + REGISTERED_STATS, - /** this stat could later contain some other bits of info, like, more server-side particle config */ STAT_ALLOW_OLDVORTEXBEAM, STAT_FUEL, STAT_NB_METERSTART, /** compressShotOrigin */ STAT_SHOTORG, diff --git a/qcsrc/common/weapons/weapon/vortex.qc b/qcsrc/common/weapons/weapon/vortex.qc index bae7cca3d..072bc1cbe 100644 --- a/qcsrc/common/weapons/weapon/vortex.qc +++ b/qcsrc/common/weapons/weapon/vortex.qc @@ -91,7 +91,7 @@ NET_HANDLE(TE_CSQC_VORTEXBEAMPARTICLE, bool isNew) charge = sqrt(charge); // divide evenly among trail spacing and alpha particles_alphamin = particles_alphamax = particles_fade = charge; - if (autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo())) + if (autocvar_cl_particles_oldvortexbeam && (STAT(ALLOW_OLDVORTEXBEAM) || isdemo())) WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); else WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE); diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index afdca0b06..90cb409a8 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -406,7 +406,7 @@ void W_Porto_Remove (entity p); .string message2; -.float stat_allow_oldvortexbeam; +.bool stat_allow_oldvortexbeam = _STAT(ALLOW_OLDVORTEXBEAM); // reset to 0 on weapon switch // may be useful to all weapons diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index b60eb9c82..eeb6801de 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -759,7 +759,6 @@ spawnfunc(worldspawn) WepSet_AddStat_InMap(); addstat(STAT_SWITCHINGWEAPON, AS_INT, switchingweapon); addstat(STAT_ROUNDSTARTTIME, AS_FLOAT, stat_round_starttime); - addstat(STAT_ALLOW_OLDVORTEXBEAM, AS_INT, stat_allow_oldvortexbeam); Nagger_Init(); addstat(STAT_SUPERWEAPONS_FINISHED, AS_FLOAT, superweapons_finished);