From 048eec2a1ac0b11c0e6387f7dbc17d15f5e6fb07 Mon Sep 17 00:00:00 2001 From: TimePath Date: Wed, 9 Sep 2015 21:56:47 +1000 Subject: [PATCH] Lint --- qcsrc/client/progs.inc | 77 +++++++++++++++ qcsrc/client/progs.src | 79 +-------------- qcsrc/client/weapons/projectile.qc | 18 ++-- qcsrc/common/buffs.qh | 4 +- qcsrc/common/effects.qh | 2 +- qcsrc/common/mutators/base.qh | 2 +- qcsrc/common/nades.qh | 4 +- qcsrc/common/physics.qc | 12 +-- qcsrc/common/triggers/func/breakable.qc | 2 +- qcsrc/common/triggers/subs.qc | 8 +- qcsrc/common/triggers/target/speaker.qc | 14 ++- qcsrc/common/turrets/config.qh | 15 +-- qcsrc/common/turrets/turrets.qh | 16 +-- qcsrc/common/util-pre.qh | 6 +- qcsrc/common/vehicles/all.qc | 4 +- qcsrc/common/vehicles/all.qh | 2 +- qcsrc/common/vehicles/sv_vehicles.qc | 6 +- qcsrc/common/weapons/weapon/porto.qc | 2 +- qcsrc/lib/Accumulate.qh | 2 +- qcsrc/lib/Nil.qh | 2 +- qcsrc/lib/OO.qh | 2 +- qcsrc/menu/progs.inc | 29 ++++++ qcsrc/menu/progs.src | 32 +----- qcsrc/server/cl_player.qc | 3 +- qcsrc/server/mutators/gamemode_ctf.qc | 4 +- qcsrc/server/mutators/mutator_buffs.qc | 6 +- qcsrc/server/progs.inc | 123 +++++++++++++++++++++++ qcsrc/server/progs.src | 125 +----------------------- 28 files changed, 286 insertions(+), 315 deletions(-) create mode 100644 qcsrc/client/progs.inc create mode 100644 qcsrc/menu/progs.inc create mode 100644 qcsrc/server/progs.inc diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc new file mode 100644 index 000000000..b46a371de --- /dev/null +++ b/qcsrc/client/progs.inc @@ -0,0 +1,77 @@ +#include "../common/util-pre.qh" +#include "../dpdefs/csprogsdefs.qh" +#include "../common/util-post.qh" + +#include "../lib/_all.inc" + +#include "announcer.qc" +#include "bgmscript.qc" +#include "controlpoint.qc" +#include "csqcmodel_hooks.qc" +#include "damage.qc" +#include "effects.qc" +#include "generator.qc" +#include "gibs.qc" +#include "hook.qc" +#include "hud.qc" +#include "hud_config.qc" +#include "main.qc" +#include "mapvoting.qc" +#include "miscfunctions.qc" +#include "modeleffects.qc" +#include "movelib.qc" +#include "particles.qc" +#include "player_skeleton.qc" +#include "rubble.qc" +#include "scoreboard.qc" +#include "shownames.qc" +#include "teamradar.qc" +#include "tuba.qc" +#include "t_items.qc" +#include "view.qc" +#include "wall.qc" + +#include "command/all.qc" + +#include "weapons/projectile.qc" // TODO + +#include "../common/animdecide.qc" +#include "../common/buffs.qc" +#include "../common/effects.qc" +#include "../common/mapinfo.qc" +#include "../common/movetypes/include.qc" +#include "../common/nades.qc" +#include "../common/net_notice.qc" +#include "../common/notifications.qc" +#include "../common/physics.qc" +#include "../common/playerstats.qc" +#include "../common/util.qc" + +#include "../common/viewloc.qc" + +#include "../common/minigames/minigames.qc" +#include "../common/minigames/cl_minigames.qc" + +#include "../common/items/all.qc" +#include "../common/monsters/all.qc" +#include "../common/mutators/all.qc" +#include "../common/vehicles/all.qc" +#include "../common/weapons/all.qc" + +#include "../common/turrets/cl_turrets.qc" +#include "../common/turrets/turrets.qc" + +#include "../common/triggers/include.qc" + +#include "../csqcmodellib/cl_model.qc" +#include "../csqcmodellib/cl_player.qc" +#include "../csqcmodellib/interpolate.qc" + +#include "../server/mutators/mutator_multijump.qc" + +#include "../warpzonelib/anglestransform.qc" +#include "../warpzonelib/client.qc" +#include "../warpzonelib/common.qc" +#include "../warpzonelib/util_server.qc" + +#include "../mod/client/progs.inc" diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index 02e52fe0d..8a3c0360f 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -1,79 +1,2 @@ ../../csprogs.dat - -../common/util-pre.qh -../dpdefs/csprogsdefs.qh -../common/util-post.qh - -../lib/_all.inc - -announcer.qc -bgmscript.qc -controlpoint.qc -csqcmodel_hooks.qc -damage.qc -effects.qc -generator.qc -gibs.qc -hook.qc -hud.qc -hud_config.qc -main.qc -mapvoting.qc -miscfunctions.qc -modeleffects.qc -movelib.qc -particles.qc -player_skeleton.qc -rubble.qc -scoreboard.qc -shownames.qc -teamradar.qc -tuba.qc -t_items.qc -view.qc -wall.qc - -command/all.qc - -weapons/projectile.qc // TODO - -../common/animdecide.qc -../common/buffs.qc -../common/effects.qc -../common/mapinfo.qc -../common/movetypes/include.qc -../common/nades.qc -../common/net_notice.qc -../common/notifications.qc -../common/physics.qc -../common/playerstats.qc -../common/util.qc - -../common/viewloc.qc - -../common/minigames/minigames.qc -../common/minigames/cl_minigames.qc - -../common/items/all.qc -../common/monsters/all.qc -../common/mutators/all.qc -../common/vehicles/all.qc -../common/weapons/all.qc - -../common/turrets/cl_turrets.qc -../common/turrets/turrets.qc - -../common/triggers/include.qc - -../csqcmodellib/cl_model.qc -../csqcmodellib/cl_player.qc -../csqcmodellib/interpolate.qc - -../server/mutators/mutator_multijump.qc - -../warpzonelib/anglestransform.qc -../warpzonelib/client.qc -../warpzonelib/common.qc -../warpzonelib/util_server.qc - -../mod/client/progs.inc +progs.inc diff --git a/qcsrc/client/weapons/projectile.qc b/qcsrc/client/weapons/projectile.qc index 7f13ab5df..0d143cb1e 100644 --- a/qcsrc/client/weapons/projectile.qc +++ b/qcsrc/client/weapons/projectile.qc @@ -114,7 +114,7 @@ void Projectile_Draw() break; } - if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL) + if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null) rot = self.avelocity; self.angles = AnglesTransform_ToAngles(AnglesTransform_Multiply(AnglesTransform_FromAngles(self.angles), rot * (t - self.spawntime))); @@ -142,7 +142,7 @@ void Projectile_Draw() break; } - if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL) + if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null) trailorigin += v_up * 4; if(drawn) @@ -290,8 +290,8 @@ void Ent_Projectile() case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break; case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break; case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break; - case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(EFFECT_NULL); break; - case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(EFFECT_NULL); break; + case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(EFFECT_Null); break; + case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(EFFECT_Null); break; case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break; case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break; case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE); break; @@ -307,13 +307,13 @@ void Ent_Projectile() case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE); break; case PROJECTILE_SHAMBLER_LIGHTNING: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; - case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break; - case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break; + case PROJECTILE_RAPTORBOMB: setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_Null); break; + case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_Null); break; case PROJECTILE_RAPTORCANNON: setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break; case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum(EFFECT_SPIDERBOT_ROCKET_TRAIL); break; case PROJECTILE_WAKIROCKET: setmodel(self, "models/vehicles/rocket01.md3"); self.traileffect = particleeffectnum(EFFECT_RACER_ROCKET_TRAIL); break; - case PROJECTILE_WAKICANNON: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum(EFFECT_NULL); break; + case PROJECTILE_WAKICANNON: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum(EFFECT_Null); break; case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break; @@ -326,7 +326,7 @@ void Ent_Projectile() if(MUTATOR_CALLHOOK(Ent_Projectile, self)) break; - if (Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL) + if (Nade_FromProjectile(self.cnt) != NADE_TYPE_Null) { setmodel(self, W_Model("v_ok_grenade.md3")); self.traileffect = _particleeffectnum(Nade_TrailEffect(self.cnt, self.team)); @@ -461,7 +461,7 @@ void Ent_Projectile() break; } - if(Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL) + if(Nade_FromProjectile(self.cnt) != NADE_TYPE_Null) { entity nade_type = Nade_FromProjectile(self.cnt); self.mins = '-16 -16 -16'; diff --git a/qcsrc/common/buffs.qh b/qcsrc/common/buffs.qh index eeaba7371..3eff9e26b 100644 --- a/qcsrc/common/buffs.qh +++ b/qcsrc/common/buffs.qh @@ -40,7 +40,7 @@ CLASS(Buff, Pickup) #endif ENDCLASS(Buff) -REGISTER_BUFF(NULL); +REGISTER_BUFF(Null); REGISTER_BUFF(AMMO) { this.m_prettyName = _("Ammo"); @@ -173,7 +173,7 @@ BUFF_SPAWNFUNCS(invisible, BUFF_INVISIBLE) BUFF_SPAWNFUNCS(inferno, BUFF_INFERNO) BUFF_SPAWNFUNCS(swapper, BUFF_SWAPPER) BUFF_SPAWNFUNCS(magnet, BUFF_MAGNET) -BUFF_SPAWNFUNCS(random, BUFF_NULL) +BUFF_SPAWNFUNCS(random, BUFF_Null) BUFF_SPAWNFUNC_Q3TA_COMPAT(doubler, BUFF_MEDIC) BUFF_SPAWNFUNC_Q3TA_COMPAT(resistance, BUFF_RESISTANCE) diff --git a/qcsrc/common/effects.qh b/qcsrc/common/effects.qh index b72eab243..b0c452ce0 100644 --- a/qcsrc/common/effects.qh +++ b/qcsrc/common/effects.qh @@ -54,7 +54,7 @@ void RegisterEffects_Done() // NOW we actually activate the declarations ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First); -EFFECT(0, NULL, string_null) +EFFECT(0, Null, string_null) #include "effects.inc" ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done); diff --git a/qcsrc/common/mutators/base.qh b/qcsrc/common/mutators/base.qh index 1183914cf..a8f6c53a9 100644 --- a/qcsrc/common/mutators/base.qh +++ b/qcsrc/common/mutators/base.qh @@ -254,7 +254,7 @@ STATIC_INIT_LATE(Mutators) { bool HOOKFUNCTION_##name() #define MUTATOR_HOOKFUNCTION_2(mut, cb) \ - MUTATOR_HOOKFUNCTION(mut, cb, CBC_ORDER_ANY) + MUTATOR_HOOKFUNCTION_3(mut, cb, CBC_ORDER_ANY) #define MUTATOR_HOOKFUNCTION_3(mut, cb, order) \ _MUTATOR_CALLBACK(mut##_##cb, mut##_##cb) \ diff --git a/qcsrc/common/nades.qh b/qcsrc/common/nades.qh index 5a9877c4e..9ec6c2914 100644 --- a/qcsrc/common/nades.qh +++ b/qcsrc/common/nades.qh @@ -40,7 +40,7 @@ CLASS(Nade, Object) } ENDCLASS(Nade) -REGISTER_NADE(NULL); +REGISTER_NADE(Null); #define NADE_PROJECTILE(i, projectile, trail) do { \ this.m_projectile[i] = projectile; \ @@ -109,7 +109,7 @@ entity Nade_FromProjectile(float proj) if (it.m_projectile[j] == proj) return it; } )); - return NADE_TYPE_NULL; + return NADE_TYPE_Null; } string Nade_TrailEffect(float proj, float nade_team) diff --git a/qcsrc/common/physics.qc b/qcsrc/common/physics.qc index b3db77143..1a799c8de 100644 --- a/qcsrc/common/physics.qc +++ b/qcsrc/common/physics.qc @@ -25,15 +25,15 @@ float Physics_ClientOption(entity pl, string option) { if(Physics_Valid(pl.cvar_cl_physics)) { - string var = sprintf("g_physics_%s_%s", pl.cvar_cl_physics, option); - if(cvar_type(var) & CVAR_TYPEFLAG_EXISTS) - return cvar(var); + string s = sprintf("g_physics_%s_%s", pl.cvar_cl_physics, option); + if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS) + return cvar(s); } if(autocvar_g_physics_clientselect && autocvar_g_physics_clientselect_default) { - string var = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option); - if(cvar_type(var) & CVAR_TYPEFLAG_EXISTS) - return cvar(var); + string s = sprintf("g_physics_%s_%s", autocvar_g_physics_clientselect_default, option); + if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS) + return cvar(s); } return cvar(strcat("sv_", option)); } diff --git a/qcsrc/common/triggers/func/breakable.qc b/qcsrc/common/triggers/func/breakable.qc index d705f842f..160399d0d 100644 --- a/qcsrc/common/triggers/func/breakable.qc +++ b/qcsrc/common/triggers/func/breakable.qc @@ -5,7 +5,7 @@ #include "../../../server/g_subs.qh" #include "../../../server/g_damage.qh" #include "../../../server/bot/bot.qh" -#include "../../common/csqcmodel_settings.qh" +#include "../../../common/csqcmodel_settings.qh" #include "../../../csqcmodellib/sv_model.qh" #include "../../../server/weapons/common.qh" diff --git a/qcsrc/common/triggers/subs.qc b/qcsrc/common/triggers/subs.qc index b313c4999..d9de97301 100644 --- a/qcsrc/common/triggers/subs.qc +++ b/qcsrc/common/triggers/subs.qc @@ -123,9 +123,11 @@ void SUB_CalcMove_controller_think (void) destangle_x = -destangle_x; // flip up / down orientation // take the shortest distance for the angles - SUB_ANGLES(self.owner)_x -= 360 * floor((SUB_ANGLES(self.owner)_x - destangle_x) / 360 + 0.5); - SUB_ANGLES(self.owner)_y -= 360 * floor((SUB_ANGLES(self.owner)_y - destangle_y) / 360 + 0.5); - SUB_ANGLES(self.owner)_z -= 360 * floor((SUB_ANGLES(self.owner)_z - destangle_z) / 360 + 0.5); + vector v = SUB_ANGLES(self.owner); + v.x -= 360 * floor((v.x - destangle_x) / 360 + 0.5); + v.y -= 360 * floor((v.y - destangle_y) / 360 + 0.5); + v.z -= 360 * floor((v.z - destangle_z) / 360 + 0.5); + SUB_ANGLES(self.owner) = v; angloc = destangle - SUB_ANGLES(self.owner); angloc = angloc * (1 / PHYS_INPUT_FRAMETIME); // so it arrives for the next frame self.owner.SUB_AVELOCITY = angloc; diff --git a/qcsrc/common/triggers/target/speaker.qc b/qcsrc/common/triggers/target/speaker.qc index 058ffd526..e0701dc14 100644 --- a/qcsrc/common/triggers/target/speaker.qc +++ b/qcsrc/common/triggers/target/speaker.qc @@ -8,15 +8,14 @@ void target_speaker_use_activator() string snd; if(substring(self.noise, 0, 1) == "*") { - var .string sample; - sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); + var .string sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); if(GetPlayerSoundSampleField_notFound) snd = "misc/null.wav"; - else if(activator.sample == "") + else if(activator.(sample) == "") snd = "misc/null.wav"; else { - tokenize_console(activator.sample); + tokenize_console(activator.(sample)); float n; n = stof(argv(1)); if(n > 0) @@ -35,15 +34,14 @@ void target_speaker_use_on() string snd; if(substring(self.noise, 0, 1) == "*") { - var .string sample; - sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); + var .string sample = GetVoiceMessageSampleField(substring(self.noise, 1, -1)); if(GetPlayerSoundSampleField_notFound) snd = "misc/null.wav"; - else if(activator.sample == "") + else if(activator.(sample) == "") snd = "misc/null.wav"; else { - tokenize_console(activator.sample); + tokenize_console(activator.(sample)); float n; n = stof(argv(1)); if(n > 0) diff --git a/qcsrc/common/turrets/config.qh b/qcsrc/common/turrets/config.qh index 9eb69f29d..4d35ee3b3 100644 --- a/qcsrc/common/turrets/config.qh +++ b/qcsrc/common/turrets/config.qh @@ -7,27 +7,14 @@ void Dump_Turret_Settings(void); float tur_config_file; float tur_config_alsoprint; -#define MAX_TUR_CONFIG 256 +const int MAX_TUR_CONFIG = 256; float TUR_CONFIG_COUNT; string tur_config_queue[MAX_TUR_CONFIG]; -#define TUR_CONFIG_QUEUE(a) { \ - tur_config_queue[TUR_CONFIG_COUNT] = a; \ - ++TUR_CONFIG_COUNT; } - #define TUR_CONFIG_WRITETOFILE(a) { \ fputs(tur_config_file, a); \ if(tur_config_alsoprint) { LOG_INFO(a); } } -#define TUR_CONFIG_WRITE_CVARS(turret,name) \ - { TUR_CONFIG_QUEUE( \ - sprintf("set g_turrets_unit_%s_%s %g\n", #turret, #name, \ - cvar(sprintf("g_turrets_unit_%s_%s", #turret, #name)))) } \ - -#define TUR_CONFIG_SETTINGS(tursettings) \ - #define TUR_ADD_CVAR(turret,name) TUR_CONFIG_WRITE_CVARS(turret,name) \ - tursettings \ - #undef TUR_ADD_CVAR #endif diff --git a/qcsrc/common/turrets/turrets.qh b/qcsrc/common/turrets/turrets.qh index b3736aff9..0c2250bc9 100644 --- a/qcsrc/common/turrets/turrets.qh +++ b/qcsrc/common/turrets/turrets.qh @@ -158,7 +158,7 @@ void register_turret(float id, float(float) func, float turretflags, vector min_ void register_turrets_done(); const float TUR_MAXCOUNT = 24; -#define TUR_FIRST 1 +const int TUR_FIRST = 1; float TUR_COUNT; float TUR_LAST; @@ -180,22 +180,8 @@ float TUR_LAST; REGISTER_TURRET_2(TUR_##id,func,turretflags,min_s,max_s,modelname,headmodelname,shortname,mname) #endif -#define TUR_DUPECHECK(dupecheck,cvar) \ - #ifndef dupecheck \ - #define dupecheck \ - float cvar; \ - #else \ - #error DUPLICATE TURRET CVAR: cvar \ - #endif - -#define TUR_ADD_CVAR(turret,name) \ - TUR_DUPECHECK(TUR_CVAR_##turret##_##name, autocvar_g_turrets_unit_##turret##_##name) - -#define TUR_CVAR(turret,name) autocvar_g_turrets_unit_##turret##_##name - #include "all.qh" -#undef TUR_ADD_CVAR #undef REGISTER_TURRET ACCUMULATE_FUNCTION(RegisterTurrets, register_turrets_done); diff --git a/qcsrc/common/util-pre.qh b/qcsrc/common/util-pre.qh index b81fd2a6d..22cdfda81 100644 --- a/qcsrc/common/util-pre.qh +++ b/qcsrc/common/util-pre.qh @@ -13,7 +13,7 @@ #ifndef QCC_SUPPORT_NIL #ifdef GMQCC - #define QCC_SUPPORT_NIL + #define QCC_SUPPORT_NIL 1 #endif #endif @@ -48,8 +48,8 @@ #ifdef GMQCC #define OVERLOAD(F, ...) F##_##__VA_COUNT__(__VA_ARGS__) #else - #define OVERLOAD_(F,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n - #define OVERLOAD(F, ...) OVERLOAD_(F,__VA_ARGS__,9,8,7,6,5,4,3,2,1)(__VA_ARGS__) + #define OVERLOAD_(F,_16,_15,_14,_13,_12,_11,_10,_9,_8,_7,_6,_5,_4,_3,_2,_1,n,...) F##_##n + #define OVERLOAD(F, ...) OVERLOAD_(F,__VA_ARGS__,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1)(__VA_ARGS__) #endif #define LAMBDA(...) { __VA_ARGS__ ; } diff --git a/qcsrc/common/vehicles/all.qc b/qcsrc/common/vehicles/all.qc index f0316ab1f..923ed4e5b 100644 --- a/qcsrc/common/vehicles/all.qc +++ b/qcsrc/common/vehicles/all.qc @@ -48,9 +48,9 @@ STATIC_INIT(vehicles_common_initialize) entity get_vehicleinfo(int id) { - if (id < VEH_FIRST || id > VEH_LAST) return VEH_NULL; + if (id < VEH_FIRST || id > VEH_LAST) return VEH_Null; entity m = vehicle_info[id]; - return m ? m : VEH_NULL; + return m ? m : VEH_Null; } #endif diff --git a/qcsrc/common/vehicles/all.qh b/qcsrc/common/vehicles/all.qh index fa9e83f48..a18bfe13e 100644 --- a/qcsrc/common/vehicles/all.qh +++ b/qcsrc/common/vehicles/all.qh @@ -76,7 +76,7 @@ const int VEH_FIRST = 1; REGISTER_INIT(VEH, id) REGISTER_REGISTRY(RegisterVehicles) -REGISTER_VEHICLE(NULL, Vehicle); +REGISTER_VEHICLE(Null, Vehicle); #include "all.inc" diff --git a/qcsrc/common/vehicles/sv_vehicles.qc b/qcsrc/common/vehicles/sv_vehicles.qc index bc8399b09..ea9f18fd2 100644 --- a/qcsrc/common/vehicles/sv_vehicles.qc +++ b/qcsrc/common/vehicles/sv_vehicles.qc @@ -599,16 +599,16 @@ void vehicle_use() void vehicles_regen(float timer, .float regen_field, float field_max, float rpause, float regen, float delta_time, float _healthscale) {SELFPARAM(); - if(self.regen_field < field_max) + if(self.(regen_field) < field_max) if(timer + rpause < time) { if(_healthscale) regen = regen * (self.vehicle_health / self.max_health); - self.regen_field = min(self.regen_field + regen * delta_time, field_max); + self.(regen_field) = min(self.(regen_field) + regen * delta_time, field_max); if(self.owner) - self.owner.regen_field = (self.regen_field / field_max) * 100; + self.owner.(regen_field) = (self.(regen_field) / field_max) * 100; } } diff --git a/qcsrc/common/weapons/weapon/porto.qc b/qcsrc/common/weapons/weapon/porto.qc index 03a77f0cb..9bc8f3b1c 100644 --- a/qcsrc/common/weapons/weapon/porto.qc +++ b/qcsrc/common/weapons/weapon/porto.qc @@ -39,7 +39,7 @@ PORTO_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP) #endif #ifdef IMPLEMENTATION #ifdef SVQC -#include "../triggers/trigger/jumppads.qh" +#include "../../triggers/trigger/jumppads.qh" void spawnfunc_weapon_porto(void) { weapon_defaultspawnfunc(WEP_PORTO.m_id); } diff --git a/qcsrc/lib/Accumulate.qh b/qcsrc/lib/Accumulate.qh index 423f36413..7e1a1edc0 100644 --- a/qcsrc/lib/Accumulate.qh +++ b/qcsrc/lib/Accumulate.qh @@ -25,7 +25,7 @@ func() #else # define ACCUMULATE_FUNCTION(func,otherfunc) \ - .float _ACCUMULATE_##func##__##otherfunc + .float _ACCUMULATE_##func##__##otherfunc; void ACCUMULATE_call(string func) { float i; diff --git a/qcsrc/lib/Nil.qh b/qcsrc/lib/Nil.qh index 87e3aea5e..789b1f9c0 100644 --- a/qcsrc/lib/Nil.qh +++ b/qcsrc/lib/Nil.qh @@ -1,7 +1,7 @@ #ifndef NIL_H #define NIL_H -#ifdef QCC_SUPPORT_NIL +#if QCC_SUPPORT_NIL #define func_null nil #define string_null nil #else diff --git a/qcsrc/lib/OO.qh b/qcsrc/lib/OO.qh index 63a70f7da..d4efe9a6e 100644 --- a/qcsrc/lib/OO.qh +++ b/qcsrc/lib/OO.qh @@ -40,7 +40,7 @@ entity __spawn(string _classname, string _sourceFile, int _sourceLine) { // Classes have a `spawn##cname(entity)` constructor // The parameter is used across [[accumulate]] functions -// Macro to hide this implementation detail +// Macros to hide this implementation detail: #define NEW(cname, ...) \ OVERLOAD(spawn##cname, new(cname), ##__VA_ARGS__) diff --git a/qcsrc/menu/progs.inc b/qcsrc/menu/progs.inc new file mode 100644 index 000000000..45c52c8c0 --- /dev/null +++ b/qcsrc/menu/progs.inc @@ -0,0 +1,29 @@ +#include "../common/util-pre.qh" +#include "../dpdefs/menudefs.qh" +#include "../dpdefs/keycodes.qh" +#include "../common/util-post.qh" + +#include "../lib/_all.inc" + +#include "oo/classes.qc" + +#include "draw.qc" +#include "menu.qc" + +#include "command/all.qc" + +#include "xonotic/util.qc" + +#include "../common/campaign_file.qc" +#include "../common/campaign_setup.qc" +#include "../common/mapinfo.qc" +#include "../common/playerstats.qc" +#include "../common/util.qc" + +#include "../common/items/all.qc" +#include "../common/monsters/all.qc" +#include "../common/mutators/all.qc" +#include "../common/vehicles/all.qc" +#include "../common/weapons/all.qc" + +#include "../mod/menu/progs.inc" diff --git a/qcsrc/menu/progs.src b/qcsrc/menu/progs.src index 158d4f51b..1eb2b723d 100644 --- a/qcsrc/menu/progs.src +++ b/qcsrc/menu/progs.src @@ -1,32 +1,2 @@ ../../menu.dat - -../common/util-pre.qh -../dpdefs/menudefs.qh -../dpdefs/keycodes.qh -../common/util-post.qh - -../lib/_all.inc - -oo/classes.qc - -draw.qc -menu.qc - -command/all.qc - -xonotic/util.qc - -../common/campaign_file.qc -../common/campaign_setup.qc -../common/mapinfo.qc -../common/playerstats.qc -../common/util.qc - -../common/items/all.qc -../common/monsters/all.qc -../common/mutators/all.qc -../common/vehicles/all.qc -../common/weapons/all.qc - - -../mod/menu/progs.inc +progs.inc diff --git a/qcsrc/server/cl_player.qc b/qcsrc/server/cl_player.qc index 963f11314..1b3554eec 100644 --- a/qcsrc/server/cl_player.qc +++ b/qcsrc/server/cl_player.qc @@ -1241,10 +1241,9 @@ void PlayerSound(.string samplefield, float chan, float voicetype) void VoiceMessage(string type, string msg) {SELFPARAM(); - var .string sample; float voicetype, ownteam; float flood; - sample = GetVoiceMessageSampleField(type); + var .string sample = GetVoiceMessageSampleField(type); if(GetPlayerSoundSampleField_notFound) { diff --git a/qcsrc/server/mutators/gamemode_ctf.qc b/qcsrc/server/mutators/gamemode_ctf.qc index 6cf7c1a65..4f4eab356 100644 --- a/qcsrc/server/mutators/gamemode_ctf.qc +++ b/qcsrc/server/mutators/gamemode_ctf.qc @@ -1084,8 +1084,8 @@ void ctf_DelayedFlagSetup(void) // called after a flag is placed on a map by ctf void set_flag_string(entity flag, .string field, string value, string teamname) { - if(flag.field == "") - flag.field = strzone(sprintf(value,teamname)); + if(flag.(field) == "") + flag.(field) = strzone(sprintf(value,teamname)); } void ctf_FlagSetup(int teamnumber, entity flag) // called when spawning a flag entity on the map as a spawnfunc diff --git a/qcsrc/server/mutators/mutator_buffs.qc b/qcsrc/server/mutators/mutator_buffs.qc index 62e4d9f53..3464a6478 100644 --- a/qcsrc/server/mutators/mutator_buffs.qc +++ b/qcsrc/server/mutators/mutator_buffs.qc @@ -12,7 +12,7 @@ entity buff_FirstFromFlags(int _buffs) { FOREACH(BUFFS, it.m_itemid & _buffs, LAMBDA(return it)); } - return BUFF_NULL; + return BUFF_Null; } bool buffs_BuffModel_Customize() @@ -197,7 +197,7 @@ void buff_Touch() float buff_Available(entity buff) { - if (buff == BUFF_NULL) + if (buff == BUFF_Null) return false; if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_AMMO) || (cvar("g_melee_only")))) return false; @@ -806,7 +806,7 @@ MUTATOR_HOOKFUNCTION(buffs_PlayerThink) if(self.buffs != self.oldbuffs) { entity buff = buff_FirstFromFlags(self.buffs); - float bufftime = buff != BUFF_NULL ? buff.m_time(buff) : 0; + float bufftime = buff != BUFF_Null ? buff.m_time(buff) : 0; self.buff_time = (bufftime) ? time + bufftime : 0; BUFF_ONADD(BUFF_AMMO) diff --git a/qcsrc/server/progs.inc b/qcsrc/server/progs.inc new file mode 100644 index 000000000..b387ed35c --- /dev/null +++ b/qcsrc/server/progs.inc @@ -0,0 +1,123 @@ +#include "../common/util-pre.qh" +#include "sys-pre.qh" +#include "../dpdefs/progsdefs.qh" +#include "../dpdefs/dpextensions.qh" +#include "sys-post.qh" +#include "../common/util-post.qh" + +#include "../lib/_all.inc" + +#include "anticheat.qc" +#include "antilag.qc" +#include "campaign.qc" +#include "cheats.qc" +#include "cl_client.qc" +#include "cl_impulse.qc" +#include "cl_player.qc" +#include "controlpoint.qc" +#include "csqceffects.qc" +#include "ent_cs.qc" +#include "g_damage.qc" +#include "g_hook.qc" +// #include "g_lights.qc" // TODO: was never used +#include "g_models.qc" +#include "g_subs.qc" +#include "g_violence.qc" +#include "g_world.qc" +#include "generator.qc" +#include "ipban.qc" +#include "item_key.qc" +#include "mapvoting.qc" +#include "miscfunctions.qc" +#include "movelib.qc" +// #include "pathlib.qc" // TODO: was never used. Seems to duplicate `pathlib/` +#include "playerdemo.qc" +#include "portals.qc" +#include "race.qc" +#include "round_handler.qc" +#include "scores.qc" +#include "scores_rules.qc" +#include "spawnpoints.qc" +#include "steerlib.qc" +#include "sv_main.qc" +#include "teamplay.qc" +#include "t_halflife.qc" +#include "t_items.qc" +#include "t_quake3.qc" +#include "t_quake.qc" + +#include "bot/aim.qc" +#include "bot/bot.qc" +#include "bot/navigation.qc" +#include "bot/scripting.qc" +#include "bot/waypoints.qc" + +#include "bot/havocbot/havocbot.qc" +#include "bot/havocbot/role_keyhunt.qc" +#include "bot/havocbot/roles.qc" + +#include "command/all.qc" + +#include "mutators/mutators_include.qc" +#include "mutators/mutators.qc" + +#include "pathlib/costs.qc" +#include "pathlib/expandnode.qc" +#include "pathlib/main.qc" +#include "pathlib/movenode.qc" +#include "pathlib/path_waypoint.qc" +#include "pathlib/utility.qc" + +#include "weapons/accuracy.qc" +#include "weapons/common.qc" +#include "weapons/csqcprojectile.qc" // TODO +#include "weapons/hitplot.qc" +#include "weapons/selection.qc" +#include "weapons/spawning.qc" +#include "weapons/throwing.qc" +#include "weapons/tracing.qc" +#include "weapons/weaponstats.qc" +#include "weapons/weaponsystem.qc" + +#include "../common/animdecide.qc" +#include "../common/buffs.qc" +#include "../common/campaign_file.qc" +#include "../common/campaign_setup.qc" +#include "../common/effects.qc" +#include "../common/mapinfo.qc" +#include "../common/monsters/spawn.qc" +#include "../common/monsters/sv_monsters.qc" +#include "../common/minigames/minigames.qc" +#include "../common/minigames/sv_minigames.qc" +#include "../common/movetypes/include.qc" +#include "../common/nades.qc" +#include "../common/net_notice.qc" +#include "../common/notifications.qc" +#include "../common/physics.qc" +#include "../common/playerstats.qc" +#include "../common/viewloc.qc" +#include "../common/triggers/include.qc" +#include "../common/util.qc" + +#include "../common/items/all.qc" +#include "../common/monsters/all.qc" +#include "../common/mutators/all.qc" +#include "../common/vehicles/all.qc" +#include "../common/weapons/all.qc" // TODO + +#include "../common/turrets/sv_turrets.qc" +#include "../common/turrets/config.qc" +#include "../common/turrets/util.qc" +#include "../common/turrets/turrets.qc" +#include "../common/turrets/checkpoint.qc" +#include "../common/turrets/targettrigger.qc" +#include "../common/weapons/config.qc" + +#include "../csqcmodellib/sv_model.qc" + +#include "../warpzonelib/anglestransform.qc" +#include "../warpzonelib/common.qc" +#include "../warpzonelib/server.qc" +#include "../warpzonelib/util_server.qc" + +#include "../mod/server/progs.inc" diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index f9193cbd0..9ba92b46f 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -1,125 +1,2 @@ ../../progs.dat - -../common/util-pre.qh -sys-pre.qh -../dpdefs/progsdefs.qh -../dpdefs/dpextensions.qh -sys-post.qh -../common/util-post.qh - -../lib/_all.inc - -anticheat.qc -antilag.qc -campaign.qc -cheats.qc -cl_client.qc -cl_impulse.qc -cl_player.qc -controlpoint.qc -csqceffects.qc -ent_cs.qc -g_damage.qc -g_hook.qc -// g_lights.qc // TODO: was never used -g_models.qc -g_subs.qc -g_violence.qc -g_world.qc -generator.qc -ipban.qc -item_key.qc -mapvoting.qc -miscfunctions.qc -movelib.qc -// pathlib.qc // TODO: was never used. Seems to duplicate `pathlib/` -playerdemo.qc -portals.qc -race.qc -round_handler.qc -scores.qc -scores_rules.qc -spawnpoints.qc -steerlib.qc -sv_main.qc -teamplay.qc -t_halflife.qc -t_items.qc -t_quake3.qc -t_quake.qc - -bot/aim.qc -bot/bot.qc -bot/navigation.qc -bot/scripting.qc -bot/waypoints.qc - -bot/havocbot/havocbot.qc -bot/havocbot/role_keyhunt.qc -bot/havocbot/roles.qc - -command/all.qc - -mutators/mutators_include.qc -mutators/mutators.qc - -pathlib/costs.qc -pathlib/expandnode.qc -pathlib/main.qc -pathlib/movenode.qc -pathlib/path_waypoint.qc -pathlib/utility.qc - -weapons/accuracy.qc -weapons/common.qc -weapons/csqcprojectile.qc // TODO -weapons/hitplot.qc -weapons/selection.qc -weapons/spawning.qc -weapons/throwing.qc -weapons/tracing.qc -weapons/weaponstats.qc -weapons/weaponsystem.qc - -../common/animdecide.qc -../common/buffs.qc -../common/campaign_file.qc -../common/campaign_setup.qc -../common/effects.qc -../common/mapinfo.qc -../common/monsters/spawn.qc -../common/monsters/sv_monsters.qc -../common/minigames/minigames.qc -../common/minigames/sv_minigames.qc -../common/movetypes/include.qc -../common/nades.qc -../common/net_notice.qc -../common/notifications.qc -../common/physics.qc -../common/playerstats.qc -../common/viewloc.qc -../common/triggers/include.qc -../common/util.qc - -../common/items/all.qc -../common/monsters/all.qc -../common/mutators/all.qc -../common/vehicles/all.qc -../common/weapons/all.qc // TODO - -../common/turrets/sv_turrets.qc -../common/turrets/config.qc -../common/turrets/util.qc -../common/turrets/turrets.qc -../common/turrets/checkpoint.qc -../common/turrets/targettrigger.qc -../common/weapons/config.qc - -../csqcmodellib/sv_model.qc - -../warpzonelib/anglestransform.qc -../warpzonelib/common.qc -../warpzonelib/server.qc -../warpzonelib/util_server.qc - -../mod/server/progs.inc +progs.inc -- 2.39.2