]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/client.qc
Merge branch 'master' into Lyberta/StandaloneOverkillWeapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / client.qc
index 24ed8ffbbdd95646303ac900bf61d6b9abfc8640..b56305b69b8d117e7a2ece7229678c588725fed8 100644 (file)
@@ -59,6 +59,8 @@
 
 #include "../lib/warpzone/server.qh"
 
+#include <common/mutators/mutator/overkill/okvortex.qh>
+
 STATIC_METHOD(Client, Add, void(Client this, int _team))
 {
     ClientConnect(this);
@@ -113,20 +115,18 @@ bool ClientData_Send(entity this, entity to, int sf)
        if (IS_SPEC(e)) e = e.enemy;
 
        sf = 0;
-       if (CS(e).race_completed)       sf |= 1; // forced scoreboard
-       if (CS(to).spectatee_status)    sf |= 2; // spectator ent number follows
-       if (CS(e).zoomstate)            sf |= 4; // zoomed
-       if (autocvar_sv_showspectators) sf |= 16; // show spectators
+       if (CS(e).race_completed)       sf |= BIT(0); // forced scoreboard
+       if (CS(to).spectatee_status)    sf |= BIT(1); // spectator ent number follows
+       if (CS(e).zoomstate)            sf |= BIT(2); // zoomed
+       if (autocvar_sv_showspectators) sf |= BIT(4); // show spectators
 
        WriteHeader(MSG_ENTITY, ENT_CLIENT_CLIENTDATA);
        WriteByte(MSG_ENTITY, sf);
 
-       if (sf & 2)
-       {
+       if (sf & BIT(1))
                WriteByte(MSG_ENTITY, CS(to).spectatee_status);
-       }
 
-       if(sf & 16)
+       if(sf & BIT(4))
        {
                float specs = CountSpectators(e, to);
                WriteByte(MSG_ENTITY, specs);
@@ -1189,7 +1189,10 @@ void ClientConnect(entity this)
        PlayerStats_GameReport_AddEvent(sprintf("kills-%d", this.playerid));
 
        // always track bots, don't ask for cl_allow_uidtracking
-    if (IS_BOT_CLIENT(this)) PlayerStats_GameReport_AddPlayer(this);
+       if (IS_BOT_CLIENT(this))
+               PlayerStats_GameReport_AddPlayer(this);
+       else
+               CS(this).allowed_timeouts = autocvar_sv_timeout_number;
 
        if (autocvar_sv_eventlog)
                GameLogEcho(strcat(":join:", ftos(this.playerid), ":", ftos(etof(this)), ":", ((IS_REAL_CLIENT(this)) ? this.netaddress : "bot"), ":", playername(this, false)));
@@ -1238,7 +1241,6 @@ void ClientConnect(entity this)
        }
 
        CS(this).jointime = time;
-       CS(this).allowed_timeouts = autocvar_sv_timeout_number;
 
        if (IS_REAL_CLIENT(this))
        {
@@ -1660,16 +1662,16 @@ void player_regen(entity this)
 
                this.ammo_fuel = CalcRotRegen(this.ammo_fuel, minf, autocvar_g_balance_fuel_regen, autocvar_g_balance_fuel_regenlinear, frametime * (time > this.pauseregen_finished) * ((this.items & ITEM_JetpackRegen.m_itemid) != 0), maxf, autocvar_g_balance_fuel_rot, autocvar_g_balance_fuel_rotlinear, frametime * (time > this.pauserotfuel_finished), limitf);
        }
-       // Ugly hack to make sure the haelth and armor don't go beyond hard limit.
+       // Ugly hack to make sure the health and armor don't go beyond hard limit.
        // TODO: Remove this hack when all code uses GivePlayerHealth and
        // GivePlayerArmor.
-       if (this.health > ITEM_COUNT_HARD_LIMIT)
+       if (this.health > RESOURCE_AMOUNT_HARD_LIMIT)
        {
-               this.health = ITEM_COUNT_HARD_LIMIT;
+               this.health = RESOURCE_AMOUNT_HARD_LIMIT;
        }
-       if (this.armorvalue > ITEM_COUNT_HARD_LIMIT)
+       if (this.armorvalue > RESOURCE_AMOUNT_HARD_LIMIT)
        {
-               this.armorvalue = ITEM_COUNT_HARD_LIMIT;
+               this.armorvalue = RESOURCE_AMOUNT_HARD_LIMIT;
        }
        // End hack.
 }
@@ -1738,6 +1740,8 @@ void SpectateCopy(entity this, entity spectatee)
        this.weapons = spectatee.weapons;
        this.vortex_charge = spectatee.vortex_charge;
        this.vortex_chargepool_ammo = spectatee.vortex_chargepool_ammo;
+       this.okvortex_charge = spectatee.okvortex_charge;
+       this.okvortex_chargepool_ammo = spectatee.okvortex_chargepool_ammo;
        this.hagar_load = spectatee.hagar_load;
        this.arc_heat_percent = spectatee.arc_heat_percent;
        this.minelayer_mines = spectatee.minelayer_mines;