From 1f504179db920d0ca53b0ee42da059aa6daf6047 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 20 Nov 2016 06:50:53 +1000 Subject: [PATCH] Remove a few server-side cvars from the client --- qcsrc/common/_all.inc | 2 +- qcsrc/common/constants.qh | 2 ++ qcsrc/common/mutators/mutator/damagetext/damagetext.qc | 3 ++- qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh | 2 ++ qcsrc/common/vehicles/vehicle/racer_weapon.qh | 2 ++ qcsrc/common/vehicles/vehicle/raptor_weapons.qh | 3 ++- qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh | 2 ++ qcsrc/common/weapons/all.qh | 2 ++ qcsrc/ecs/systems/physics.qc | 8 +++----- qcsrc/lib/self.qh | 2 +- qcsrc/lib/spawnfunc.qh | 2 +- qcsrc/lib/warpzone/mathlib.qc | 3 +-- 12 files changed, 21 insertions(+), 12 deletions(-) diff --git a/qcsrc/common/_all.inc b/qcsrc/common/_all.inc index 5177c9dfd..988413f7a 100644 --- a/qcsrc/common/_all.inc +++ b/qcsrc/common/_all.inc @@ -1,4 +1,4 @@ -float autocvar_net_connecttimeout = 30; +noref float autocvar_net_connecttimeout = 30; #ifdef GAMEQC #include "anim.qc" diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index f3acfed4e..0682b331f 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -247,6 +247,7 @@ const int SERVERFLAG_ALLOW_FULLBRIGHT = 1; const int SERVERFLAG_TEAMPLAY = 2; const int SERVERFLAG_PLAYERSTATS = 4; +#ifdef SVQC // FIXME/EXPLAINME: why? Mario: because vector autocvar_sv_player_maxs = '16 16 45'; vector autocvar_sv_player_mins = '-16 -16 -24'; @@ -255,6 +256,7 @@ vector autocvar_sv_player_crouch_maxs = '16 16 25'; vector autocvar_sv_player_crouch_mins = '-16 -16 -24'; vector autocvar_sv_player_crouch_viewoffset = '0 0 20'; vector autocvar_sv_player_headsize = '24 24 12'; +#endif // a bit more constant diff --git a/qcsrc/common/mutators/mutator/damagetext/damagetext.qc b/qcsrc/common/mutators/mutator/damagetext/damagetext.qc index 57b34fae4..7f2b740ba 100644 --- a/qcsrc/common/mutators/mutator/damagetext/damagetext.qc +++ b/qcsrc/common/mutators/mutator/damagetext/damagetext.qc @@ -12,7 +12,8 @@ const int DTFLAG_NO_POTENTIAL = BIT(5); REGISTER_MUTATOR(damagetext, true); -#if defined(CSQC) || defined(MENUQC) +// || defined(MENUQC) +#if defined(CSQC) // no translatable cvar description please AUTOCVAR_SAVE(cl_damagetext, bool, true, "Draw damage dealt where you hit the enemy"); AUTOCVAR_SAVE(cl_damagetext_format, string, "-{total}", "How to format the damage text. {health}, {armor}, {total}, {potential}: full damage not capped to target's health, {potential_health}: health damage not capped to target's health"); diff --git a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh index d4ed9505b..e9c5bf41d 100644 --- a/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/bumblebee_weapons.qh @@ -2,6 +2,7 @@ #include +#ifdef SVQC float autocvar_g_vehicle_bumblebee_cannon_cost = 2; float autocvar_g_vehicle_bumblebee_cannon_damage = 60; float autocvar_g_vehicle_bumblebee_cannon_radius = 225; @@ -9,6 +10,7 @@ float autocvar_g_vehicle_bumblebee_cannon_refire = 0.2; float autocvar_g_vehicle_bumblebee_cannon_speed = 20000; float autocvar_g_vehicle_bumblebee_cannon_spread = 0.02; float autocvar_g_vehicle_bumblebee_cannon_force = -35; +#endif #ifdef SVQC void bumblebee_fire_cannon(entity this, entity _gun, string _tagname, entity _owner); diff --git a/qcsrc/common/vehicles/vehicle/racer_weapon.qh b/qcsrc/common/vehicles/vehicle/racer_weapon.qh index 51c20ef9d..f8b18a86f 100644 --- a/qcsrc/common/vehicles/vehicle/racer_weapon.qh +++ b/qcsrc/common/vehicles/vehicle/racer_weapon.qh @@ -15,6 +15,7 @@ REGISTER_WEAPON(RACER, NEW(RacerAttack)); void racer_fire_rocket(entity player, vector org, vector dir, entity trg); #endif +#ifdef SVQC float autocvar_g_vehicle_racer_cannon_cost = 2; float autocvar_g_vehicle_racer_cannon_damage = 15; float autocvar_g_vehicle_racer_cannon_radius = 100; @@ -33,3 +34,4 @@ float autocvar_g_vehicle_racer_rocket_refire = 3; float autocvar_g_vehicle_racer_rocket_climbspeed = 1600; float autocvar_g_vehicle_racer_rocket_locked_maxangle = 1.8; +#endif diff --git a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh index 4260d4292..a7908d50d 100644 --- a/qcsrc/common/vehicles/vehicle/raptor_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/raptor_weapons.qh @@ -26,7 +26,7 @@ CLASS(RaptorFlare, PortoLaunch) ENDCLASS(RaptorFlare) REGISTER_WEAPON(RAPTOR_FLARE, NEW(RaptorFlare)); - +#ifdef SVQC float autocvar_g_vehicle_raptor_cannon_cost = 1; float autocvar_g_vehicle_raptor_cannon_damage = 10; float autocvar_g_vehicle_raptor_cannon_radius = 60; @@ -51,3 +51,4 @@ float autocvar_g_vehicle_raptor_flare_refire = 5; float autocvar_g_vehicle_raptor_flare_lifetime = 10; float autocvar_g_vehicle_raptor_flare_chase = 0.9; float autocvar_g_vehicle_raptor_flare_range = 2000; +#endif diff --git a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh index a1523045a..199d9cfa4 100644 --- a/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh +++ b/qcsrc/common/vehicles/vehicle/spiderbot_weapons.qh @@ -6,6 +6,7 @@ void spiderbot_rocket_do(entity this); #endif +#ifdef SVQC // 400 (x2) DPS float autocvar_g_vehicle_spiderbot_minigun_damage = 24; float autocvar_g_vehicle_spiderbot_minigun_refire = 0.06; @@ -30,3 +31,4 @@ float autocvar_g_vehicle_spiderbot_rocket_health = 100; float autocvar_g_vehicle_spiderbot_rocket_noise = 0.2; float autocvar_g_vehicle_spiderbot_rocket_turnrate = 0.25; float autocvar_g_vehicle_spiderbot_rocket_lifetime = 20; +#endif diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh index 9570e8c56..a805ce5fd 100644 --- a/qcsrc/common/weapons/all.qh +++ b/qcsrc/common/weapons/all.qh @@ -143,10 +143,12 @@ X(weaponreplace, string) X(weaponstartoverride, float) X(weaponstart, float) X(weaponthrowable, float) +#ifdef SVQC X(reload_ammo, float) .float reloading_ammo = reload_ammo; X(reload_time, float) .float reloading_time = reload_time; +#endif #undef X diff --git a/qcsrc/ecs/systems/physics.qc b/qcsrc/ecs/systems/physics.qc index b25c93b2d..0c18e58cf 100644 --- a/qcsrc/ecs/systems/physics.qc +++ b/qcsrc/ecs/systems/physics.qc @@ -160,9 +160,6 @@ void sys_phys_update(entity this, float dt) /** for players */ void sys_phys_simulate(entity this, float dt) { - const vector g = -this.com_phys_gravity; - const bool jump = this.com_in_jump; - if (!this.com_phys_ground && !this.com_phys_air) { // noclipping // flying @@ -172,6 +169,7 @@ void sys_phys_simulate(entity this, float dt) UNSET_ONGROUND(this); if (this.com_phys_friction_air) { + const vector g = -this.com_phys_gravity; this.velocity_z += g.z / 2; this.velocity = this.velocity * (1 - dt * this.com_phys_friction); this.velocity_z += g.z / 2; @@ -181,7 +179,7 @@ void sys_phys_simulate(entity this, float dt) if (this.com_phys_water) { // water jump only in certain situations // this mimics quakeworld code - if (jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc) { + if (this.com_in_jump && this.waterlevel == WATERLEVEL_SWIMMING && this.velocity_z >= -180 && !this.viewloc) { vector yawangles = '0 1 0' * this.v_angle.y; makevectors(yawangles); vector forward = v_forward; @@ -320,7 +318,7 @@ void sys_phys_simulate(entity this, float dt) } // holding jump button swims upward slowly - if (jump && !this.viewloc) { + if (this.com_in_jump && !this.viewloc) { // was: // lava: 50 // slime: 80 diff --git a/qcsrc/lib/self.qh b/qcsrc/lib/self.qh index 43bd12314..f4c246f33 100644 --- a/qcsrc/lib/self.qh +++ b/qcsrc/lib/self.qh @@ -48,7 +48,7 @@ #define SELFWRAP(T, R, oldargs, args, forward) \ .R oldargs T; \ - .R oldargs __##T = T; \ + noref .R oldargs __##T = T; \ .R args self##T; \ R T##_self oldargs { ENGINE_EVENT(); return this.self##T forward; } diff --git a/qcsrc/lib/spawnfunc.qh b/qcsrc/lib/spawnfunc.qh index 4e3bc062d..e8aeaecae 100644 --- a/qcsrc/lib/spawnfunc.qh +++ b/qcsrc/lib/spawnfunc.qh @@ -29,7 +29,7 @@ noref bool require_spawnfunc_prefix; noref bool __spawnfunc_expecting; noref entity __spawnfunc_expect; - bool __spawnfunc_unreachable_workaround = true; + noref bool __spawnfunc_unreachable_workaround = true; #define spawnfunc_1(id) spawnfunc_2(id, FIELDS_UNION) #define spawnfunc_2(id, whitelist) \ diff --git a/qcsrc/lib/warpzone/mathlib.qc b/qcsrc/lib/warpzone/mathlib.qc index 868724fa8..e19051827 100644 --- a/qcsrc/lib/warpzone/mathlib.qc +++ b/qcsrc/lib/warpzone/mathlib.qc @@ -169,8 +169,7 @@ vector lgamma(float e) } float tgamma(float e) { - vector v; - v = lgamma(e); + vector v = lgamma(e); return exp(v.x) * v.y; } -- 2.39.2