From c7d8f63d71a92e01c2afbb57846b1e96fddb8f2b Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 26 Nov 2011 11:09:21 +0100 Subject: [PATCH] some more cleanup - all svqc warnings gone --- qcsrc/common/gamecommand.qc | 4 -- qcsrc/{server => dpdefs}/dpextensions.qc | 0 qcsrc/{server => dpdefs}/progsdefs.qc | 0 qcsrc/server/autocvars.qh | 2 - qcsrc/server/clientcommands.qc | 2 +- qcsrc/server/defs.qh | 2 +- qcsrc/server/g_damage.qc | 6 ++- qcsrc/server/miscfunctions.qc | 6 +-- qcsrc/server/post-builtins.qh | 3 -- qcsrc/server/pre-builtins.qh | 6 --- qcsrc/server/progs.src | 11 +++-- qcsrc/server/sys-post.qh | 14 ++++++ qcsrc/server/{sys.qh => sys-pre.qh} | 11 ++--- qcsrc/server/t_quake.qc | 49 --------------------- qcsrc/server/tturrets/system/system_main.qc | 2 +- qcsrc/server/vehicles/spiderbot.qc | 2 - 16 files changed, 32 insertions(+), 88 deletions(-) rename qcsrc/{server => dpdefs}/dpextensions.qc (100%) rename qcsrc/{server => dpdefs}/progsdefs.qc (100%) delete mode 100644 qcsrc/server/post-builtins.qh delete mode 100644 qcsrc/server/pre-builtins.qh create mode 100644 qcsrc/server/sys-post.qh rename qcsrc/server/{sys.qh => sys-pre.qh} (64%) diff --git a/qcsrc/common/gamecommand.qc b/qcsrc/common/gamecommand.qc index c2b986bb8..ee1657d66 100644 --- a/qcsrc/common/gamecommand.qc +++ b/qcsrc/common/gamecommand.qc @@ -424,11 +424,7 @@ float GameCommand_Generic(string command) rpn_error = TRUE; } } else if(rpncmd == "load") { -#ifdef SVQC - rpn_set(cvar_string_builtin(rpn_get())); // cvar name comes from user -#else rpn_set(cvar_string(rpn_get())); -#endif } else if(rpncmd == "exch") { s = rpn_pop(); s2 = rpn_get(); diff --git a/qcsrc/server/dpextensions.qc b/qcsrc/dpdefs/dpextensions.qc similarity index 100% rename from qcsrc/server/dpextensions.qc rename to qcsrc/dpdefs/dpextensions.qc diff --git a/qcsrc/server/progsdefs.qc b/qcsrc/dpdefs/progsdefs.qc similarity index 100% rename from qcsrc/server/progsdefs.qc rename to qcsrc/dpdefs/progsdefs.qc diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh index 3b64b1b63..e1d64b9aa 100644 --- a/qcsrc/server/autocvars.qh +++ b/qcsrc/server/autocvars.qh @@ -759,7 +759,6 @@ float autocvar_g_chat_flood_spl_team; float autocvar_g_chat_flood_spl_tell; float autocvar_g_chat_nospectators; float autocvar_g_chat_teamcolors; -float autocvar_g_ctf_allow_drop; float autocvar_g_ctf_captimerecord_always; float autocvar_g_ctf_capture_leadlimit; float autocvar_g_ctf_capture_limit; @@ -927,7 +926,6 @@ float autocvar_g_player_alpha; float autocvar_g_player_brightness; float autocvar_g_playerclip_collisions; string autocvar_g_playerstats_uri; -float autocvar_g_playerstats_debug; float autocvar_g_powerup_shield; float autocvar_g_powerup_strength; float autocvar_g_powerup_superhealth; diff --git a/qcsrc/server/clientcommands.qc b/qcsrc/server/clientcommands.qc index cfbc5ff18..3deddf801 100644 --- a/qcsrc/server/clientcommands.qc +++ b/qcsrc/server/clientcommands.qc @@ -369,7 +369,7 @@ void SV_ParseClientCommand(string s) { } //clientcommand(self, formatmessage(s)); } else if(cmd_name == "info") { - cmd_name = cvar_string_builtin(strcat("sv_info_", argv(1))); // This needed fixed for the cvar check + cmd_name = builtin_cvar_string(strcat("sv_info_", argv(1))); // This needed fixed for the cvar check if(cmd_name == "") sprint(self, "ERROR: unsupported info command\n"); else diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index b84d03164..2a09d261c 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -1,6 +1,6 @@ #define INDEPENDENT_ATTACK_FINISHED -float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions +noref float require_spawnfunc_prefix; // if this float exists, only functions with spawnfunc_ name prefix qualify as spawn functions #define BUTTON_ATCK button0 #define BUTTON_JUMP button2 diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index fe4df352f..170793a55 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -629,6 +629,7 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float { vector v; v = healtharmor_applydamage(attacker.armorvalue, autocvar_g_balance_armor_blockpercent, mirrordamage); + v_z = 0; // fteqcc sucks attacker.dmg_take += v_x; attacker.dmg_save += v_y; attacker.dmg_inflictor = inflictor; @@ -640,12 +641,13 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float { vector v; v = healtharmor_applydamage(targ.armorvalue, autocvar_g_balance_armor_blockpercent, damage); + v_z = 0; // fteqcc sucks targ.dmg_take += v_x; targ.dmg_save += v_y; targ.dmg_inflictor = inflictor; damage = 0; - if(!autocvar_g_friendlyfire_virtual_force) - force = '0 0 0'; + if(!autocvar_g_friendlyfire_virtual_force) + force = '0 0 0'; } } else diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 4eed8f0c9..5a575dd0e 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -3035,14 +3035,14 @@ float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float #ifdef RELEASE -#define cvar_string_normal cvar_string_builtin -#define cvar_normal cvar_builtin +#define cvar_string_normal builtin_cvar_string +#define cvar_normal builtin_cvar #else string cvar_string_normal(string n) { if not(cvar_type(n) & 1) backtrace(strcat("Attempt to access undefined cvar: ", n)); - return cvar_string_builtin(n); + return builtin_cvar_string(n); } float cvar_normal(string n) diff --git a/qcsrc/server/post-builtins.qh b/qcsrc/server/post-builtins.qh deleted file mode 100644 index ad554d2cc..000000000 --- a/qcsrc/server/post-builtins.qh +++ /dev/null @@ -1,3 +0,0 @@ -#undef cvar -#undef cvar_string -#undef cvar_set diff --git a/qcsrc/server/pre-builtins.qh b/qcsrc/server/pre-builtins.qh deleted file mode 100644 index 764fa3836..000000000 --- a/qcsrc/server/pre-builtins.qh +++ /dev/null @@ -1,6 +0,0 @@ -var float(string var) cvar; -var string(string var) cvar_string; -var void(string var, string val) cvar_set; -#define cvar cvar_builtin -#define cvar_string cvar_string_builtin -#define cvar_set cvar_set_builtin diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index ed73da6d1..3e4ebb8fa 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -1,12 +1,11 @@ ../../progs.dat // output filename -../common/util-pre.qh +sys-pre.qh +../dpdefs/progsdefs.qc +../dpdefs/dpextensions.qc +sys-post.qh -sys.qh -pre-builtins.qh -builtins.qh -dpextensions.qc -post-builtins.qh +../common/util-pre.qh ../warpzonelib/anglestransform.qh ../warpzonelib/mathlib.qh diff --git a/qcsrc/server/sys-post.qh b/qcsrc/server/sys-post.qh new file mode 100644 index 000000000..919ed6b8d --- /dev/null +++ b/qcsrc/server/sys-post.qh @@ -0,0 +1,14 @@ +#pragma noref 0 + +#undef ATTN_NORM +#undef objerror +#undef droptofloor +#undef sound +#undef remove +#undef cvar_set +#undef cvar_string +#undef cvar + +var float(string var) cvar; +var string(string var) cvar_string; +var void(string var, string val) cvar_set; diff --git a/qcsrc/server/sys.qh b/qcsrc/server/sys-pre.qh similarity index 64% rename from qcsrc/server/sys.qh rename to qcsrc/server/sys-pre.qh index 9c0548385..b259b2b6c 100644 --- a/qcsrc/server/sys.qh +++ b/qcsrc/server/sys-pre.qh @@ -6,12 +6,7 @@ #define sound builtin_sound #define remove builtin_remove #define cvar_set builtin_cvar_set +#define cvar_string builtin_cvar_string +#define cvar builtin_cvar -#include "progsdefs.qc" - -#undef ATTN_NORM -#undef objerror -#undef droptofloor -#undef sound -#undef remove -#undef cvar_set +#pragma noref 1 diff --git a/qcsrc/server/t_quake.qc b/qcsrc/server/t_quake.qc index ada78846b..ab49c6db5 100644 --- a/qcsrc/server/t_quake.qc +++ b/qcsrc/server/t_quake.qc @@ -16,52 +16,3 @@ void spawnfunc_item_health (void) {if (self.spawnflags & 2) spawnfunc_item_healt -// garbage function to reduce warnings in compiling about unused variables -void junk_function () -{ - self.exteriormodeltoclient = world; - self.glow_trail = 0; - self.tag_entity = world; - self.BUTTON_HOOK = 0; - self.BUTTON_INFO = 0; - self.button8 = 0; - self.pitch_speed = 0; - self.drawonlytoclient = world; - self.nodrawtoclient = world; - self.cursor_active = 0; - self.cursor_screen = '0 0 0'; - self.cursor_trace_start = '0 0 0'; - self.cursor_trace_endpos = '0 0 0'; - self.ping = 0; - self.roomtype = 0; - self.radius = 0; - self.pitch = 0; - self.renderamt = 0; - self.rendermode = 0; - self.rendercolor = '0 0 0'; - self.light_lev = 0; - self.color = '0 0 0'; - self.style = 0; - self.jumppadsused = world; - self.disableclientprediction = 0; - self.contentstransition = SUB_Null; - self.dphitcontentsmask = 0; - self.modelflags = 0; - self.attack_finished_for = 0; // why is this even valid? Spiiiiiiiiiiiiiiiiiiiiike! - self.notsingle = 0; - trace_dphittexturename = ""; - require_spawnfunc_prefix = 1; - self.movetypesteplandevent = SUB_Null; - self.viewzoom = 0; - self.cvar_cl_weaponpriorities = ""; - self.scores = 0; - self.teamscores = 0; - gettaginfo_parent = 0; - gettaginfo_name = ""; - gettaginfo_offset = '0 0 0'; - gettaginfo_forward = '0 0 0'; - gettaginfo_right = '0 0 0'; - gettaginfo_up = '0 0 0'; - self.mass = 0; -} - diff --git a/qcsrc/server/tturrets/system/system_main.qc b/qcsrc/server/tturrets/system/system_main.qc index 6b92f8bb0..b1a97ba44 100644 --- a/qcsrc/server/tturrets/system/system_main.qc +++ b/qcsrc/server/tturrets/system/system_main.qc @@ -213,7 +213,7 @@ entity turret_projectile(string _snd, float _size, float _health, float _death, **/ void turret_do_updates(entity t_turret) { - vector enemy_pos, oldpos; + vector enemy_pos; entity oldself; oldself = self; diff --git a/qcsrc/server/vehicles/spiderbot.qc b/qcsrc/server/vehicles/spiderbot.qc index a03c8c4f8..f1cb57551 100644 --- a/qcsrc/server/vehicles/spiderbot.qc +++ b/qcsrc/server/vehicles/spiderbot.qc @@ -51,8 +51,6 @@ float autocvar_g_vehicle_spiderbot_rocket_noise; float autocvar_g_vehicle_spiderbot_rocket_turnrate; float autocvar_g_vehicle_spiderbot_rocket_lifetime; -float autocvar_g_vehicle_spiderbot_bouncefactor; -float autocvar_g_vehicle_spiderbot_bouncestop; vector autocvar_g_vehicle_spiderbot_bouncepain; -- 2.39.2