]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
Remove redundant uses of `var`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 7d3a3767249cb877610ccf38e445cd0cf11788d7..ce28b4197067e85f623f8ced7f863458b162b163 100644 (file)
@@ -118,7 +118,7 @@ void GameLogEcho(string s)
     {
         if (!logfile_open)
         {
-            logfile_open = TRUE;
+            logfile_open = true;
             matches = autocvar_sv_eventlog_files_counter + 1;
             cvar_set("sv_eventlog_files_counter", ftos(matches));
             fn = ftos(matches);
@@ -131,7 +131,7 @@ void GameLogEcho(string s)
         if (logfile >= 0)
         {
             if (autocvar_sv_eventlog_files_timestamps)
-                fputs(logfile, strcat(":time:", strftime(TRUE, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
+                fputs(logfile, strcat(":time:", strftime(true, "%Y-%m-%d %H:%M:%S", "\n", s, "\n")));
             else
                 fputs(logfile, strcat(s, "\n"));
         }
@@ -202,7 +202,7 @@ entity findnearest(vector point, .string field, string value, vector axismod)
         else
             dist = localhead.origin;
         dist = dist - point;
-        dist = dist_x * axismod_x * '1 0 0' + dist_y * axismod_y * '0 1 0' + dist_z * axismod_z * '0 0 1';
+        dist = dist.x * axismod.x * '1 0 0' + dist.y * axismod.y * '0 1 0' + dist.z * axismod.z * '0 0 1';
         len = vlen(dist);
 
         for (i = 0; i < num_nearest; ++i)
@@ -232,7 +232,7 @@ entity findnearest(vector point, .string field, string value, vector axismod)
     // now use the first one from our list that we can see
     for (i = 0; i < num_nearest; ++i)
     {
-        traceline(point, nearest_entity[i].origin, TRUE, world);
+        traceline(point, nearest_entity[i].origin, true, world);
         if (trace_fraction == 1)
         {
             if (i != 0)
@@ -355,19 +355,20 @@ string formatmessage(string msg)
                                wep = self.switchweapon;
                        if (!wep)
                                wep = self.cnt;
-                       replacement = W_Name(wep);
+                       replacement = WEP_NAME(wep);
                } else if (escape == "W") {
                        if (self.items & IT_SHELLS) replacement = "shells";
                        else if (self.items & IT_NAILS) replacement = "bullets";
                        else if (self.items & IT_ROCKETS) replacement = "rockets";
                        else if (self.items & IT_CELLS) replacement = "cells";
+                       else if (self.items & IT_PLASMA) replacement = "plasma";
                        else replacement = "batteries"; // ;)
                } else if (escape == "x") {
                        replacement = cursor_ent.netname;
                        if (replacement == "" || !cursor_ent)
                                replacement = "nothing";
                } else if (escape == "s")
-                       replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1'));
+                       replacement = ftos(vlen(self.velocity - self.velocity.z * '0 0 1'));
                else if (escape == "S")
                        replacement = ftos(vlen(self.velocity));
 
@@ -377,8 +378,8 @@ string formatmessage(string msg)
        return msg;
 }
 
-float boolean(float value) { // if value is 0 return FALSE (0), otherwise return TRUE (1)
-       return (value == 0) ? FALSE : TRUE;
+float boolean(float value) { // if value is 0 return false (0), otherwise return true (1)
+       return (value == 0) ? false : true;
 }
 
 /*
@@ -460,7 +461,6 @@ void GetCvars_handleFloatOnce(string thisname, float f, .float field, string nam
                        stuffcmd(self, strcat("cl_cmd sendcvar ", name, "\n"));
        }
 }
-float w_getbestweapon(entity e);
 string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(string wo)
 {
        string o;
@@ -489,6 +489,7 @@ void GetCvars(float f)
 
        GetCvars_handleFloat(s, f, autoswitch, "cl_autoswitch");
        GetCvars_handleFloat(s, f, cvar_cl_autoscreenshot, "cl_autoscreenshot");
+       GetCvars_handleFloat(s, f, cvar_cl_jetpack_jump, "cl_jetpack_jump");
        GetCvars_handleString(s, f, cvar_g_xonoticversion, "g_xonoticversion");
        GetCvars_handleFloat(s, f, cvar_cl_handicap, "cl_handicap");
        GetCvars_handleFloat(s, f, cvar_cl_clippedspectating, "cl_clippedspectating");
@@ -526,7 +527,7 @@ void GetCvars(float f)
                if (s == "cl_weaponpriority")
                        self.switchweapon = w_getbestweapon(self);
                if (s == "cl_allow_uidtracking")
-                       PlayerStats_AddPlayer(self);
+                       PlayerStats_GameReport_AddPlayer(self);
        }
 }
 
@@ -563,6 +564,8 @@ float g_pickup_rockets;
 float g_pickup_rockets_max;
 float g_pickup_cells;
 float g_pickup_cells_max;
+float g_pickup_plasma;
+float g_pickup_plasma_max;
 float g_pickup_fuel;
 float g_pickup_fuel_jetpack;
 float g_pickup_fuel_max;
@@ -595,7 +598,7 @@ float g_pickup_weapons_anyway;
 float g_weaponarena;
 WepSet g_weaponarena_weapons;
 float g_weaponarena_random;
-float g_weaponarena_random_with_laser;
+float g_weaponarena_random_with_blaster;
 string g_weaponarena_list;
 float g_weaponspeedfactor;
 float g_weaponratefactor;
@@ -611,6 +614,7 @@ float start_ammo_shells;
 float start_ammo_nails;
 float start_ammo_rockets;
 float start_ammo_cells;
+float start_ammo_plasma;
 float start_ammo_fuel;
 float start_health;
 float start_armorvalue;
@@ -622,17 +626,16 @@ float warmup_start_ammo_shells;
 float warmup_start_ammo_nails;
 float warmup_start_ammo_rockets;
 float warmup_start_ammo_cells;
+float warmup_start_ammo_plasma;
 float warmup_start_ammo_fuel;
 float warmup_start_health;
 float warmup_start_armorvalue;
 float g_weapon_stay;
 
-entity get_weaponinfo(float w);
-
-float want_weapon(string cvarprefix, entity weaponinfo, float allguns)
+float want_weapon(entity weaponinfo, float allguns) // WEAPONTODO: what still needs done? 
 {
-       var float i = weaponinfo.weapon;
-       var float d = 0;
+       float i = weaponinfo.weapon;
+       float d = 0;
 
        if (!i)
                return 0;
@@ -640,23 +643,23 @@ float want_weapon(string cvarprefix, entity weaponinfo, float allguns)
        if (g_lms || g_ca || allguns)
        {
                if(weaponinfo.spawnflags & WEP_FLAG_NORMAL)
-                       d = TRUE;
+                       d = true;
                else
-                       d = FALSE;
+                       d = false;
        }
        else if (g_cts)
                d = (i == WEP_SHOTGUN);
        else if (g_nexball)
                d = 0; // weapon is set a few lines later
        else
-               d = (i == WEP_LASER || i == WEP_SHOTGUN);
+               d = !(!weaponinfo.weaponstart);
 
        if(g_grappling_hook) // if possible, redirect off-hand hook to on-hand hook
                d |= (i == WEP_HOOK);
-       if(weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED) // never default mutator blocked guns
+       if(!g_cts && (weaponinfo.spawnflags & WEP_FLAG_MUTATORBLOCKED)) // never default mutator blocked guns
                d = 0;
 
-       var float t = cvar(strcat(cvarprefix, weaponinfo.netname));
+       float t = weaponinfo.weaponstartoverride;
 
        //print(strcat("want_weapon: ", weaponinfo.netname, " - d: ", ftos(d), ", t: ", ftos(t), ". \n"));
 
@@ -687,6 +690,7 @@ void readplayerstartcvars()
        start_ammo_nails = 0;
        start_ammo_rockets = 0;
        start_ammo_cells = 0;
+       start_ammo_plasma = 0;
        start_health = cvar("g_balance_health_start");
        start_armorvalue = cvar("g_balance_armor_start");
 
@@ -708,7 +712,7 @@ void readplayerstartcvars()
        {
                // forcibly turn off weaponarena
        }
-       else if (s == "all")
+       else if (s == "all" || s == "1")
        {
                g_weaponarena = 1;
                g_weaponarena_list = "All Weapons";
@@ -766,7 +770,7 @@ void readplayerstartcvars()
                g_weaponarena_random = cvar("g_weaponarena_random");
        else
                g_weaponarena_random = 0;
-       g_weaponarena_random_with_laser = cvar("g_weaponarena_random_with_laser");
+       g_weaponarena_random_with_blaster = cvar("g_weaponarena_random_with_blaster");
 
        if (g_weaponarena)
        {
@@ -779,7 +783,7 @@ void readplayerstartcvars()
                for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                {
                        e = get_weaponinfo(i);
-                       float w = want_weapon("g_start_weapon_", e, FALSE);
+                       float w = want_weapon(e, false);
                        if(w & 1)
                                start_weapons |= WepSet_FromWeapon(i);
                        if(w & 2)
@@ -794,10 +798,11 @@ void readplayerstartcvars()
 
        if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
-               start_ammo_rockets = 999;
                start_ammo_shells = 999;
-               start_ammo_cells = 999;
                start_ammo_nails = 999;
+               start_ammo_rockets = 999;
+               start_ammo_cells = 999;
+               start_ammo_plasma = 999;
                start_ammo_fuel = 999;
        }
        else
@@ -806,6 +811,7 @@ void readplayerstartcvars()
                start_ammo_nails = cvar("g_start_ammo_nails");
                start_ammo_rockets = cvar("g_start_ammo_rockets");
                start_ammo_cells = cvar("g_start_ammo_cells");
+               start_ammo_plasma = cvar("g_start_ammo_plasma");
                start_ammo_fuel = cvar("g_start_ammo_fuel");
        }
 
@@ -815,6 +821,7 @@ void readplayerstartcvars()
                warmup_start_ammo_nails = start_ammo_nails;
                warmup_start_ammo_rockets = start_ammo_rockets;
                warmup_start_ammo_cells = start_ammo_cells;
+               warmup_start_ammo_plasma = start_ammo_plasma;
                warmup_start_ammo_fuel = start_ammo_fuel;
                warmup_start_health = start_health;
                warmup_start_armorvalue = start_armorvalue;
@@ -825,9 +832,10 @@ void readplayerstartcvars()
                if (!g_weaponarena && !g_ca)
                {
                        warmup_start_ammo_shells = cvar("g_warmup_start_ammo_shells");
-                       warmup_start_ammo_cells = cvar("g_warmup_start_ammo_cells");
                        warmup_start_ammo_nails = cvar("g_warmup_start_ammo_nails");
                        warmup_start_ammo_rockets = cvar("g_warmup_start_ammo_rockets");
+                       warmup_start_ammo_cells = cvar("g_warmup_start_ammo_cells");
+                       warmup_start_ammo_plasma = cvar("g_warmup_start_ammo_plasma");
                        warmup_start_ammo_fuel = cvar("g_warmup_start_ammo_fuel");
                        warmup_start_health = cvar("g_warmup_start_health");
                        warmup_start_armorvalue = cvar("g_warmup_start_armor");
@@ -837,7 +845,7 @@ void readplayerstartcvars()
                        for (i = WEP_FIRST; i <= WEP_LAST; ++i)
                        {
                                e = get_weaponinfo(i);
-                               float w = want_weapon("g_start_weapon_", e, g_warmup_allguns);
+                               float w = want_weapon(e, g_warmup_allguns);
                                if(w & 1)
                                        warmup_start_weapons |= WepSet_FromWeapon(i);
                                if(w & 2)
@@ -855,7 +863,6 @@ void readplayerstartcvars()
 
        if ((start_items & IT_JETPACK) || (g_grappling_hook && (start_weapons & WEPSET_HOOK)))
        {
-               g_grappling_hook = 0; // these two can't coexist, as they use the same button
                start_items |= IT_FUEL_REGEN;
                start_ammo_fuel = max(start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
                warmup_start_ammo_fuel = max(warmup_start_ammo_fuel, cvar("g_balance_fuel_rotstable"));
@@ -868,19 +875,21 @@ void readplayerstartcvars()
        {
                e = get_weaponinfo(i);
                if(precache_weapons & WepSet_FromWeapon(i))
-                       weapon_action(i, WR_PRECACHE);
+                       WEP_ACTION(i, WR_INIT);
        }
 
        start_ammo_shells = max(0, start_ammo_shells);
        start_ammo_nails = max(0, start_ammo_nails);
-       start_ammo_cells = max(0, start_ammo_cells);
        start_ammo_rockets = max(0, start_ammo_rockets);
+       start_ammo_cells = max(0, start_ammo_cells);
+       start_ammo_plasma = max(0, start_ammo_plasma);
        start_ammo_fuel = max(0, start_ammo_fuel);
 
        warmup_start_ammo_shells = max(0, warmup_start_ammo_shells);
        warmup_start_ammo_nails = max(0, warmup_start_ammo_nails);
-       warmup_start_ammo_cells = max(0, warmup_start_ammo_cells);
        warmup_start_ammo_rockets = max(0, warmup_start_ammo_rockets);
+       warmup_start_ammo_cells = max(0, warmup_start_ammo_cells);
+       warmup_start_ammo_plasma = max(0, warmup_start_ammo_plasma);
        warmup_start_ammo_fuel = max(0, warmup_start_ammo_fuel);
 }
 
@@ -929,7 +938,7 @@ void readlevelcvars(void)
     g_bugrigs_speed_pow = cvar("g_bugrigs_speed_pow");
     g_bugrigs_steer = cvar("g_bugrigs_steer");
 
-       g_minstagib = cvar("g_minstagib");
+       g_instagib = cvar("g_instagib");
 
        sv_clones = cvar("sv_clones");
        sv_foginterval = cvar("sv_foginterval");
@@ -979,6 +988,8 @@ void readlevelcvars(void)
        g_pickup_rockets_max = cvar("g_pickup_rockets_max");
        g_pickup_cells = cvar("g_pickup_cells");
        g_pickup_cells_max = cvar("g_pickup_cells_max");
+       g_pickup_plasma = cvar("g_pickup_plasma");
+       g_pickup_plasma_max = cvar("g_pickup_plasma_max");
        g_pickup_fuel = cvar("g_pickup_fuel");
        g_pickup_fuel_jetpack = cvar("g_pickup_fuel_jetpack");
        g_pickup_fuel_max = cvar("g_pickup_fuel_max");
@@ -1026,15 +1037,15 @@ void readlevelcvars(void)
 string precache_sound (string s) = #19;
 float precache_sound_index (string s) = #19;
 
-#define SND_VOLUME      1
-#define SND_ATTENUATION 2
-#define SND_LARGEENTITY 8
-#define SND_LARGESOUND  16
+const float SND_VOLUME = 1;
+const float SND_ATTENUATION = 2;
+const float SND_LARGEENTITY = 8;
+const float SND_LARGESOUND = 16;
 
 float sound_allowed(float dest, entity e)
 {
     // sounds from world may always pass
-    for (;;)
+    for(0;;)
     {
         if (e.classname == "body")
             e = e.enemy;
@@ -1048,13 +1059,13 @@ float sound_allowed(float dest, entity e)
     // sounds to self may always pass
     if (dest == MSG_ONE)
         if (e == msg_entity)
-            return TRUE;
+            return true;
     // sounds by players can be removed
     if (autocvar_bot_sound_monopoly)
         if (IS_REAL_CLIENT(e))
-            return FALSE;
+            return false;
     // anything else may pass
-    return TRUE;
+    return true;
 }
 
 #undef sound
@@ -1110,9 +1121,9 @@ void soundtoat(float dest, entity e, vector o, float chan, string samp, float vo
     else
         WriteByte(dest, idx);
 
-    WriteCoord(dest, o_x);
-    WriteCoord(dest, o_y);
-    WriteCoord(dest, o_z);
+    WriteCoord(dest, o.x);
+    WriteCoord(dest, o.y);
+    WriteCoord(dest, o.z);
 }
 void soundto(float dest, entity e, float chan, string samp, float vol, float atten)
 {
@@ -1152,9 +1163,9 @@ void stopsoundto(float dest, entity e, float chan)
             WriteShort(dest, idx);
         else
             WriteByte(dest, idx);
-        WriteCoord(dest, e.origin_x);
-        WriteCoord(dest, e.origin_y);
-        WriteCoord(dest, e.origin_z);
+        WriteCoord(dest, e.origin.x);
+        WriteCoord(dest, e.origin.y);
+        WriteCoord(dest, e.origin.z);
     }
     else
     {
@@ -1183,15 +1194,15 @@ void play2(entity e, string filename)
 float spamsound(entity e, float chan, string samp, float vol, float atten)
 {
     if (!sound_allowed(MSG_BROADCAST, e))
-        return FALSE;
+        return false;
 
     if (time > e.spamtime)
     {
         e.spamtime = time;
         sound(e, chan, samp, vol, atten);
-        return TRUE;
+        return true;
     }
-    return FALSE;
+    return false;
 }
 
 void play2team(float t, string filename)
@@ -1234,7 +1245,7 @@ void precache_playermodel(string m)
        if(fexists(f))
                precache_model(f);
 
-       globhandle = search_begin(strcat(m, "_*.sounds"), TRUE, FALSE);
+       globhandle = search_begin(strcat(m, "_*.sounds"), true, false);
        if (globhandle < 0)
                return;
        n = search_getsize(globhandle);
@@ -1251,7 +1262,7 @@ void precache_all_playermodels(string pattern)
        float globhandle, i, n;
        string f;
 
-       globhandle = search_begin(pattern, TRUE, FALSE);
+       globhandle = search_begin(pattern, true, false);
        if (globhandle < 0)
                return;
        n = search_getsize(globhandle);
@@ -1357,18 +1368,6 @@ void precache()
         precache_sound ("weapons/hook_impact.wav"); // hook
     }
 
-    if(autocvar_sv_precacheweapons)
-    {
-        //precache weapon models/sounds
-        float wep;
-        wep = WEP_FIRST;
-        while (wep <= WEP_LAST)
-        {
-            weapon_action(wep, WR_PRECACHE);
-            wep = wep + 1;
-        }
-    }
-
     precache_model("models/elaser.mdl");
     precache_model("models/laser.mdl");
     precache_model("models/ebomb.mdl");
@@ -1394,14 +1393,14 @@ void precache()
 #define EXACTTRIGGER_TOUCH if(WarpZoneLib_ExactTrigger_Touch()) return
 #define EXACTTRIGGER_INIT  WarpZoneLib_ExactTrigger_Init()
 
-#define INITPRIO_FIRST              0
-#define INITPRIO_GAMETYPE           0
-#define INITPRIO_GAMETYPE_FALLBACK  1
-#define INITPRIO_FINDTARGET        10
-#define INITPRIO_DROPTOFLOOR       20
-#define INITPRIO_SETLOCATION       90
-#define INITPRIO_LINKDOORS         91
-#define INITPRIO_LAST              99
+const float INITPRIO_FIRST                             = 0;
+const float INITPRIO_GAMETYPE                  = 0;
+const float INITPRIO_GAMETYPE_FALLBACK         = 1;
+const float INITPRIO_FINDTARGET                = 10;
+const float INITPRIO_DROPTOFLOOR               = 20;
+const float INITPRIO_SETLOCATION               = 90;
+const float INITPRIO_LINKDOORS                         = 91;
+const float INITPRIO_LAST                              = 99;
 
 .void(void) initialize_entity;
 .float initialize_entity_order;
@@ -1485,7 +1484,7 @@ void InitializeEntity(entity e, void(void) func, float order)
 
     cur = initialize_entity_first;
     prev = world;
-    for (;;)
+    for(0;;)
     {
         if (!cur || cur.initialize_entity_order > order)
         {
@@ -1613,7 +1612,7 @@ float EliminatedPlayers_SendEntity(entity to, float sendflags)
                }
        }
 
-       return TRUE;
+       return true;
 }
 
 void EliminatedPlayers_Init(float(entity) isEliminated_func)
@@ -1623,7 +1622,7 @@ void EliminatedPlayers_Init(float(entity) isEliminated_func)
                backtrace("Can't spawn eliminatedPlayers again!");
                return;
        }
-       Net_LinkEntity(eliminatedPlayers = spawn(), FALSE, 0, EliminatedPlayers_SendEntity);
+       Net_LinkEntity(eliminatedPlayers = spawn(), false, 0, EliminatedPlayers_SendEntity);
        eliminatedPlayers.isEliminated = isEliminated_func;
 }
 
@@ -1678,9 +1677,9 @@ float trace_hits_box_1d(float end, float thmi, float thma)
     {
         // just check if x is in range
         if (0 < thmi)
-            return FALSE;
+            return false;
         if (0 > thma)
-            return FALSE;
+            return false;
     }
     else
     {
@@ -1689,9 +1688,9 @@ float trace_hits_box_1d(float end, float thmi, float thma)
         trace_hits_box_a0 = max(trace_hits_box_a0, min(thmi / end, thma / end));
         trace_hits_box_a1 = min(trace_hits_box_a1, max(thmi / end, thma / end));
         if (trace_hits_box_a0 > trace_hits_box_a1)
-            return FALSE;
+            return false;
     }
-    return TRUE;
+    return true;
 }
 
 float trace_hits_box(vector start, vector end, vector thmi, vector thma)
@@ -1704,14 +1703,14 @@ float trace_hits_box(vector start, vector end, vector thmi, vector thma)
     trace_hits_box_a0 = 0;
     trace_hits_box_a1 = 1;
 
-    if (!trace_hits_box_1d(end_x, thmi_x, thma_x))
-        return FALSE;
-    if (!trace_hits_box_1d(end_y, thmi_y, thma_y))
-        return FALSE;
-    if (!trace_hits_box_1d(end_z, thmi_z, thma_z))
-        return FALSE;
+    if (!trace_hits_box_1d(end.x, thmi.x, thma.x))
+        return false;
+    if (!trace_hits_box_1d(end.y, thmi.y, thma.y))
+        return false;
+    if (!trace_hits_box_1d(end.z, thmi.z, thma.z))
+        return false;
 
-    return TRUE;
+    return true;
 }
 
 float tracebox_hits_box(vector start, vector mi, vector ma, vector end, vector thmi, vector thma)
@@ -1760,10 +1759,12 @@ void W_Crylink_Dequeue(entity e);
 float WarpZone_Projectile_Touch_ImpactFilter_Callback()
 {
        if(SUB_OwnerCheck())
-               return TRUE;
+               return true;
        if(SUB_NoImpactCheck())
        {
-               if(self.classname == "grapplinghook")
+               if(self.classname == "nade")
+                       return false; // no checks here
+               else if(self.classname == "grapplinghook")
                        RemoveGrapplingHook(self.realowner);
                else if(self.classname == "spike")
                {
@@ -1772,11 +1773,11 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback()
                }
                else
                        remove(self);
-               return TRUE;
+               return true;
        }
        if(trace_ent && trace_ent.solid > SOLID_TRIGGER)
                UpdateCSQCProjectile(self);
-       return FALSE;
+       return false;
 }
 #define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return
 
@@ -1846,14 +1847,14 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
 
     for (i = 0; i < attempts; ++i)
     {
-        start_x = org_x + random() * delta_x;
-        start_y = org_y + random() * delta_y;
-        start_z = org_z + random() * delta_z;
+        start_x = org.x + random() * delta.x;
+        start_y = org.y + random() * delta.y;
+        start_z = org.z + random() * delta.z;
 
         // rule 1: start inside world bounds, and outside
         // solid, and don't start from somewhere where you can
         // fall down to evil
-        tracebox(start, e.mins, e.maxs, start - '0 0 1' * delta_z, MOVE_NORMAL, e);
+        tracebox(start, e.mins, e.maxs, start - '0 0 1' * delta.z, MOVE_NORMAL, e);
         if (trace_fraction >= 1)
             continue;
         if (trace_startsolid)
@@ -1864,7 +1865,7 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
             continue;
 
         // rule 2: if we are too high, lower the point
-        if (trace_fraction * delta_z > maxaboveground)
+        if (trace_fraction * delta.z > maxaboveground)
             start = trace_endpos + '0 0 1' * maxaboveground;
         enddown = trace_endpos;
 
@@ -1873,19 +1874,19 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
         // the map should have a convex outside hull.
         // these can be traceLINES as we already verified the starting box
         mstart = start + 0.5 * (e.mins + e.maxs);
-        traceline(mstart, mstart + '1 0 0' * delta_x, MOVE_NORMAL, e);
+        traceline(mstart, mstart + '1 0 0' * delta.x, MOVE_NORMAL, e);
         if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
-        traceline(mstart, mstart - '1 0 0' * delta_x, MOVE_NORMAL, e);
+        traceline(mstart, mstart - '1 0 0' * delta.x, MOVE_NORMAL, e);
         if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
-        traceline(mstart, mstart + '0 1 0' * delta_y, MOVE_NORMAL, e);
+        traceline(mstart, mstart + '0 1 0' * delta.y, MOVE_NORMAL, e);
         if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
-        traceline(mstart, mstart - '0 1 0' * delta_y, MOVE_NORMAL, e);
+        traceline(mstart, mstart - '0 1 0' * delta.y, MOVE_NORMAL, e);
         if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
-        traceline(mstart, mstart + '0 0 1' * delta_z, MOVE_NORMAL, e);
+        traceline(mstart, mstart + '0 0 1' * delta.z, MOVE_NORMAL, e);
         if (trace_fraction >= 1 || trace_dphittexturename == "common/caulk")
             continue;
 
@@ -1905,9 +1906,9 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
        }
 
         // find a random vector to "look at"
-        end_x = org_x + random() * delta_x;
-        end_y = org_y + random() * delta_y;
-        end_z = org_z + random() * delta_z;
+        end_x = org.x + random() * delta.x;
+        end_y = org.y + random() * delta.y;
+        end_z = org.z + random() * delta.z;
         end = start + normalize(end - start) * vlen(delta);
 
         // rule 4: start TO end must not be too short
@@ -1935,10 +1936,10 @@ float MoveToRandomMapLocation(entity e, float goodcontents, float badcontents, f
         setorigin(e, start);
         e.angles = vectoangles(end - start);
         dprint("Needed ", ftos(i + 1), " attempts\n");
-        return TRUE;
+        return true;
     }
     else
-        return FALSE;
+        return false;
 }
 
 void write_recordmarker(entity pl, float tstart, float dt)
@@ -1961,7 +1962,7 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter
                        break;
 
                case 4: // left
-                       vecs_y = -vecs_y;
+                       vecs_y = -vecs.y;
                        break;
 
                case 1:
@@ -1969,7 +1970,7 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter
                        {
                                // center
                                vecs_y = 0;
-                               vecs_z -= 2;
+                               vecs.z -= 2;
                        }
                        else
                        {
@@ -1982,12 +1983,12 @@ vector shotorg_adjustfromclient(vector vecs, float y_is_right, float allowcenter
                        {
                                // center
                                vecs_y = 0;
-                               vecs_z -= 2;
+                               vecs.z -= 2;
                        }
                        else
                        {
                                // left
-                               vecs_y = -vecs_y;
+                               vecs_y = -vecs.y;
                        }
                        break;
        }
@@ -2004,7 +2005,7 @@ vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float
                if (visual)
                {
                        if (autocvar_g_shootfromclient) { vecs = shotorg_adjustfromclient(vecs, y_is_right, (autocvar_g_shootfromclient >= 2), algn); }
-                       else { vecs_y = 0; vecs_z -= 2; }
+                       else { vecs_y = 0; vecs.z -= 2; }
                }
                else
                {
@@ -2015,17 +2016,17 @@ vector shotorg_adjust_values(vector vecs, float y_is_right, float visual, float
        else if (autocvar_g_shootfromcenter)
        {
                vecs_y = 0;
-               vecs_z -= 2;
+               vecs.z -= 2;
        }
        else if ((s = autocvar_g_shootfromfixedorigin) != "")
        {
                v = stov(s);
                if (y_is_right)
-                       v_y = -v_y;
-               if (v_x != 0)
-                       vecs_x = v_x;
-               vecs_y = v_y;
-               vecs_z = v_z;
+                       v_y = -v.y;
+               if (v.x != 0)
+                       vecs_x = v.x;
+               vecs_y = v.y;
+               vecs_z = v.z;
        }
        else if (autocvar_g_shootfromclient)
        {
@@ -2141,26 +2142,26 @@ float modeleffect_SendEntity(entity to, float sf)
        WriteShort(MSG_ENTITY, self.modelindex);
        WriteByte(MSG_ENTITY, self.skin);
        WriteByte(MSG_ENTITY, self.frame);
-       WriteCoord(MSG_ENTITY, self.origin_x);
-       WriteCoord(MSG_ENTITY, self.origin_y);
-       WriteCoord(MSG_ENTITY, self.origin_z);
+       WriteCoord(MSG_ENTITY, self.origin.x);
+       WriteCoord(MSG_ENTITY, self.origin.y);
+       WriteCoord(MSG_ENTITY, self.origin.z);
        if(f & 1)
        {
-               WriteCoord(MSG_ENTITY, self.velocity_x);
-               WriteCoord(MSG_ENTITY, self.velocity_y);
-               WriteCoord(MSG_ENTITY, self.velocity_z);
+               WriteCoord(MSG_ENTITY, self.velocity.x);
+               WriteCoord(MSG_ENTITY, self.velocity.y);
+               WriteCoord(MSG_ENTITY, self.velocity.z);
        }
        if(f & 2)
        {
-               WriteCoord(MSG_ENTITY, self.angles_x);
-               WriteCoord(MSG_ENTITY, self.angles_y);
-               WriteCoord(MSG_ENTITY, self.angles_z);
+               WriteCoord(MSG_ENTITY, self.angles.x);
+               WriteCoord(MSG_ENTITY, self.angles.y);
+               WriteCoord(MSG_ENTITY, self.angles.z);
        }
        if(f & 4)
        {
-               WriteCoord(MSG_ENTITY, self.avelocity_x);
-               WriteCoord(MSG_ENTITY, self.avelocity_y);
-               WriteCoord(MSG_ENTITY, self.avelocity_z);
+               WriteCoord(MSG_ENTITY, self.avelocity.x);
+               WriteCoord(MSG_ENTITY, self.avelocity.y);
+               WriteCoord(MSG_ENTITY, self.avelocity.z);
        }
        WriteShort(MSG_ENTITY, self.scale * 256.0);
        WriteShort(MSG_ENTITY, self.scale2 * 256.0);
@@ -2168,7 +2169,7 @@ float modeleffect_SendEntity(entity to, float sf)
        WriteByte(MSG_ENTITY, self.fade_time * 100.0);
        WriteByte(MSG_ENTITY, self.alpha * 255.0);
 
-       return TRUE;
+       return true;
 }
 
 void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector ang, vector angv, float s0, float s2, float a, float t1, float t2)
@@ -2188,16 +2189,16 @@ void modeleffect_spawn(string m, float s, float f, vector o, vector v, vector an
        e.fade_time = t2;
        e.skin = s;
        if(s0 >= 0)
-               e.scale = s0 / max6(-e.mins_x, -e.mins_y, -e.mins_z, e.maxs_x, e.maxs_y, e.maxs_z);
+               e.scale = s0 / max6(-e.mins.x, -e.mins.y, -e.mins.z, e.maxs.x, e.maxs.y, e.maxs.z);
        else
                e.scale = -s0;
        if(s2 >= 0)
-               e.scale2 = s2 / max6(-e.mins_x, -e.mins_y, -e.mins_z, e.maxs_x, e.maxs_y, e.maxs_z);
+               e.scale2 = s2 / max6(-e.mins.x, -e.mins.y, -e.mins.z, e.maxs.x, e.maxs.y, e.maxs.z);
        else
                e.scale2 = -s2;
        sz = max(e.scale, e.scale2);
        setsize(e, e.mins * sz, e.maxs * sz);
-       Net_LinkEntity(e, FALSE, 0.1, modeleffect_SendEntity);
+       Net_LinkEntity(e, false, 0.1, modeleffect_SendEntity);
 }
 
 void shockwave_spawn(string m, vector org, float sz, float t1, float t2)
@@ -2354,9 +2355,9 @@ float LostMovetypeFollow(entity ent)
 float isPushable(entity e)
 {
        if(e.iscreature)
-               return TRUE;
+               return true;
        if(e.pushable)
-               return TRUE;
+               return true;
        switch(e.classname)
        {
                case "body":
@@ -2364,11 +2365,11 @@ float isPushable(entity e)
                case "keepawayball":
                case "nexball_basketball":
                case "nexball_football":
-                       return TRUE;
+                       return true;
                case "bullet": // antilagged bullets can't hit this either
-                       return FALSE;
+                       return false;
        }
        if (e.projectiledeathtype)
-               return TRUE;
-       return FALSE;
+               return true;
+       return false;
 }