]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Lint
authorTimePath <andrew.hardaker1995@gmail.com>
Wed, 9 Sep 2015 11:56:47 +0000 (21:56 +1000)
committerGitLab <gitlab@gitlab.com>
Mon, 21 Sep 2015 06:30:27 +0000 (06:30 +0000)
28 files changed:
qcsrc/client/progs.inc [new file with mode: 0644]
qcsrc/client/progs.src
qcsrc/client/weapons/projectile.qc
qcsrc/common/buffs.qh
qcsrc/common/effects.qh
qcsrc/common/mutators/base.qh
qcsrc/common/nades.qh
qcsrc/common/physics.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/subs.qc
qcsrc/common/triggers/target/speaker.qc
qcsrc/common/turrets/config.qh
qcsrc/common/turrets/turrets.qh
qcsrc/common/util-pre.qh
qcsrc/common/vehicles/all.qc
qcsrc/common/vehicles/all.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/weapons/weapon/porto.qc
qcsrc/lib/Accumulate.qh
qcsrc/lib/Nil.qh
qcsrc/lib/OO.qh
qcsrc/menu/progs.inc [new file with mode: 0644]
qcsrc/menu/progs.src
qcsrc/server/cl_player.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/progs.inc [new file with mode: 0644]
qcsrc/server/progs.src

diff --git a/qcsrc/client/progs.inc b/qcsrc/client/progs.inc
new file mode 100644 (file)
index 0000000..b46a371
--- /dev/null
@@ -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"
index 02e52fe0d1858aed9dad4a12a695e4064944ba58..8a3c0360f784e7eb6fc0b46afba635321b890b3a 100644 (file)
@@ -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
index 7f13ab5dfe5455c31baa259cfe9a5feb8bd88510..0d143cb1e33d8c31ff6e38feedf3eee6f15962d3 100644 (file)
@@ -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';
index eeaba7371d94ed86394f3a34ea49eaa981f932fc..3eff9e26b8e39d3298000b3c77106a4525a3b2f4 100644 (file)
@@ -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)
index b72eab243dad90a1a4f88e0e7a0b40a59c6a19ae..b0c452ce07664d596935312497b020d0677379d1 100644 (file)
@@ -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);
 
index 1183914cf157ed5b1573bb4546d27c6a52579c5b..a8f6c53a9f07bf4b3c467d36d336a27abd06b6d0 100644 (file)
@@ -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) \
index 5a9877c4ee961565ec906a8daac69de315c5ff1b..9ec6c291451c20a80d683138178121afbbac88c0 100644 (file)
@@ -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)
index b3db77143b375f4bdb315e22a1a3c0d057aecd38..1a799c8de79c903edef70a5db80115bc103d657b 100644 (file)
@@ -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));
 }
index d705f842fba17a692b59995763c67e517de685fe..160399d0d2d1a15920b8ee28bf9118535f8402ed 100644 (file)
@@ -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"
 
index b313c49996046e1dec57d08169a891a44fdff6c9..d9de97301b9d068d8569bf1f8503723201918083 100644 (file)
@@ -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;
index 058ffd52639950f15cdff70fa12586880c6a3661..e0701dc14f3273487baec91a8d19543f0b1d1e08 100644 (file)
@@ -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)
index 9eb69f29dd54fa804b86e94e2456e453e4dce94c..4d35ee3b38528d0ca7bfed081df868f7d602f72e 100644 (file)
@@ -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
 
index b3736aff9cbe4d17bc34820cd3be5f494ea4591b..0c2250bc93e849ec581c44121b312b5dfba7889f 100644 (file)
@@ -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);
 
index b81fd2a6df81d409626458a4ba338a15273796f2..22cdfda81de444f529ac27bca3346cb75fe13d36 100644 (file)
@@ -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__ ; }
index f0316ab1fac7f2da65c7269dcd43b56b345ff060..923ed4e5bd4f2e977a92e0ef258db313fafdd4b9 100644 (file)
@@ -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
index fa9e83f48531fa66231691391eade3a57781808f..a18bfe13e14a5d0dc0432db9191967c5818ef6f2 100644 (file)
@@ -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"
 
index bc8399b09fcda3c2f1322ebf7bfbf58c831e678f..ea9f18fd26bc29e0e52fd82917ce18ce6bbea452 100644 (file)
@@ -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;
        }
 }
 
index 03a77f0cb9c06302731352a9e4d0a3cc069297b0..9bc8f3b1c7c2e0a6052c53ece21d219e3b24ff44 100644 (file)
@@ -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); }
 
index 423f364131d2bd92fb65832a7e6700d084f98ab8..7e1a1edc0f7906ebd6dd9afa925196da47fdf894 100644 (file)
@@ -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;
index 87e3aea5e545a9a09d6c6c5136915ab3c509bc24..789b1f9c0f530163c030d95437e993df9c39a9ae 100644 (file)
@@ -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
index 63a70f7da8bbce07dc95bc1f9f83f2c25fe0e7b6..d4efe9a6e346f48217426f4c292bfa0b7f919ec8 100644 (file)
@@ -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 (file)
index 0000000..45c52c8
--- /dev/null
@@ -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"
index 158d4f51b3dad4178ac10b55215412985b3183a9..1eb2b723d463454957f44af836200d27e2feeca7 100644 (file)
@@ -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
index 963f113148433a2bfa9ac2650ec1baff18b8e7af..1b3554eec496a7443e84429400b5696360d7878c 100644 (file)
@@ -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)
        {
index 6cf7c1a6546b4044f0a2a2bf8f69e763bfdcf6b1..4f4eab3561006c342baad43a3b4bc620e32169e6 100644 (file)
@@ -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
index 62e4d9f53d3a79303716a9e34064a5cb0d10e5ae..3464a6478e68e74bad58faa0f267e5df049e8fb7 100644 (file)
@@ -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 (file)
index 0000000..b387ed3
--- /dev/null
@@ -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"
index f9193cbd005a6f405260b189f613e699eca40c01..9ba92b46ff271a9a2b86228b21f3dbe018b084aa 100644 (file)
@@ -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