]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Manual riddance of remaining "if not".
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 0b5b42781229f0df535621e4b373a0e36302329a..c1298d0e7f0f9853d7da7be2dc3730bdb7d22ae2 100644 (file)
@@ -96,7 +96,7 @@ const string STR_OBSERVER = "observer";
 #define FOR_EACH_REALCLIENT(v) FOR_EACH_CLIENT(v) if(IS_REAL_CLIENT(v))
 
 #define FOR_EACH_PLAYER(v) FOR_EACH_CLIENT(v) if(IS_PLAYER(v))
-#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if not(IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too
+#define FOR_EACH_SPEC(v) FOR_EACH_CLIENT(v) if (!IS_PLAYER(v)) // Samual: shouldn't this be IS_SPEC(v)? and rather create a separate macro to include observers too
 #define FOR_EACH_REALPLAYER(v) FOR_EACH_REALCLIENT(v) if(IS_PLAYER(v))
 
 #define CENTER_OR_VIEWOFS(ent) (ent.origin + (IS_PLAYER(ent) ? ent.view_ofs : ((ent.mins + ent.maxs) * 0.5)))
@@ -615,6 +615,7 @@ float start_armorvalue;
 WepSet warmup_start_weapons;
 WepSet warmup_start_weapons_default;
 WepSet warmup_start_weapons_defaultmask;
+#define WARMUP_START_WEAPONS ((g_warmup_allguns == 1) ? (warmup_start_weapons & (weaponsInMap | start_weapons)) : warmup_start_weapons)
 float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
@@ -712,7 +713,7 @@ void readplayerstartcvars()
                for (j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        e = get_weaponinfo(j);
-                       if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+                       if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED))
                                g_weaponarena_weapons |= WepSet_FromWeapon(j);
                }
        }
@@ -723,7 +724,7 @@ void readplayerstartcvars()
                for (j = WEP_FIRST; j <= WEP_LAST; ++j)
                {
                        e = get_weaponinfo(j);
-                       if not(e.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+                       if (!(e.spawnflags & WEP_FLAG_MUTATORBLOCKED))
                                if (e.spawnflags & WEP_FLAG_NORMAL)
                                        g_weaponarena_weapons |= WepSet_FromWeapon(j);
                }
@@ -834,7 +835,7 @@ void readplayerstartcvars()
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               float w = want_weapon("g_start_weapon_", e, cvar("g_warmup_allguns"));
+                               float w = want_weapon("g_start_weapon_", e, g_warmup_allguns);
                                if(w & 1)
                                        warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
@@ -858,10 +859,13 @@ void readplayerstartcvars()
                warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
        }
 
+       WepSet precache_weapons = start_weapons;
+       if (g_warmup_allguns != 1)
+               precache_weapons |= warmup_start_weapons;
        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
        {
                e = get_weaponinfo(i);
-               if((start_weapons | warmup_start_weapons) & WepSet_FromWeapon(i))
+               if(precache_weapons & WepSet_FromWeapon(i))
                        weapon_action(i, WR_PRECACHE);
        }
 
@@ -1033,7 +1037,7 @@ void readlevelcvars(void)
     if(!g_weapon_stay)
         g_weapon_stay = cvar("g_weapon_stay");
 
-       if not(warmup_stage)
+       if (!warmup_stage)
                game_starttime = time + cvar("g_start_delay");
 
        readplayerstartcvars();
@@ -1641,7 +1645,7 @@ void adaptor_think2use()
 
 void adaptor_think2use_hittype_splash() // for timed projectile detonation
 {
-       if not(self.flags & FL_ONGROUND) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
+       if(!(self.flags & FL_ONGROUND)) // if onground, we ARE touching something, but HITTYPE_SPLASH is to be networked if the damage causing projectile is not touching ANYTHING
                self.projectiledeathtype |= HITTYPE_SPLASH;
        adaptor_think2use();
 }
@@ -2332,7 +2336,7 @@ void shockwave_spawn(string m, vector org, float sz, float t1, float t2)
 
 float randombit(float bits)
 {
-       if not(bits & (bits-1)) // this ONLY holds for powers of two!
+       if(!(bits & (bits-1))) // this ONLY holds for powers of two!
                return bits;
 
        float n, f, b, r;
@@ -2400,7 +2404,7 @@ float ExponentialFalloff(float mindist, float maxdist, float halflifedist, float
 #else
 string cvar_string_normal(string n)
 {
-       if not(cvar_type(n) & 1)
+       if (!(cvar_type(n) & 1))
                backtrace(strcat("Attempt to access undefined cvar: ", n));
        return builtin_cvar_string(n);
 }