]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into develop
authorMario <zacjardine@y7mail.com>
Fri, 11 Dec 2020 09:39:34 +0000 (19:39 +1000)
committerMario <zacjardine@y7mail.com>
Fri, 11 Dec 2020 09:39:34 +0000 (19:39 +1000)
67 files changed:
.gitlab-ci.yml
.tx/merge-base
common.he.po
mutators.cfg
qcsrc/client/hud/crosshair.qc
qcsrc/client/view.qh
qcsrc/common/effects/qc/casings.qc
qcsrc/common/effects/qc/gibs.qc
qcsrc/common/effects/qc/globalsound.qc
qcsrc/common/ent_cs.qc
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qc
qcsrc/common/gamemodes/gamemode/cts/sv_cts.qc
qcsrc/common/gamemodes/gamemode/race/sv_race.qc
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/dodging/sv_dodging.qc
qcsrc/common/mutators/mutator/multijump/multijump.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/mutators/mutator/spawn_near_teammate/sv_spawn_near_teammate.qc
qcsrc/common/notifications/all.qc
qcsrc/common/notifications/all.qh
qcsrc/common/physics/player.qc
qcsrc/common/physics/player.qh
qcsrc/common/playerstats.qc
qcsrc/common/replicate.qh
qcsrc/common/state.qc
qcsrc/common/state.qh
qcsrc/common/weapons/weapon/shockwave.qc
qcsrc/lib/csqcmodel/cl_player.qc
qcsrc/menu/menu.qc
qcsrc/menu/xonotic/campaign.qc
qcsrc/menu/xonotic/campaign.qh
qcsrc/menu/xonotic/checkbox.qc
qcsrc/menu/xonotic/checkbox.qh
qcsrc/menu/xonotic/checkbox_slider_invalid.qc
qcsrc/menu/xonotic/checkbox_string.qc
qcsrc/menu/xonotic/checkbox_string.qh
qcsrc/menu/xonotic/colorbutton.qc
qcsrc/menu/xonotic/colorbutton.qh
qcsrc/menu/xonotic/colorpicker_string.qc
qcsrc/menu/xonotic/colorpicker_string.qh
qcsrc/menu/xonotic/inputbox.qc
qcsrc/menu/xonotic/inputbox.qh
qcsrc/menu/xonotic/radiobutton.qc
qcsrc/menu/xonotic/radiobutton.qh
qcsrc/menu/xonotic/slider.qc
qcsrc/menu/xonotic/slider.qh
qcsrc/menu/xonotic/slider_decibels.qc
qcsrc/menu/xonotic/textslider.qc
qcsrc/menu/xonotic/textslider.qh
qcsrc/menu/xonotic/util.qc
qcsrc/server/antilag.qc
qcsrc/server/bot/default/bot.qc
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/command/cmd.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/handicap.qc
qcsrc/server/impulse.qc
qcsrc/server/intermission.qc
qcsrc/server/items/items.qc
qcsrc/server/race.qc
qcsrc/server/scores.qc
qcsrc/server/weapons/accuracy.qc
qcsrc/server/weapons/selection.qc
qcsrc/server/weapons/selection.qh
qcsrc/server/weapons/tracing.qc
xonotic-server.cfg

index 8c878258cd3172f5f9ce24f812e1e272731a17f9..987834296f7649d51126ad6b56d1c18618a7921b 100644 (file)
@@ -29,7 +29,7 @@ test_sv_game:
     - wget -O data/maps/stormkeep.waypoints https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints
     - wget -O data/maps/stormkeep.waypoints.cache https://gitlab.com/xonotic/xonotic-maps.pk3dir/raw/master/maps/stormkeep.waypoints.cache
     - make
-    - EXPECT=35117dbed178a88ab65576740023dc4b
+    - EXPECT=49e05085eef413931c74d7c82666b1f4
     - HASH=$(${ENGINE} -noconfig -nohome +exec serverbench.cfg
       | tee /dev/stderr
       | grep '^:'
index 256958e3a4a386ed6c45495d89727dabc9d5dfaa..e43a3376bd7c9ce501c55180aba6ee526dcae448 100644 (file)
@@ -1 +1 @@
-Mon Nov 30 07:23:45 CET 2020
+Thu Dec 10 07:23:45 CET 2020
index 7463bf030a4953bad96d2ca4173264869bfa388a..87b23823b8aeffc06a36e9bd2e0c63c02d69aad8 100644 (file)
@@ -5,8 +5,8 @@
 # Translators:
 # nad le <nadavlevi726@gmail.com>, 2018
 # Omer I.S., 2020
-# Omeritzics Games <omeritzicschwartz@gmail.com>, 2020
-# Omeritzics Games <omeritzicschwartz@gmail.com>, 2020
+# Omer I.S. <omeritzicschwartz@gmail.com>, 2020
+# Omer I.S. <omeritzicschwartz@gmail.com>, 2020
 # Roi Asher Gerszkoviez <gerszkoviez@gmail.com>, 2020
 # Tal Leibman <leibman2@gmail.com>, 2019
 msgid ""
index c437868e384f12fca13414d8f874ba82097276db..d6ab4847c616dfe31fb7c05c316254604f7546b4 100644 (file)
@@ -529,3 +529,9 @@ exec randomitems-xonotic.cfg
 // ===============
 set g_pinata 0 "if set to 1 you will not only drop your current weapon when you are killed, but you will drop all weapons that you possessed"
 set g_pinata_offhand 0 "if enabled, the second weapon will drop as well while dual wielding"
+
+// =========
+//  cloaked
+// =========
+set g_cloaked 0 "display all players mostly invisible"
+set g_balance_cloaked_alpha 0.25 "opacity of cloaked players"
index d16e06fb65a513e0647a4cc5777358c12963cc76..3af4d570e40335cbe532e950adc0955ac8b89e9c 100644 (file)
@@ -218,6 +218,12 @@ void HUD_Crosshair(entity this)
        if(autocvar_chase_active > 0 && autocvar_crosshair_chase && STAT(HEALTH) <= 0 && csqcplayer)
                csqcplayer.alpha = csqcplayer.m_alpha;
 
+       if (autocvar_chase_active > 0 && autocvar_chase_front)
+       {
+               csqcplayer.alpha = csqcplayer.m_alpha;
+               return;
+       }
+
        float f, i, j;
        vector v;
        if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) && !autocvar_cl_lockview
index cc3424edd6dde0faa0990559664db0ac6ccc5627..0abcb13fe8d0a7e78708fe478711ff46f662db23 100644 (file)
@@ -15,6 +15,7 @@ float autocvar_camera_speed_chase;
 float autocvar_camera_speed_free;
 float autocvar_camera_speed_roll;
 int autocvar_chase_active;
+bool autocvar_chase_front;
 int autocvar_cl_gentle_damage;
 bool autocvar_cl_lockview;
 bool autocvar_cl_orthoview;
index 3a6b386429b0cb5e1859991b02d7398cf338631e..d5af50fb3803043cf1f68072850692b78c390dd8 100644 (file)
@@ -27,9 +27,9 @@ void SpawnCasing(vector vel, float randomvel, vector ang, vector avel, float ran
        org = casingowner.origin + casingowner.view_ofs + org.x * v_forward - org.y * v_right + org.z * v_up;
 
        FOREACH_CLIENT(true, {
-               if (!(CS(it).cvar_cl_casings))
+               if (!(CS_CVAR(it).cvar_cl_casings))
                        continue;
-               if (it == casingowner && !(CS(it).cvar_r_drawviewmodel))
+               if (it == casingowner && !(CS_CVAR(it).cvar_r_drawviewmodel))
                        continue;
 
                msg_entity = it;
index 3759248cb62c35729fe982b9c3d7f2a3bba05b2d..5500e85ae8a8cbf3ca4184f09ffdcc479f7cc863 100644 (file)
@@ -174,6 +174,8 @@ void TossGib (string mdlname, vector safeorg, vector org, vector vconst, vector
        gib.solid = SOLID_CORPSE;
        gib.cnt = specnum;
        gib.silent = issilent;
+       gib.colormap = 4; // red
+       gib.colormap |= BIT(10); // RENDER_COLORMAPPED
        Gib_setmodel(gib, mdlname, specnum);
 
        setsize (gib, '-8 -8 -8', '8 8 8');
index 3e855c69b253f659235a04eee0840880a3254af2..43a489105f67dccf94a2f9cb089800e9cfded321 100644 (file)
                                                msg_entity = this.pusher;
                                                if (IS_REAL_CLIENT(msg_entity))
                                                {
-                                                       float atten = (CS(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE;
+                                                       float atten = (CS_CVAR(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE;
                                                        if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten, thepitch);
                                                        else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten, thepitch);
                                                        else soundto(MSG_ONE, this, chan, sample, vol, atten, thepitch);
                                {
                                        #define X() \
                                                MACRO_BEGIN \
-                                                       float atten = (CS(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; \
+                                                       float atten = (CS_CVAR(msg_entity).cvar_cl_voice_directional == 1) ? ATTEN_MIN : ATTEN_NONE; \
                                                        if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten, thepitch); \
                                                        else if (ps) playersound(MSG_ONE, this, ps, r, chan, vol, atten, thepitch); \
                                                        else soundto(MSG_ONE, this, chan, sample, vol, atten, thepitch); \
 
                                        #define X() \
                                                MACRO_BEGIN \
-                                                       if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < CS(msg_entity).cvar_cl_autotaunt) \
+                                                       if (voicetype != VOICETYPE_AUTOTAUNT || tauntrand < CS_CVAR(msg_entity).cvar_cl_autotaunt) \
                                                        { \
-                                                               float atten = (CS(msg_entity).cvar_cl_voice_directional >= 1) \
-                                                                       ? bound(ATTEN_MIN, CS(msg_entity).cvar_cl_voice_directional_taunt_attenuation, \
+                                                               float atten = (CS_CVAR(msg_entity).cvar_cl_voice_directional >= 1) \
+                                                                       ? bound(ATTEN_MIN, CS_CVAR(msg_entity).cvar_cl_voice_directional_taunt_attenuation, \
                                                                        ATTEN_MAX) \
                                                                        : ATTEN_NONE; \
                                                                if (gs) globalsound(MSG_ONE, this, gs, r, chan, vol, atten, thepitch); \
index 9b96feb3b28c5eab623df4e13b2dd7e55245f060..7d8442140ed22d2908dbb490a9055c659ef36459 100644 (file)
@@ -221,11 +221,14 @@ ENTCS_PROP(SOLID, true, sv_solid, solid, ENTCS_SET_NORMAL,
                setthink(e, entcs_think);
                e.nextthink = time;
                Net_LinkEntity(e, false, 0, entcs_send);
+               // NOTE: the following code block has been disabled as a workaround for https://gitlab.com/xonotic/xonotic-data.pk3dir/-/issues/1824
+#if 0
                if (!IS_REAL_CLIENT(player)) return;
                FOREACH_CLIENT(true, {
                        assert(CS(it).entcs);
                        _entcs_send(CS(it).entcs, msg_entity = player, BITS(23), MSG_ONE);
                });
+#endif
        }
 
        void entcs_detach(entity player)
index 937575752af4f2c1547f11ac55c39e0060314505..83f9d2fb644a056156fe0b3374267d1352639b1b 100644 (file)
@@ -2318,7 +2318,7 @@ MUTATOR_HOOKFUNCTION(ctf, GetPressedKeys)
 
        entity player = M_ARGV(0, entity);
 
-       if(CS(player).cvar_cl_allow_uidtracking == 1 && CS(player).cvar_cl_allow_uid2name == 1)
+       if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
        {
                if (!player.stored_netname)
                        player.stored_netname = strzone(uid2name(player.crypto_idfp));
index 70bd105ef03466518464c7d8cb0963c3c82441bb..7c83260d005376c01f72644c750369b08202e35b 100644 (file)
@@ -71,16 +71,26 @@ void cts_EventLog(string mode, entity actor) // use an alias for easy changing a
                GameLogEcho(strcat(":cts:", mode, ":", ((actor != NULL) ? (strcat(":", ftos(actor.playerid))) : "")));
 }
 
-MUTATOR_HOOKFUNCTION(cts, PlayerPhysics)
+MUTATOR_HOOKFUNCTION(cts, PlayerPreThink)
 {
        entity player = M_ARGV(0, entity);
-       float dt = M_ARGV(1, float);
 
+       if(!IS_PLAYER(player))
+               return;
+
+       // we need to perform this in PlayerPreThink as PlayerPhysics may not be called (vehicle support)
+       float dt = frametime;
        player.race_movetime_frac += dt;
        float f = floor(player.race_movetime_frac);
        player.race_movetime_frac -= f;
        player.race_movetime_count += f;
        player.race_movetime = player.race_movetime_frac + player.race_movetime_count;
+}
+
+MUTATOR_HOOKFUNCTION(cts, PlayerPhysics)
+{
+       entity player = M_ARGV(0, entity);
+       //float dt = M_ARGV(1, float);
 
        if(IS_PLAYER(player))
        {
@@ -282,7 +292,7 @@ MUTATOR_HOOKFUNCTION(cts, GetPressedKeys)
 {
        entity player = M_ARGV(0, entity);
 
-       if(CS(player).cvar_cl_allow_uidtracking == 1 && CS(player).cvar_cl_allow_uid2name == 1)
+       if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
        {
                if (!player.stored_netname)
                        player.stored_netname = strzone(uid2name(player.crypto_idfp));
index bd5f8b4385dbe8d9aba13074be0d41425487efd5..c87384c94bc3377c45f27fa6d7ac422585c6657f 100644 (file)
@@ -128,16 +128,26 @@ MUTATOR_HOOKFUNCTION(rc, AbortSpeedrun)
                race_PreparePlayer(player); // nice try
 }
 
-MUTATOR_HOOKFUNCTION(rc, PlayerPhysics)
+MUTATOR_HOOKFUNCTION(rc, PlayerPreThink)
 {
        entity player = M_ARGV(0, entity);
-       float dt = M_ARGV(1, float);
 
+       if(!IS_PLAYER(player))
+               return;
+
+       // we need to perform this in PlayerPreThink as PlayerPhysics may not be called (vehicle support)
+       float dt = frametime;
        player.race_movetime_frac += dt;
        float f = floor(player.race_movetime_frac);
        player.race_movetime_frac -= f;
        player.race_movetime_count += f;
        player.race_movetime = player.race_movetime_frac + player.race_movetime_count;
+}
+
+MUTATOR_HOOKFUNCTION(rc, PlayerPhysics)
+{
+       entity player = M_ARGV(0, entity);
+       //float dt = M_ARGV(1, float);
 
 #ifdef SVQC
        if(IS_PLAYER(player))
@@ -328,7 +338,7 @@ MUTATOR_HOOKFUNCTION(rc, GetPressedKeys)
 {
        entity player = M_ARGV(0, entity);
 
-       if(CS(player).cvar_cl_allow_uidtracking == 1 && CS(player).cvar_cl_allow_uid2name == 1)
+       if(CS_CVAR(player).cvar_cl_allow_uidtracking == 1 && CS_CVAR(player).cvar_cl_allow_uid2name == 1)
        {
                if (!player.stored_netname)
                        player.stored_netname = strzone(uid2name(player.crypto_idfp));
index 66cd9007216fc9febac289c4bf115434b57afa52..38345efcf3eb621ceee85f45ffdd0da40069ac02 100644 (file)
@@ -76,7 +76,7 @@ bool buff_Waypoint_visible_for_player(entity this, entity player, entity view)
 
        if (STAT(BUFFS, view))
        {
-               return CS(view).cvar_cl_buffs_autoreplace == false || STAT(BUFFS, view) != STAT(BUFFS, this.owner);
+               return CS_CVAR(view).cvar_cl_buffs_autoreplace == false || STAT(BUFFS, view) != STAT(BUFFS, this.owner);
        }
 
        return WaypointSprite_visible_for_player(this, player, view);
@@ -174,7 +174,7 @@ void buff_Touch(entity this, entity toucher)
 
        if (STAT(BUFFS, toucher))
        {
-               if (CS(toucher).cvar_cl_buffs_autoreplace && STAT(BUFFS, toucher) != STAT(BUFFS, this))
+               if (CS_CVAR(toucher).cvar_cl_buffs_autoreplace && STAT(BUFFS, toucher) != STAT(BUFFS, this))
                {
                        // TODO: lost-gained notification for this case
                        int buffid = buff_FirstFromFlags(STAT(BUFFS, toucher)).m_id;
index 19f8b1046ca9f4acce853f5644012cdec16c2468..1103233e4f8250aa391a29a2b4c2aa06cd3757b4 100644 (file)
@@ -53,9 +53,9 @@
        .float cvar_cl_dodging_timeout;
        .bool cvar_cl_dodging;
        #define PHYS_DODGING_FRAMETIME                          sys_frametime
-       #define PHYS_DODGING_TIMEOUT(s)                         CS(s).cvar_cl_dodging_timeout
+       #define PHYS_DODGING_TIMEOUT(s)                         CS_CVAR(s).cvar_cl_dodging_timeout
        #define PHYS_DODGING_PRESSED_KEYS(s)            CS(s).pressedkeys
-       #define PHYS_DODGING_ENABLED(s)                         CS(s).cvar_cl_dodging
+       #define PHYS_DODGING_ENABLED(s)                         CS_CVAR(s).cvar_cl_dodging
 #endif
 
 #ifdef SVQC
index 40bc9a33e96d57c469a5fa27e1dcef40a30e14d6..9642ab0b38c6bc82ba8495fa87f1df8a2bca0a33 100644 (file)
@@ -32,7 +32,7 @@ int autocvar_cl_multijump = -1;
 #elif defined(SVQC)
 .int cvar_cl_multijump;
 
-       #define PHYS_MULTIJUMP_CLIENT(s)        CS(s).cvar_cl_multijump
+       #define PHYS_MULTIJUMP_CLIENT(s)        CS_CVAR(s).cvar_cl_multijump
 #endif
 
 MUTATOR_HOOKFUNCTION(multijump, PlayerPhysics)
index 66d9e2d2c327227c69bf508e77e70a5f1ea11b50..a8d9f7936f6548b36f0cd36f63c4e0afbb35fe45 100644 (file)
@@ -1152,8 +1152,8 @@ void nade_prime(entity this)
        }
        else
        {
-               ntype = ((autocvar_g_nades_client_select) ? CS(this).cvar_cl_nade_type : autocvar_g_nades_nade_type);
-               pntype = ((autocvar_g_nades_client_select) ? CS(this).cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type);
+               ntype = ((autocvar_g_nades_client_select) ? CS_CVAR(this).cvar_cl_nade_type : autocvar_g_nades_nade_type);
+               pntype = ((autocvar_g_nades_client_select) ? CS_CVAR(this).cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type);
        }
 
        spawn_held_nade(this, this, autocvar_g_nades_nade_lifetime, ntype, pntype);
@@ -1306,8 +1306,8 @@ MUTATOR_HOOKFUNCTION(nades, PlayerPreThink)
 
                        if(autocvar_g_nades_bonus_client_select)
                        {
-                               STAT(NADE_BONUS_TYPE, player) = CS(player).cvar_cl_nade_type;
-                               player.pokenade_type = CS(player).cvar_cl_pokenade_type;
+                               STAT(NADE_BONUS_TYPE, player) = CS_CVAR(player).cvar_cl_nade_type;
+                               player.pokenade_type = CS_CVAR(player).cvar_cl_pokenade_type;
                        }
                        else
                        {
@@ -1414,7 +1414,7 @@ MUTATOR_HOOKFUNCTION(nades, PlayerSpawn)
                player.nade_refire  = time + autocvar_g_nades_nade_refire;
 
        if(autocvar_g_nades_bonus_client_select)
-               STAT(NADE_BONUS_TYPE, player) = CS(player).cvar_cl_nade_type;
+               STAT(NADE_BONUS_TYPE, player) = CS_CVAR(player).cvar_cl_nade_type;
 
        STAT(NADE_TIMER, player) = 0;
 
index 5c7505614e829734f2e074d4371abb824542bb1f..d6afab175160405513e6d6203393669a2aaad76b 100644 (file)
@@ -29,7 +29,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, Spawn_Score)
        entity spawn_spot = M_ARGV(1, entity);
        vector spawn_score = M_ARGV(2, vector);
 
-       if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && CS(player).cvar_cl_spawn_near_teammate))
+       if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && CS_CVAR(player).cvar_cl_spawn_near_teammate))
                return;
 
        spawn_spot.msnt_lookat = NULL;
@@ -79,7 +79,7 @@ MUTATOR_HOOKFUNCTION(spawn_near_teammate, PlayerSpawn)
                return; // at least 1 team has only 1 player, let's not give the bigger team too much of an advantage!
 
        // Note: when entering this, fixangle is already set.
-       if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && CS(player).cvar_cl_spawn_near_teammate))
+       if(autocvar_g_spawn_near_teammate_ignore_spawnpoint == 1 || (autocvar_g_spawn_near_teammate_ignore_spawnpoint == 2 && CS_CVAR(player).cvar_cl_spawn_near_teammate))
        {
                if(autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death)
                        player.msnt_timer = time + autocvar_g_spawn_near_teammate_ignore_spawnpoint_delay_death;
index b2e278a18472c7ff498c3abd465d9ee375610bfc..e6fe8df76eb3d96028d0f7e292f5efcb40ae6b9b 100644 (file)
@@ -79,6 +79,9 @@ string Notification_CheckArgs(
 
 bool Notification_ShouldSend(NOTIF broadcast, entity to_client, entity other_client)
 {
+       if(!IS_REAL_CLIENT(to_client))
+               return false;
+
        switch (broadcast)
        {
                case NOTIF_ONE:
@@ -759,12 +762,12 @@ void Create_Notification_Entity_Choice(entity notif,
 
 // used by MSG_CHOICE to build list of choices
 #ifdef SVQC
-void Notification_GetCvars(entity this)
+void Notification_GetCvars(entity this, entity store)
 {
        FOREACH(Notifications, it.nent_type == MSG_CHOICE && (!it.nent_teamnum || it.nent_teamnum == NUM_TEAM_1), {
                GetCvars_handleFloat(
                        this,
-                       CS(this),
+                       store,
                        get_cvars_s,
                        get_cvars_f,
                        msg_choice_choices[it.nent_choice_idx],
@@ -1520,7 +1523,7 @@ void Send_Notification(
        MSG net_type, Notification net_name,
        ...count)
 {
-    if (broadcast != NOTIF_ALL && broadcast != NOTIF_ALL_EXCEPT && !IS_REAL_CLIENT(client)) return;
+    if (broadcast == NOTIF_ONE_ONLY && !IS_REAL_CLIENT(client)) return;
        entity notif = net_name;
        string parms = sprintf("%s, '%s', %s, %s",
                Get_Notif_BroadcastName(broadcast),
@@ -1603,7 +1606,7 @@ void Send_Notification(
 
                #define RECURSE_FROM_CHOICE(ent,action) MACRO_BEGIN \
                        if (notif.nent_challow_var && (warmup_stage || (notif.nent_challow_var == 2))) { \
-                               switch (CS(ent).msg_choice_choices[net_name.nent_choice_idx]) \
+                               switch (CS_CVAR(ent).msg_choice_choices[net_name.nent_choice_idx]) \
                                { \
                                        case 1: found_choice = notif.nent_optiona; break; \
                                        case 2: found_choice = notif.nent_optionb; break; \
@@ -1634,7 +1637,7 @@ void Send_Notification(
                        }
                        default:
                        {
-                               FOREACH_CLIENT(IS_REAL_CLIENT(it) && Notification_ShouldSend(broadcast, it, client), {
+                               FOREACH_CLIENT(Notification_ShouldSend(broadcast, it, client), {
                                        RECURSE_FROM_CHOICE(it, continue);
                                });
                                break;
index a94ac9ab93bae4d9b8c7f0cad814cf75b7b49e41..72017e3dc8a3efd83a2cebeb521ddd5a3b99ac50 100644 (file)
@@ -310,7 +310,7 @@ float autocvar_notification_lifetime_mapload = 10;
 #endif
 
 #ifdef SVQC
-void Notification_GetCvars(entity this);
+void Notification_GetCvars(entity this, entity store);
 float autocvar_notification_server_allows_location = 1; // 0 = no, 1 = yes
 #else
 float autocvar_notification_item_centerprinttime = 1.5;
index 69dcf56b0f5dd368c9d0bc5bc6df1c86cbce94ad..1c55d3d14b58e13a02369f0ba49b9f4e9e63d2ec 100644 (file)
@@ -19,9 +19,9 @@ float Physics_ClientOption(entity this, string option, float defaultval)
        if(!autocvar_g_physics_clientselect)
                return defaultval;
 
-       if(IS_REAL_CLIENT(this) && Physics_Valid(CS(this).cvar_cl_physics))
+       if(IS_REAL_CLIENT(this) && Physics_Valid(CS_CVAR(this).cvar_cl_physics))
        {
-               string s = strcat("g_physics_", CS(this).cvar_cl_physics, "_", option);
+               string s = strcat("g_physics_", CS_CVAR(this).cvar_cl_physics, "_", option);
                if(cvar_type(s) & CVAR_TYPEFLAG_EXISTS)
                        return cvar(s);
        }
@@ -457,7 +457,7 @@ void CheckWaterJump(entity this)
 
 
 #ifdef SVQC
-       #define JETPACK_JUMP(s) CS(s).cvar_cl_jetpack_jump
+       #define JETPACK_JUMP(s) CS_CVAR(s).cvar_cl_jetpack_jump
 #elif defined(CSQC)
        float autocvar_cl_jetpack_jump;
        #define JETPACK_JUMP(s) autocvar_cl_jetpack_jump
index 67c70c4b091d315fa9444cdd5b8fade736c7c63d..9d92581f461a99d35696d5b9624d6b974818e6e7 100644 (file)
@@ -327,7 +327,7 @@ STATIC_INIT(PHYS_INPUT_BUTTON)
        #define PHYS_JUMPSPEEDCAP_MIN               autocvar_sv_jumpspeedcap_min
        #define PHYS_JUMPSPEEDCAP_MAX               autocvar_sv_jumpspeedcap_max
 
-       #define PHYS_CL_TRACK_CANJUMP(s)            (CS(s).cvar_cl_movement_track_canjump)
+       #define PHYS_CL_TRACK_CANJUMP(s)            (CS_CVAR(s).cvar_cl_movement_track_canjump)
 
 #endif
 
index 2400d4750144916c09109ad4fa1eb55e2a4bdbba..d90f771617e2c0f8dc34f1d9519c07b825714747 100644 (file)
@@ -28,7 +28,7 @@ void PlayerStats_GameReport_AddPlayer(entity e)
        // set up player identification
        string s = "";
 
-       if((e.crypto_idfp != "") && (CS(e).cvar_cl_allow_uidtracking == 1))
+       if((e.crypto_idfp != "") && (CS_CVAR(e).cvar_cl_allow_uidtracking == 1))
                { s = e.crypto_idfp; }
        else if(IS_BOT_CLIENT(e))
                { s = sprintf("bot#%g#%s", skill, e.cleanname); }
@@ -136,7 +136,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
 
        db_put(PS_GR_OUT_DB, sprintf("%s:_playerid", p.playerstats_id), ftos(p.playerid));
 
-       if(CS(p).cvar_cl_allow_uid2name == 1 || IS_BOT_CLIENT(p))
+       if(CS_CVAR(p).cvar_cl_allow_uid2name == 1 || IS_BOT_CLIENT(p))
                db_put(PS_GR_OUT_DB, sprintf("%s:_netname", p.playerstats_id), playername(p.netname, p.team, false));
 
        if(teamplay)
@@ -157,7 +157,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
                                PlayerStats_GameReport_Event_Player(p, PLAYERSTATS_AVGLATENCY, latency);
                }
 
-               db_put(PS_GR_OUT_DB, sprintf("%s:_ranked", p.playerstats_id), ftos(CS(p).cvar_cl_allow_uidranking));
+               db_put(PS_GR_OUT_DB, sprintf("%s:_ranked", p.playerstats_id), ftos(CS_CVAR(p).cvar_cl_allow_uidranking));
        }
 
        strfree(p.playerstats_id);
index 304cf389e739b8412b226740dca5c4940ced2533..06ed9baf6b18fe00b728bdbf5e3d20f7374d5bce 100644 (file)
@@ -32,7 +32,7 @@
        .float cvar_cl_autoscreenshot;
        .float cvar_cl_jetpack_jump;
        .float cvar_cl_movement_track_canjump;
-       //.float cvar_cl_newusekeysupported;
+       .float cvar_cl_newusekeysupported;
        .float cvar_cl_cts_noautoswitch;
        .bool cvar_cl_weapon_switch_reload;
        .bool cvar_cl_weapon_switch_fallback_to_impulse;
index 7a5979e2bc2c0ba261c11281798bf1d2355fdc1a..651a86f917f5a83ead5c6517070b05bd6be1cd4c 100644 (file)
@@ -68,7 +68,7 @@ void PlayerScore_Detach(entity this);
 
 void ClientState_detach(entity this)
 {
-    GetCvars(this, CS(this), -1);  // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
+    GetCvars(this, CS_CVAR(this), -1);  // free cvars TODO: is this still needed now that it's stored on the clientstate entity?
     accuracy_free(this); // TODO: needs to be before CS() is deleted!
     PlayerScore_Detach(this); // what ^they^ said
     W_HitPlotClose(this);
index 42fc450c4728f97f4e63ca6fe9b196b79f2c0a53..7656d47e66ac566d2f1ae394204ef1716d0db97a 100644 (file)
@@ -47,5 +47,8 @@ ENDCLASS(ClientState)
        ClientState CS(Client this) { TC(Client, this); assert(this._cs); return this._cs; }
 #endif
 
+// NOTE: this exists to ease migration later on - ClientState does not exist early enough for replicated cvars!
+#define CS_CVAR(this) (this)
+
 void ClientState_attach(entity this);
 void ClientState_detach(entity this);
index 01a922bb8e47a7c6a80236062a04d902d7239738..5444980ca89ba2efc129dcfc25141a8503e681aa 100644 (file)
@@ -311,7 +311,7 @@ void W_Shockwave_Attack(Weapon thiswep, entity actor, .entity weaponentity)
        );
 
        float lag = ((IS_REAL_CLIENT(actor)) ? ANTILAG_LATENCY(actor) : 0);
-       bool noantilag = ((IS_CLIENT(actor)) ? CS(actor).cvar_cl_noantilag : false);
+       bool noantilag = ((IS_CLIENT(actor)) ? CS_CVAR(actor).cvar_cl_noantilag : false);
        if(lag < 0.001)
                lag = 0;
        if(autocvar_g_antilag == 0 || noantilag)
index acd503c5a222672078d0dd5d23f6c48126081c6c..af19a9d4a6dffcb811d5135dd702b4c332304fa6 100644 (file)
@@ -434,7 +434,6 @@ float autocvar_chase_back;
 float autocvar_chase_up;
 bool autocvar_chase_overhead;
 float autocvar_chase_pitchangle;
-bool autocvar_chase_front;
 vector CSQCPlayer_ApplyChase(entity this, vector v)
 {
        vector forward;
index 07486347f8fb559e830509789cd619c3e239be7c..710dca1e6685be3d57671237bd9a1647148cfa55 100644 (file)
@@ -13,7 +13,7 @@
 #include "xonotic/serverlist.qh"
 #include "xonotic/slider_resolution.qh"
 
-.string cvarName;
+.string controlledCvar;
 
 #include "xonotic/util.qh"
 
@@ -481,7 +481,7 @@ entity m_findtooltipitem(entity root, vector pos)
                {
                        it = it.itemFromPoint(it, pos);
                        if (it.tooltip) best = it;
-                       else if (menu_tooltips == 2 && (it.cvarName || it.onClickCommand)) best = it;
+                       else if (menu_tooltips == 2 && (it.controlledCvar || it.onClickCommand)) best = it;
                        it = NULL;
                }
                else if (it.instanceOfModalController)
@@ -494,7 +494,7 @@ entity m_findtooltipitem(entity root, vector pos)
                }
                if (!it) break;
                if (it.tooltip) best = it;
-               else if (menu_tooltips == 2 && (it.cvarName || it.onClickCommand)) best = it;
+               else if (menu_tooltips == 2 && (it.controlledCvar || it.onClickCommand)) best = it;
                pos = globalToBox(pos, it.Container_origin, it.Container_size);
        }
 
@@ -505,14 +505,14 @@ string gettooltip()
        if (menu_tooltips == 2)
        {
                string s;
-               if (menuTooltipItem.cvarName)
+               if (menuTooltipItem.controlledCvar)
                {
                        string cvar_list = getCvarsMulti(menuTooltipItem);
                        if (cvar_list)
-                               cvar_list = strcat(menuTooltipItem.cvarName, " ", cvar_list);
+                               cvar_list = strcat(menuTooltipItem.controlledCvar, " ", cvar_list);
                        else
-                               cvar_list = menuTooltipItem.cvarName;
-                       s = strcat("[", cvar_list, " \"", cvar_string(menuTooltipItem.cvarName), "\"]");
+                               cvar_list = menuTooltipItem.controlledCvar;
+                       s = strcat("[", cvar_list, " \"", cvar_string(menuTooltipItem.controlledCvar), "\"]");
                }
                else if (menuTooltipItem.onClickCommand)
                {
index 6f1d5111b84ea5c6c2af47e48e7430704293278a..b9e9f54dbd73b94360e951a2e092bc9ea98a3db7 100644 (file)
@@ -70,12 +70,12 @@ void XonoticCampaignList_loadCvars(entity me)
 {
        // read campaign cvars
        strcpy(campaign_name, cvar_string("g_campaign_name"));
-       strcpy(me.cvarName, strcat("g_campaign", campaign_name, "_index"));
-       registercvar(me.cvarName, "", 0); // saved by server QC anyway
+       strcpy(me.controlledCvar, strcat("g_campaign", campaign_name, "_index"));
+       registercvar(me.controlledCvar, "", 0); // saved by server QC anyway
        CampaignFile_Unload();
        CampaignFile_Load(0, CAMPAIGN_MAX_ENTRIES);
-       me.campaignIndex = bound(0, cvar(me.cvarName), campaign_entries);
-       cvar_set(me.cvarName, ftos(me.campaignIndex));
+       me.campaignIndex = bound(0, cvar(me.controlledCvar), campaign_entries);
+       cvar_set(me.controlledCvar, ftos(me.campaignIndex));
        if(me.columnNameSize)
                rewrapCampaign(me.columnNameSize, me.rowsPerItem - 3, me.emptyLineHeight, me.realFontSize);
        me.nItems = min(me.campaignIndex + 2, campaign_entries);
@@ -91,7 +91,7 @@ void XonoticCampaignList_saveCvars(entity me)
        // write campaign cvars
        // no reason to do this!
        // cvar_set("g_campaign_name", campaign_name);
-       // cvar_set(me.cvarName, ftos(me.campaignIndex)); // NOTE: only server QC does that!
+       // cvar_set(me.controlledCvar, ftos(me.campaignIndex)); // NOTE: only server QC does that!
 }
 
 void XonoticCampaignList_campaignGo(entity me, float step)
@@ -155,7 +155,7 @@ void XonoticCampaignList_draw(entity me)
        if(me.buttonPrev)
                me.buttonPrev.disabled = !me.hasPrevCampaign;
 
-       if(cvar(me.cvarName) != me.campaignIndex || cvar_string("g_campaign_name") != campaign_name)
+       if(cvar(me.controlledCvar) != me.campaignIndex || cvar_string("g_campaign_name") != campaign_name)
                me.loadCvars(me);
        SUPER(XonoticCampaignList).draw(me);
 }
index d6c674e8d6343ef21cf9722ebecd0cab9e1d2290..825c6af72eabb00e157baf1aec6c414d57b6512f 100644 (file)
@@ -33,7 +33,7 @@ CLASS(XonoticCampaignList, XonoticListBox)
        ATTRIB(XonoticCampaignList, emptyLineHeight, float, 0.5);
 
        ATTRIB(XonoticCampaignList, campaignIndex, float, 0);
-       ATTRIB(XonoticCampaignList, cvarName, string);
+       ATTRIB(XonoticCampaignList, controlledCvar, string);
        METHOD(XonoticCampaignList, loadCvars, void(entity));
        METHOD(XonoticCampaignList, saveCvars, void(entity));
        ATTRIB(XonoticCampaignList, hasNextCampaign, bool, false);
index 949b01c41da50c353beb177a70991d4683f28741..1065c5d6d1a5ff9b2900f7a82182fb7efe1720ce 100644 (file)
@@ -47,7 +47,7 @@ void XonoticCheckBox_configureXonoticCheckBox(entity me, float theYesValue, floa
        me.yesValue = theYesValue;
        me.noValue = theNoValue;
        me.checked = 0;
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        me.loadCvars(me);
        setZonedTooltip(me, theTooltip, theCvar);
        me.configureCheckBox(me, theText, me.fontSize, me.image);
@@ -66,22 +66,22 @@ void XonoticCheckBox_loadCvars(entity me)
 {
        float m, d;
 
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        m = (me.yesValue + me.noValue) * 0.5;
-       d = (cvar(me.cvarName) - m) / (me.yesValue - m);
+       d = (cvar(me.controlledCvar) - m) / (me.yesValue - m);
        me.checked = (d > 0);
 }
 void XonoticCheckBox_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        if(me.checked)
-               cvar_set(me.cvarName, ftos_mindecimals(me.yesValue));
+               cvar_set(me.controlledCvar, ftos_mindecimals(me.yesValue));
        else
-               cvar_set(me.cvarName, ftos_mindecimals(me.noValue));
+               cvar_set(me.controlledCvar, ftos_mindecimals(me.noValue));
 
-       CheckSendCvars(me, me.cvarName);
+       CheckSendCvars(me, me.controlledCvar);
 }
index e46c9ce4a0bb0f20c342c7f5737cc7ec531ffeb9..811686fe1c717dbd49112eb9fc74aae434691e3f 100644 (file)
@@ -14,7 +14,7 @@ CLASS(XonoticCheckBox, CheckBox)
        ATTRIB(XonoticCheckBox, colorF, vector, SKINCOLOR_CHECKBOX_F);
        ATTRIB(XonoticCheckBox, colorD, vector, SKINCOLOR_CHECKBOX_D);
 
-       ATTRIB(XonoticCheckBox, cvarName, string);
+       ATTRIB(XonoticCheckBox, controlledCvar, string);
        METHOD(XonoticCheckBox, loadCvars, void(entity));
        METHOD(XonoticCheckBox, saveCvars, void(entity));
        ATTRIB(XonoticCheckBox, sendCvars, float, 0);
index 839e66b215dc45765a64e4f9aa52902bed9e9a20..55bab259c6a72edf3cdd10333b89ca84d9d14df2 100644 (file)
@@ -20,7 +20,7 @@ void XonoticSliderCheckBox_configureXonoticSliderCheckBox(entity me, float theOf
                me.savedValue = theControlledSlider.valueMin;
        me.controlledSlider = theControlledSlider;
        me.configureCheckBox(me, theText, me.fontSize, me.image);
-       me.cvarName = theControlledSlider.cvarName; // in case we want to display the cvar in the tooltip
+       me.controlledCvar = theControlledSlider.controlledCvar; // in case we want to display the cvar in the tooltip
        me.tooltip = theControlledSlider.tooltip;
 }
 void XonoticSliderCheckBox_draw(entity me)
index 99db16e35bd483bb6e4136a2d017cd2d4e003065..4196434723197a8f02e89db82d4df971117d3239 100644 (file)
@@ -12,7 +12,7 @@ void XonoticCheckBoxString_configureXonoticCheckBoxString(entity me, string theY
        me.yesString = theYesValue;
        me.noString = theNoValue;
        me.checked = 0;
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        me.loadCvars(me);
        me.configureCheckBox(me, theText, me.fontSize, me.image);
 }
@@ -23,21 +23,21 @@ void XonoticCheckBoxString_setChecked(entity me, float foo)
 }
 void XonoticCheckBoxString_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       if(cvar_string(me.cvarName) == me.yesString)
+       if(cvar_string(me.controlledCvar) == me.yesString)
                me.checked = 1;
 }
 void XonoticCheckBoxString_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        if(me.checked)
-               cvar_set(me.cvarName, me.yesString);
+               cvar_set(me.controlledCvar, me.yesString);
        else
-               cvar_set(me.cvarName, me.noString);
+               cvar_set(me.controlledCvar, me.noString);
 
-       CheckSendCvars(me, me.cvarName);
+       CheckSendCvars(me, me.controlledCvar);
 }
index e73a7144fc4a0cdd0ff643e600832b5ac2bd775c..8f014020e70c96b94841f71d581e47359731490e 100644 (file)
@@ -14,7 +14,7 @@ CLASS(XonoticCheckBoxString, CheckBox)
        ATTRIB(XonoticCheckBoxString, colorF, vector, SKINCOLOR_CHECKBOX_F);
        ATTRIB(XonoticCheckBoxString, colorD, vector, SKINCOLOR_CHECKBOX_D);
 
-       ATTRIB(XonoticCheckBoxString, cvarName, string);
+       ATTRIB(XonoticCheckBoxString, controlledCvar, string);
        METHOD(XonoticCheckBoxString, loadCvars, void(entity));
        METHOD(XonoticCheckBoxString, saveCvars, void(entity));
        ATTRIB(XonoticCheckBoxString, sendCvars, float, 0);
index f9db47f99a2a6c2646f9c874ab660087581ee945..49bffed257acf362a993bd3d6e00f5303f40eb1c 100644 (file)
@@ -30,7 +30,7 @@ void XonoticColorButton_configureXonoticColorButton(entity me, float theGroup, f
                        // no change
                        break;
        }
-       me.cvarName = "_cl_color";
+       me.controlledCvar = "_cl_color";
        me.cvarValueFloat = theValue;
        me.cvarPart = theColor;
        me.loadCvars(me);
@@ -46,28 +46,28 @@ void XonoticColorButton_setChecked(entity me, float val)
 }
 void XonoticColorButton_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       if(cvar_string(me.cvarName) == cvar_defstring(me.cvarName))
-               cvar_set(me.cvarName, ftos(16 * floor(random() * 15) + floor(random() * 15)));
+       if(cvar_string(me.controlledCvar) == cvar_defstring(me.controlledCvar))
+               cvar_set(me.controlledCvar, ftos(16 * floor(random() * 15) + floor(random() * 15)));
 
        if(me.cvarPart == 1)
-               me.checked = (cvar(me.cvarName) & 240) == me.cvarValueFloat * 16;
+               me.checked = (cvar(me.controlledCvar) & 240) == me.cvarValueFloat * 16;
        else
-               me.checked = (cvar(me.cvarName) & 15) == me.cvarValueFloat;
+               me.checked = (cvar(me.controlledCvar) & 15) == me.cvarValueFloat;
 }
 void XonoticColorButton_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        if(me.checked)
        {
                if(me.cvarPart == 1)
-                       cvar_set(me.cvarName, ftos((cvar(me.cvarName) & 15) + me.cvarValueFloat * 16));
+                       cvar_set(me.controlledCvar, ftos((cvar(me.controlledCvar) & 15) + me.cvarValueFloat * 16));
                else
-                       cvar_set(me.cvarName, ftos((cvar(me.cvarName) & 240) + me.cvarValueFloat));
+                       cvar_set(me.controlledCvar, ftos((cvar(me.controlledCvar) & 240) + me.cvarValueFloat));
        }
 }
 void XonoticColorButton_draw(entity me)
index 9ff9639c588b0d0100ff36617ed45365c02a5885..5c729fcb831690336d181871d520dca16f31f9b6 100644 (file)
@@ -11,7 +11,7 @@ CLASS(XonoticColorButton, RadioButton)
        ATTRIB(XonoticColorButton, useDownAsChecked, float, 1);
 
        ATTRIB(XonoticColorButton, cvarPart, float, 0);
-       ATTRIB(XonoticColorButton, cvarName, string);
+       ATTRIB(XonoticColorButton, controlledCvar, string);
        ATTRIB(XonoticColorButton, cvarValueFloat, float, 0);
        METHOD(XonoticColorButton, loadCvars, void(entity));
        METHOD(XonoticColorButton, saveCvars, void(entity));
index 5a44e58830862c9e668185b3f21bda1bffadd076..7dd4b5698a547cadd5b8c984d63639b28ca721fd 100644 (file)
@@ -13,41 +13,41 @@ entity makeXonoticColorpickerString(string theCvar, string theDefaultCvar)
 void XonoticColorpickerString_configureXonoticColorpickerString(entity me, string theCvar, string theDefaultCvar)
 {
        me.configureImage(me, me.image);
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        me.loadCvars(me);
 }
 
 void XonoticColorpickerString_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       if(substring(me.cvarName, -1, 1) == "_")
+       if(substring(me.controlledCvar, -1, 1) == "_")
        {
                me.prevcoords = color_hslimage(
-                       eX * cvar(strcat(me.cvarName, "red")) +
-                       eY * cvar(strcat(me.cvarName, "green")) +
-                       eZ * cvar(strcat(me.cvarName, "blue")),
+                       eX * cvar(strcat(me.controlledCvar, "red")) +
+                       eY * cvar(strcat(me.controlledCvar, "green")) +
+                       eZ * cvar(strcat(me.controlledCvar, "blue")),
                        me.imagemargin);
        }
        else
-               me.prevcoords = color_hslimage(stov(cvar_string(me.cvarName)), me.imagemargin);
+               me.prevcoords = color_hslimage(stov(cvar_string(me.controlledCvar)), me.imagemargin);
 }
 
 void XonoticColorpickerString_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       if(substring(me.cvarName, -1, 1) == "_")
+       if(substring(me.controlledCvar, -1, 1) == "_")
        {
                vector v = hslimage_color(me.prevcoords, me.imagemargin);
-               cvar_set(strcat(me.cvarName, "red"), ftos(v.x));
-               cvar_set(strcat(me.cvarName, "green"), ftos(v.y));
-               cvar_set(strcat(me.cvarName, "blue"), ftos(v.z));
+               cvar_set(strcat(me.controlledCvar, "red"), ftos(v.x));
+               cvar_set(strcat(me.controlledCvar, "green"), ftos(v.y));
+               cvar_set(strcat(me.controlledCvar, "blue"), ftos(v.z));
        }
        else
-               cvar_set(me.cvarName, sprintf("%v", hslimage_color(me.prevcoords, me.imagemargin)));
+               cvar_set(me.controlledCvar, sprintf("%v", hslimage_color(me.prevcoords, me.imagemargin)));
 }
 
 METHOD(XonoticColorpickerString, mousePress, bool(XonoticColorpickerString this, vector pos))
index aa4a10c93a7d45a9583f4c8b57f671d135f20b81..adfe74f3f3d96c0d3b827fe44dd5e2a16715d2f8 100644 (file)
@@ -9,7 +9,7 @@ CLASS(XonoticColorpickerString, Image)
        METHOD(XonoticColorpickerString, mouseRelease, float(entity, vector));
        METHOD(XonoticColorpickerString, mouseDrag, float(entity, vector));
 
-       ATTRIB(XonoticColorpickerString, cvarName, string);
+       ATTRIB(XonoticColorpickerString, controlledCvar, string);
        METHOD(XonoticColorpickerString, loadCvars, void(entity));
        METHOD(XonoticColorpickerString, saveCvars, void(entity));
 
index 22a7ce71741284dd91f7969c865ffe644a59e157..4a3f905288fbc6ebecc7cd34dabd38d5e00ce801 100644 (file)
@@ -15,7 +15,7 @@ void XonoticInputBox_configureXonoticInputBox(entity me, float doEditColorCodes,
 {
        me.configureInputBox(me, "", 0, me.fontSize, me.image);
        me.editColorCodes = doEditColorCodes;
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        me.loadCvars(me);
        setZonedTooltip(me, theTooltip, theCvar);
        me.cursorPos = strlen(me.text);
@@ -39,16 +39,16 @@ void XonoticInputBox_setText(entity me, string val)
 }
 void XonoticInputBox_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
-       SUPER(XonoticInputBox).setText(me, cvar_string(me.cvarName));
+       SUPER(XonoticInputBox).setText(me, cvar_string(me.controlledCvar));
 }
 void XonoticInputBox_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
-       cvar_set(me.cvarName, me.text);
-       CheckSendCvars(me, me.cvarName);
+       cvar_set(me.controlledCvar, me.text);
+       CheckSendCvars(me, me.controlledCvar);
 }
 float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift)
 {
@@ -56,7 +56,7 @@ float XonoticInputBox_keyDown(entity me, float key, float ascii, float shift)
        r = 0;
        if(key == K_ENTER || key == K_KP_ENTER)
        {
-               if(me.cvarName)
+               if(me.controlledCvar)
                {
                        me.saveCvars(me);
                        r = 1;
index 7be855cd9d4667c2f42d05d44561e51e63b14623..95d2a8da5bdbdb39b1cb31faefd24e8f11f762eb 100644 (file)
@@ -26,7 +26,7 @@ CLASS(XonoticInputBox, InputBox)
        ATTRIB(XonoticInputBox, cb_colorF, vector, SKINCOLOR_CLEARBUTTON_F);
        ATTRIB(XonoticInputBox, cb_colorC, vector, SKINCOLOR_CLEARBUTTON_C);
 
-       ATTRIB(XonoticInputBox, cvarName, string);
+       ATTRIB(XonoticInputBox, controlledCvar, string);
        METHOD(XonoticInputBox, loadCvars, void(entity));
        METHOD(XonoticInputBox, saveCvars, void(entity));
        ATTRIB(XonoticInputBox, sendCvars, float, 0);
index 536ea4f154f1b07d4c9b17afe67f18a2ff176f4d..ab598de0a51ea0d2b1630e52df4ac0d353972b9f 100644 (file)
@@ -13,7 +13,7 @@ entity makeXonoticRadioButton(float theGroup, string theCvar, string theValue, s
 }
 void XonoticRadioButton_configureXonoticRadioButton(entity me, float theGroup, string theCvar, string theValue, string theText, string theTooltip)
 {
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        me.cvarValue = theValue;
        me.loadCvars(me);
        setZonedTooltip(me, theTooltip, theCvar);
@@ -31,19 +31,19 @@ void XonoticRadioButton_loadCvars(entity me)
 {
        if(me.cvarValue)
        {
-               if(me.cvarName)
+               if(me.controlledCvar)
                {
                        if(me.cvarValueIsAnotherCvar)
-                               me.checked = (cvar_string(me.cvarName) == cvar_string(me.cvarValue));
+                               me.checked = (cvar_string(me.controlledCvar) == cvar_string(me.cvarValue));
                        else
-                               me.checked = (cvar_string(me.cvarName) == me.cvarValue);
+                               me.checked = (cvar_string(me.controlledCvar) == me.cvarValue);
                }
        }
        else
        {
-               if(me.cvarName)
+               if(me.controlledCvar)
                {
-                       me.checked = boolean(cvar(me.cvarName));
+                       me.checked = boolean(cvar(me.controlledCvar));
                }
                else
                {
@@ -58,7 +58,7 @@ void XonoticRadioButton_loadCvars(entity me)
 void XonoticRadioButton_draw(entity me)
 {
        if (!me.cvarValue)
-               if (!me.cvarName)
+               if (!me.controlledCvar)
                {
                        // this is the "other" option
                        // always select this if none other is
@@ -78,24 +78,24 @@ void XonoticRadioButton_saveCvars(entity me)
 {
        if(me.cvarValue)
        {
-               if(me.cvarName)
+               if(me.controlledCvar)
                {
                        if(me.checked)
                        {
                                if(me.cvarValueIsAnotherCvar)
-                                       cvar_set(me.cvarName, cvar_string(me.cvarValue));
+                                       cvar_set(me.controlledCvar, cvar_string(me.cvarValue));
                                else
-                                       cvar_set(me.cvarName, me.cvarValue);
+                                       cvar_set(me.controlledCvar, me.cvarValue);
                        }
                        else if(me.cvarOffValue)
-                               cvar_set(me.cvarName, me.cvarOffValue);
+                               cvar_set(me.controlledCvar, me.cvarOffValue);
                }
        }
        else
        {
-               if(me.cvarName)
+               if(me.controlledCvar)
                {
-                       cvar_set(me.cvarName, ftos(me.checked));
+                       cvar_set(me.controlledCvar, ftos(me.checked));
                }
        }
 }
index cd671a338f296f73ee8a8eb124f03aa1dd50872c..a0f17fcf7c7c508b51bcd44601d09d53f8d2df05 100644 (file)
@@ -12,7 +12,7 @@ CLASS(XonoticRadioButton, RadioButton)
        ATTRIB(XonoticRadioButton, colorF, vector, SKINCOLOR_RADIOBUTTON_F);
        ATTRIB(XonoticRadioButton, colorD, vector, SKINCOLOR_RADIOBUTTON_D);
 
-       ATTRIB(XonoticRadioButton, cvarName, string);
+       ATTRIB(XonoticRadioButton, controlledCvar, string);
        ATTRIB(XonoticRadioButton, cvarValue, string);
        ATTRIB(XonoticRadioButton, cvarOffValue, string);
        ATTRIB(XonoticRadioButton, cvarValueIsAnotherCvar, float, 0);
index c8e057a641416aa922a9760b6cbaafa3072b881e..d0a1cfb759e32371d4d12e3135384f285e0c9c69 100644 (file)
@@ -20,7 +20,7 @@ void XonoticSlider_configureXonoticSlider(entity me, float theValueMin, float th
 
        me.configureSliderVisuals(me, me.fontSize, me.align, me.valueSpace, me.image);
 
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        if(theCvar)
                // Prevent flickering of the slider button by initialising the
                // slider out of bounds to hide the button before loading the cvar
@@ -48,17 +48,17 @@ void XonoticSlider_setValue_noAnim(entity me, float val)
 }
 void XonoticSlider_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       me.setValue_noAnim(me, cvar(me.cvarName));
+       me.setValue_noAnim(me, cvar(me.controlledCvar));
 }
 void XonoticSlider_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       cvar_set(me.cvarName, ftos_mindecimals(me.value));
+       cvar_set(me.controlledCvar, ftos_mindecimals(me.value));
 
-       CheckSendCvars(me, me.cvarName);
+       CheckSendCvars(me, me.controlledCvar);
 }
index fea35745896a6a71f3773fd22becebe0e0f59627..de66fb95ef53ab9d6f1e653e0a69be094d55029c 100644 (file)
@@ -16,7 +16,7 @@ CLASS(XonoticSlider, Slider)
        ATTRIB(XonoticSlider, colorD, vector, SKINCOLOR_SLIDER_D);
        ATTRIB(XonoticSlider, color2, vector, SKINCOLOR_SLIDER_S);
 
-       ATTRIB(XonoticSlider, cvarName, string);
+       ATTRIB(XonoticSlider, controlledCvar, string);
        METHOD(XonoticSlider, loadCvars, void(entity));
        METHOD(XonoticSlider, saveCvars, void(entity));
        ATTRIB(XonoticSlider, sendCvars, float, 0);
index e26076b658a8b80ab668a9fc8c675677a55c11af..44d042ea30c56128dabf7e388b02ba1b5a679251 100644 (file)
@@ -43,10 +43,10 @@ void XonoticDecibelsSlider_loadCvars(entity me)
 {
        float v;
 
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       v = cvar(me.cvarName);
+       v = cvar(me.controlledCvar);
 
        // snapping
        if(v > fromDecibelOfSquare(me.valueMax - 0.5 * me.valueStep, me.valueMin))
@@ -56,13 +56,13 @@ void XonoticDecibelsSlider_loadCvars(entity me)
 }
 void XonoticDecibelsSlider_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        if(me.value > me.valueMax - 0.5 * me.valueStep)
-               cvar_set(me.cvarName, ftos(fromDecibelOfSquare(me.valueMax, me.valueMin)));
+               cvar_set(me.controlledCvar, ftos(fromDecibelOfSquare(me.valueMax, me.valueMin)));
        else
-               cvar_set(me.cvarName, ftos(fromDecibelOfSquare(me.value, me.valueMin)));
+               cvar_set(me.controlledCvar, ftos(fromDecibelOfSquare(me.value, me.valueMin)));
 }
 
 float autocvar_menu_snd_sliderscale;
index 54c7e5fb1238788e7e8d2a21fa2aac67e0e85676..d40d88301a0fcf10a4914cde1616b77bcd22e727 100644 (file)
@@ -14,7 +14,7 @@ entity makeXonoticTextSlider(string theCvar)
 void XonoticTextSlider_configureXonoticTextSlider(entity me, string theCvar, string theTooltip)
 {
        me.configureSliderVisuals(me, me.fontSize, me.align, me.valueSpace, me.image);
-       me.cvarName = (theCvar) ? theCvar : string_null;
+       me.controlledCvar = (theCvar) ? theCvar : string_null;
        // me.loadCvars(me); // don't load it yet
        setZonedTooltip(me, theTooltip, theCvar);
 }
@@ -36,10 +36,10 @@ void XonoticTextSlider_setValue_noAnim(entity me, float val)
 }
 void XonoticTextSlider_loadCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
-       float n = tokenize_console(me.cvarName);
+       float n = tokenize_console(me.controlledCvar);
        string s = cvar_string(argv(0));
        float i;
        for(i = 1; i < n; ++i)
@@ -58,12 +58,12 @@ void XonoticTextSlider_loadCvars(entity me)
 }
 void XonoticTextSlider_saveCvars(entity me)
 {
-       if (!me.cvarName)
+       if (!me.controlledCvar)
                return;
 
        if(me.value >= 0 && me.value < me.nValues)
        {
-               float n = tokenize_console(me.cvarName);
+               float n = tokenize_console(me.controlledCvar);
                if(n == 1)
                {
                        // this is a special case to allow spaces in the identifiers
@@ -73,7 +73,7 @@ void XonoticTextSlider_saveCvars(entity me)
                else
                {
                        float i;
-                       float m = tokenize_console(strcat(me.cvarName, " ", me.getIdentifier(me)));
+                       float m = tokenize_console(strcat(me.controlledCvar, " ", me.getIdentifier(me)));
                        if(m == n + 1)
                        {
                                for(i = 0; i < n; ++i)
@@ -91,7 +91,7 @@ void XonoticTextSlider_saveCvars(entity me)
                                }
                        }
                        else
-                               error("XonoticTextSlider: invalid identifier ", me.getIdentifier(me), " does not match cvar list ", me.cvarName);
+                               error("XonoticTextSlider: invalid identifier ", me.getIdentifier(me), " does not match cvar list ", me.controlledCvar);
                }
        }
 }
index 3c588ce55000415a1aa1a5688e0199b2bdce32f8..5b4691e268bf367804d148d275b913159324bfe9 100644 (file)
@@ -17,7 +17,7 @@ CLASS(XonoticTextSlider, TextSlider)
        ATTRIB(XonoticTextSlider, colorD, vector, SKINCOLOR_SLIDER_D);
        ATTRIB(XonoticTextSlider, color2, vector, SKINCOLOR_SLIDER_S);
 
-       ATTRIB(XonoticTextSlider, cvarName, string);
+       ATTRIB(XonoticTextSlider, controlledCvar, string);
        METHOD(XonoticTextSlider, loadCvars, void(entity));
        METHOD(XonoticTextSlider, saveCvars, void(entity));
        ATTRIB(XonoticTextSlider, sendCvars, float, 0);
index ac993e622bd0851e3eeb6ef5acb63c43f5e32a0c..e77049d200153e9c2f15fb0ca097edd1c1649fe3 100644 (file)
@@ -26,7 +26,7 @@ void forAllDescendants(entity root, void(entity, entity) funcPre, void(entity, e
        depthfirst(root, parent, firstChild, nextSibling, funcPre, funcPost, pass);
 }
 
-.string cvarName;
+.string controlledCvar;
 void SUB_Null_ee(entity e1, entity e2)
 {
 }
@@ -53,12 +53,12 @@ void loadAllCvars(entity root)
        forAllDescendants(root, loadCvarsOf, SUB_Null_ee, NULL);
 }
 
-.string cvarNames_Multi;
+.string controlledCvars_Multi;
 .void(entity me) saveCvars_Multi;
 string getCvarsMulti(entity me)
 {
-       if (me.cvarNames_Multi)
-               return me.cvarNames_Multi;
+       if (me.controlledCvars_Multi)
+               return me.controlledCvars_Multi;
        return string_null;
 }
 void saveCvarsMulti(entity me)
@@ -67,9 +67,9 @@ void saveCvarsMulti(entity me)
        string s, cvarname;
 
        me.saveCvars_Multi(me);
-       s = cvar_string(me.cvarName);
+       s = cvar_string(me.controlledCvar);
 
-       n = tokenize_console(me.cvarNames_Multi);
+       n = tokenize_console(me.controlledCvars_Multi);
        for(i = 0; i < n; ++i)
        {
                // cvars prefixed with ! get saved with the inverted value
@@ -89,7 +89,7 @@ void saveCvarsMulti(entity me)
 }
 void makeMulti(entity e, string otherCvars)
 {
-       e.cvarNames_Multi = otherCvars;
+       e.controlledCvars_Multi = otherCvars;
        e.saveCvars_Multi = e.saveCvars;
        e.saveCvars = saveCvarsMulti;
 }
index c3229adfdb5d4bb4c5b7e307f4d294bca69a24bd..b57627963c48c547ddd9b1c6e0e934562a88be6c 100644 (file)
@@ -151,7 +151,7 @@ void antilag_restore_all(entity ignore)
 float antilag_getlag(entity e)
 {
        float lag = ((IS_REAL_CLIENT(e)) ? ANTILAG_LATENCY(e) : 0);
-       bool noantilag = ((IS_CLIENT(e)) ? CS(e).cvar_cl_noantilag : false);
+       bool noantilag = ((IS_CLIENT(e)) ? CS_CVAR(e).cvar_cl_noantilag : false);
        if(autocvar_g_antilag == 0 || noantilag || lag < 0.001)
                lag = 0;
 
@@ -202,14 +202,14 @@ void traceline_antilag_force (entity source, vector v1, vector v2, float nomonst
 }
 void traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       bool noantilag = ((IS_CLIENT(source)) ? CS(source).cvar_cl_noantilag : false);
+       bool noantilag = ((IS_CLIENT(source)) ? CS_CVAR(source).cvar_cl_noantilag : false);
        if (autocvar_g_antilag != 2 || noantilag)
                lag = 0;
        traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
 }
 void tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
 {
-       bool noantilag = ((IS_CLIENT(source)) ? CS(source).cvar_cl_noantilag : false);
+       bool noantilag = ((IS_CLIENT(source)) ? CS_CVAR(source).cvar_cl_noantilag : false);
        if (autocvar_g_antilag != 2 || noantilag)
                lag = 0;
        tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, false);
@@ -220,14 +220,14 @@ void WarpZone_traceline_antilag_force (entity source, vector v1, vector v2, floa
 }
 void WarpZone_traceline_antilag (entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
 {
-       bool noantilag = ((IS_CLIENT(source)) ? CS(source).cvar_cl_noantilag : false);
+       bool noantilag = ((IS_CLIENT(source)) ? CS_CVAR(source).cvar_cl_noantilag : false);
        if (autocvar_g_antilag != 2 || noantilag)
                lag = 0;
        WarpZone_traceline_antilag_force(source, v1, v2, nomonst, forent, lag);
 }
 void WarpZone_tracebox_antilag (entity source, vector v1, vector mi, vector ma, vector v2, float nomonst, entity forent, float lag)
 {
-       bool noantilag = ((IS_CLIENT(source)) ? CS(source).cvar_cl_noantilag : false);
+       bool noantilag = ((IS_CLIENT(source)) ? CS_CVAR(source).cvar_cl_noantilag : false);
        if (autocvar_g_antilag != 2 || noantilag)
                lag = 0;
        tracebox_antilag_force_wz(source, v1, mi, ma, v2, nomonst, forent, lag, true);
index 7afa5a10c516543ef425e430144471844276a507..9ba2a333b3d57ccfc5b893af9fe59232052211c4 100644 (file)
@@ -35,8 +35,8 @@ STATIC_INIT(bot) { bot_calculate_stepheightvec(); }
 // TODO: remove this function! its only purpose is to update these fields since bot_setnameandstuff is called before ClientState
 void bot_setclientfields(entity this)
 {
-       CS(this).cvar_cl_accuracy_data_share = 1;  // share the bots weapon accuracy data with the world
-       CS(this).cvar_cl_accuracy_data_receive = 0;  // don't receive any weapon accuracy data
+       CS_CVAR(this).cvar_cl_accuracy_data_share = 1;  // share the bots weapon accuracy data with the world
+       CS_CVAR(this).cvar_cl_accuracy_data_receive = 0;  // don't receive any weapon accuracy data
 }
 
 entity bot_spawn()
index 8dd73f66c48938e56750d827c0da29e34f1c046d..6bebfeb3666d33591dfe7c5c865344dba112979b 100644 (file)
@@ -785,7 +785,7 @@ void PutPlayerInServer(entity this)
 
        if (CS(this).impulse) ImpulseCommands(this);
 
-       W_ResetGunAlign(this, CS(this).cvar_cl_gunalign);
+       W_ResetGunAlign(this, CS_CVAR(this).cvar_cl_gunalign);
        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
                .entity weaponentity = weaponentities[slot];
@@ -1220,7 +1220,7 @@ void ClientDisconnect(entity this)
        MUTATOR_CALLHOOK(ClientDisconnect, this);
 
        strfree(CS(this).netname_previous); // needs to be before the CS entity is removed!
-       strfree(CS(this).weaponorder_byimpulse);
+       strfree(CS_CVAR(this).weaponorder_byimpulse);
        ClientState_detach(this);
 
        Portal_ClearAll(this);
@@ -2260,7 +2260,7 @@ bool PlayerThink(entity this)
        bool dualwielding = W_DualWielding(this);
        if(this.dualwielding_prev != dualwielding)
        {
-               W_ResetGunAlign(this, CS(this).cvar_cl_gunalign);
+               W_ResetGunAlign(this, CS_CVAR(this).cvar_cl_gunalign);
                this.dualwielding_prev = dualwielding;
        }
 
@@ -2351,7 +2351,7 @@ void ObserverOrSpectatorThink(entity this)
                        }
                }
                else {
-                       int preferred_movetype = ((!PHYS_INPUT_BUTTON_USE(this) ? CS(this).cvar_cl_clippedspectating : !CS(this).cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
+                       int preferred_movetype = ((!PHYS_INPUT_BUTTON_USE(this) ? CS_CVAR(this).cvar_cl_clippedspectating : !CS_CVAR(this).cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
                        set_movetype(this, preferred_movetype);
                }
        } else {
@@ -2430,8 +2430,8 @@ Called every frame for each client before the physics are run
 .float last_vehiclecheck;
 void PlayerPreThink (entity this)
 {
-       STAT(GUNALIGN, this) = CS(this).cvar_cl_gunalign; // TODO
-       STAT(MOVEVARS_CL_TRACK_CANJUMP, this) = CS(this).cvar_cl_movement_track_canjump;
+       STAT(GUNALIGN, this) = CS_CVAR(this).cvar_cl_gunalign; // TODO
+       STAT(MOVEVARS_CL_TRACK_CANJUMP, this) = CS_CVAR(this).cvar_cl_movement_track_canjump;
 
        WarpZone_PlayerPhysics_FixVAngle(this);
 
@@ -2473,19 +2473,19 @@ void PlayerPreThink (entity this)
        }
 
        // version nagging
-       if (CS(this).version_nagtime && CS(this).cvar_g_xonoticversion && time > CS(this).version_nagtime) {
+       if (CS(this).version_nagtime && CS_CVAR(this).cvar_g_xonoticversion && time > CS(this).version_nagtime) {
         CS(this).version_nagtime = 0;
-        if (strstrofs(CS(this).cvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(CS(this).cvar_g_xonoticversion, "autobuild", 0) >= 0) {
+        if (strstrofs(CS_CVAR(this).cvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(CS_CVAR(this).cvar_g_xonoticversion, "autobuild", 0) >= 0) {
             // git client
         } else if (strstrofs(autocvar_g_xonoticversion, "git", 0) >= 0 || strstrofs(autocvar_g_xonoticversion, "autobuild", 0) >= 0) {
             // git server
-            Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, CS(this).cvar_g_xonoticversion);
+            Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_BETA, autocvar_g_xonoticversion, CS_CVAR(this).cvar_g_xonoticversion);
         } else {
-            int r = vercmp(CS(this).cvar_g_xonoticversion, autocvar_g_xonoticversion);
+            int r = vercmp(CS_CVAR(this).cvar_g_xonoticversion, autocvar_g_xonoticversion);
             if (r < 0) { // old client
-                Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, CS(this).cvar_g_xonoticversion);
+                Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OUTDATED, autocvar_g_xonoticversion, CS_CVAR(this).cvar_g_xonoticversion);
             } else if (r > 0) { // old server
-                Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, CS(this).cvar_g_xonoticversion);
+                Send_Notification(NOTIF_ONE_ONLY, this, MSG_INFO, INFO_VERSION_OLD, autocvar_g_xonoticversion, CS_CVAR(this).cvar_g_xonoticversion);
             }
         }
     }
@@ -2549,7 +2549,7 @@ void PlayerPreThink (entity this)
                this.last_vehiclecheck = time + 1;
        }
 
-       if(!CS(this).cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
+       if(!CS_CVAR(this).cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
        {
                if(PHYS_INPUT_BUTTON_USE(this) && !CS(this).usekeypressed)
                        PlayerUseKey(this);
index efe336d1f6913d81102492b484daf51601c2908e..313945de81e91d3ae3f6d93e6b5d370ba76591a6 100644 (file)
@@ -172,7 +172,6 @@ CLASS(Client, Object)
     ATTRIB(Client, zoomstate, bool, this.zoomstate);
     ATTRIB(Client, just_joined, bool, this.just_joined);
     ATTRIB(Client, race_completed, bool, this.race_completed);
-    ATTRIBARRAY(Client, msg_choice_choices, int, 20); // TODO: actually NOTIF_CHOICE_MAX
     ATTRIB(Client, latency_sum, float, this.latency_sum);
     ATTRIB(Client, latency_cnt, int, this.latency_cnt);
     ATTRIB(Client, latency_time, float, this.latency_time);
@@ -192,6 +191,9 @@ CLASS(Client, Object)
 
     // networked cvars
 
+// not currently handled by ClientState
+#if 0
+    ATTRIBARRAY(Client, msg_choice_choices, int, 20); // TODO: actually NOTIF_CHOICE_MAX
     ATTRIB(Client, cvar_cl_allow_uid2name, int, this.cvar_cl_allow_uid2name);
     ATTRIB(Client, cvar_cl_allow_uidtracking, int, this.cvar_cl_allow_uidtracking);
     ATTRIB(Client, cvar_cl_autotaunt, float, this.cvar_cl_autotaunt);
@@ -225,6 +227,7 @@ CLASS(Client, Object)
     ATTRIB(Client, cvar_cl_cts_noautoswitch, bool, this.cvar_cl_cts_noautoswitch);
     ATTRIB(Client, cvar_cl_weapon_switch_reload, bool, this.cvar_cl_weapon_switch_reload);
     ATTRIB(Client, cvar_cl_weapon_switch_fallback_to_impulse, bool, this.cvar_cl_weapon_switch_fallback_to_impulse);
+#endif
 
     METHOD(Client, m_unwind, bool(Client this));
 
index ad3685a1f0a549cc03631011531764dfb900cb34..bb227c63c6bd375a1d2d24997368d77c77ea8272 100644 (file)
@@ -73,8 +73,8 @@ void ClientCommand_autoswitch(entity caller, int request, int argc)
                {
                        if (argv(1) != "")
                        {
-                               CS(caller).autoswitch = InterpretBoolean(argv(1));
-                               sprint(caller, strcat("^1autoswitch is currently turned ", (CS(caller).autoswitch ? "on" : "off"), ".\n"));
+                               CS_CVAR(caller).autoswitch = InterpretBoolean(argv(1));
+                               sprint(caller, strcat("^1autoswitch is currently turned ", (CS_CVAR(caller).autoswitch ? "on" : "off"), ".\n"));
                                return;
                        }
                }
@@ -355,7 +355,7 @@ void ClientCommand_physics(entity caller, int request, int argc)
                }
 
                default:
-                       sprint(caller, strcat("Current physics set: ^3", CS(caller).cvar_cl_physics, "\n"));
+                       sprint(caller, strcat("Current physics set: ^3", CS_CVAR(caller).cvar_cl_physics, "\n"));
                case CMD_REQUEST_USAGE:
                {
                        sprint(caller, "\nUsage:^3 cmd physics <physics>\n");
@@ -603,7 +603,7 @@ void ClientCommand_sentcvar(entity caller, int request, int argc, string command
                                        tokenize_console(s);
                                }
 
-                               GetCvars(caller, CS(caller), 1);
+                               GetCvars(caller, CS_CVAR(caller), 1);
 
                                return;
                        }
index d0f882dce312d496ca97d28cd5c041506c78a628..1001bb7d7d9bd1f1602bb4fbb37e6fbb046c80dc 100644 (file)
@@ -379,7 +379,7 @@ void GetCvars_handleFloatOnce(entity this, entity store, string thisname, float
 string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(entity this, string wo)
 {
        string o = W_FixWeaponOrder_ForceComplete(wo);
-       strcpy(CS(this).weaponorder_byimpulse, W_FixWeaponOrder_BuildImpulseList(o));
+       strcpy(CS_CVAR(this).weaponorder_byimpulse, W_FixWeaponOrder_BuildImpulseList(o));
        return o;
 }
 
@@ -400,7 +400,7 @@ void GetCvars(entity this, entity store, int f)
        get_cvars_s = s;
        MUTATOR_CALLHOOK(GetCvars);
 
-       Notification_GetCvars(this);
+       Notification_GetCvars(this, store);
 
        ReplicateVars(this, store, s, f);
 
index 6d03725f8f37a1b59bccf96c587c8416fff14099..ce0d6cd0a6c10f3fe0653d33da3ed700b0d95fb2 100644 (file)
@@ -17,7 +17,7 @@ void Handicap_Initialize(entity player)
 
 float Handicap_GetVoluntaryHandicap(entity player)
 {
-       return bound(1.0, CS(player).cvar_cl_handicap, 10.0);
+       return bound(1.0, CS_CVAR(player).cvar_cl_handicap, 10.0);
 }
 
 float Handicap_GetForcedHandicap(entity player)
index e9ebaec8766d8ec740ce48090006779c74692573..3fa3dc6c6fb263ee43874d7ab52a620ec2a7abee 100644 (file)
@@ -97,7 +97,7 @@ void weapon_priority_handle(entity this, int dir, int number, int imp)
        for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
        {
                .entity weaponentity = weaponentities[slot];
-               W_CycleWeapon(this, CS(this).cvar_cl_weaponpriorities[number], dir, weaponentity);
+               W_CycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriorities[number], dir, weaponentity);
                if(autocvar_g_weaponswitch_debug != 1)
                        break;
        }
index 001692cf9d2b3f40e5a438b23d6d3c11cfb823a8..e1fb6f6070503374db00683ed8e8c0ba6e725086 100644 (file)
@@ -424,8 +424,8 @@ void IntermissionThink(entity this)
 {
        FixIntermissionClient(this);
 
-       float server_screenshot = (autocvar_sv_autoscreenshot && CS(this).cvar_cl_autoscreenshot);
-       float client_screenshot = (CS(this).cvar_cl_autoscreenshot == 2);
+       float server_screenshot = (autocvar_sv_autoscreenshot && CS_CVAR(this).cvar_cl_autoscreenshot);
+       float client_screenshot = (CS_CVAR(this).cvar_cl_autoscreenshot == 2);
 
        if( (server_screenshot || client_screenshot)
                && ((this.autoscreenshot > 0) && (time > this.autoscreenshot)) )
index 36932f0cef3f490a3bbff2f85e09033e49e25e8e..403125eea51b7ef9c41bcbfdea6aa6c654405991 100644 (file)
@@ -481,7 +481,7 @@ bool Item_GiveTo(entity item, entity player)
        // if the player is using their best weapon before items are given, they
        // probably want to switch to an even better weapon after items are given
 
-       if(CS(player).autoswitch)
+       if(CS_CVAR(player).autoswitch)
        {
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
@@ -570,7 +570,7 @@ bool Item_GiveTo(entity item, entity player)
                return false;
 
        // crude hack to enforce switching weapons
-       if(g_cts && item.itemdef.instanceOfWeaponPickup && !CS(player).cvar_cl_cts_noautoswitch)
+       if(g_cts && item.itemdef.instanceOfWeaponPickup && !CS_CVAR(player).cvar_cl_cts_noautoswitch)
        {
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
@@ -1429,7 +1429,7 @@ float GiveItems(entity e, float beginarg, float endarg)
 
        int _switchweapon = 0;
 
-       if(CS(e).autoswitch)
+       if(CS_CVAR(e).autoswitch)
        {
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
index 70a98083efb22a03171f78a0adae0fe623c189ac..4e166214ca29ad0fa40a794b727dbd9c027b5144 100644 (file)
@@ -424,8 +424,6 @@ void race_deleteTime(string map, float pos)
 
 void race_SendTime(entity e, float cp, float t, float tvalid)
 {
-       float snew, l;
-
        if(g_race_qualifying)
                t += e.race_penalty_accumulator;
 
@@ -449,9 +447,9 @@ void race_SendTime(entity e, float cp, float t, float tvalid)
                                GameRules_scoring_add(e, RACE_FASTEST, t - s);
 
                        s = GameRules_scoring_add(e, RACE_TIME, 0);
-                       snew = TIME_ENCODE(time - game_starttime);
+                       float snew = TIME_ENCODE(time - game_starttime);
                        GameRules_scoring_add(e, RACE_TIME, snew - s);
-                       l = GameRules_scoring_add_team(e, RACE_LAPS, 1);
+                       float l = GameRules_scoring_add_team(e, RACE_LAPS, 1);
 
                        if(autocvar_fraglimit)
                                if(l >= autocvar_fraglimit)
index 3113e8a965f9b56ac52974ae3543f3e81e1a0190..7cc5c624185c5aef4f188b7c91ec4c2d986e6487 100644 (file)
@@ -763,7 +763,7 @@ entity PlayerScore_Sort(.float field, int teams, bool strict, bool nospectators)
                pbest.chain = NULL;
 
                ++i;
-               if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, false))
+               if(!plast || PlayerTeamScore_Compare(plast, pbest, teams, strict))
                        j = i;
 
                pbest.(field) = j;
index 7b5220e036122e53a2850b5ae5d4740a1b27393e..3eafbc76c7025f0eae0aac9e691b087e5dd77a78 100644 (file)
@@ -27,7 +27,7 @@ bool accuracy_send(entity this, entity to, int sf)
        a = CS(a).accuracy;
 
        if (to != a.owner)
-               if (!autocvar_sv_accuracy_data_share && !CS(a.owner).cvar_cl_accuracy_data_share)
+               if (!autocvar_sv_accuracy_data_share && !CS_CVAR(a.owner).cvar_cl_accuracy_data_share)
                        sf = 0;
        // note: zero sendflags can never be sent... so we can use that to say that we send no accuracy!
        WriteInt24_t(MSG_ENTITY, sf);
index 5dd3073e9f0fe57b800b0ba19376e3a159942e81..09f5e65ca14349aa7da3fc37f7d5b68638779647 100644 (file)
@@ -283,7 +283,7 @@ bool W_SwitchWeapon(entity this, Weapon w, .entity weaponentity)
                        return false;
                }
        }
-       else if(!weaponLocked(this) && CS(this).cvar_cl_weapon_switch_reload)
+       else if(!weaponLocked(this) && CS_CVAR(this).cvar_cl_weapon_switch_reload)
        {
                entity actor = this;
                w.wr_reload(w, actor, weaponentity);
@@ -294,7 +294,7 @@ bool W_SwitchWeapon(entity this, Weapon w, .entity weaponentity)
 
 void W_SwitchWeapon_TryOthers(entity this, Weapon w, .entity weaponentity)
 {
-       if(!W_SwitchWeapon(this, w, weaponentity) && CS(this).cvar_cl_weapon_switch_fallback_to_impulse)
+       if(!W_SwitchWeapon(this, w, weaponentity) && CS_CVAR(this).cvar_cl_weapon_switch_fallback_to_impulse)
                W_NextWeaponOnImpulse(this, w.impulse, weaponentity);
 }
 
@@ -309,7 +309,7 @@ void W_CycleWeapon(entity this, string weaponorder, float dir, .entity weaponent
 void W_NextWeaponOnImpulse(entity this, float imp, .entity weaponentity)
 {
        float w;
-       w = W_GetCycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, imp, 1, (CS(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
+       w = W_GetCycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriority, +1, imp, 1, (CS_CVAR(this).cvar_cl_weaponimpulsemode == 0), weaponentity);
        if(w > 0)
                W_SwitchWeapon(this, REGISTRY_GET(Weapons, w), weaponentity);
 }
@@ -320,9 +320,9 @@ void W_NextWeapon(entity this, int list, .entity weaponentity)
        if(list == 0)
                W_CycleWeapon(this, weaponorder_byid, -1, weaponentity);
        else if(list == 1)
-               W_CycleWeapon(this, CS(this).weaponorder_byimpulse, -1, weaponentity);
+               W_CycleWeapon(this, CS_CVAR(this).weaponorder_byimpulse, -1, weaponentity);
        else if(list == 2)
-               W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, -1, weaponentity);
+               W_CycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriority, -1, weaponentity);
 }
 
 // prev weapon
@@ -331,9 +331,9 @@ void W_PreviousWeapon(entity this, float list, .entity weaponentity)
        if(list == 0)
                W_CycleWeapon(this, weaponorder_byid, +1, weaponentity);
        else if(list == 1)
-               W_CycleWeapon(this, CS(this).weaponorder_byimpulse, +1, weaponentity);
+               W_CycleWeapon(this, CS_CVAR(this).weaponorder_byimpulse, +1, weaponentity);
        else if(list == 2)
-               W_CycleWeapon(this, CS(this).cvar_cl_weaponpriority, +1, weaponentity);
+               W_CycleWeapon(this, CS_CVAR(this).cvar_cl_weaponpriority, +1, weaponentity);
 }
 
 // previously used if exists and has ammo, (second) best otherwise
index 363b569efdd8f23911a313eb9050cf206d82c691..093d6612b348052416bbf609e26217583914b398 100644 (file)
@@ -20,7 +20,7 @@ bool client_hasweapon(entity this, Weapon wpn, .entity weaponentity, float andam
 .int weaponcomplainindex;
 float W_GetCycleWeapon(entity this, string weaponorder, float dir, float imp, float complain, float skipmissing, .entity weaponentity);
 
-#define w_getbestweapon(ent,wepent) REGISTRY_GET(Weapons, W_GetCycleWeapon(ent, CS(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
+#define w_getbestweapon(ent,wepent) REGISTRY_GET(Weapons, W_GetCycleWeapon(ent, CS_CVAR(ent).cvar_cl_weaponpriority, 0, -1, false, true, wepent))
 
 void W_SwitchWeapon_Force(Player this, Weapon w, .entity weaponentity);
 
index b345b0984018ec8ccd77df2d03df5396f058630f..686634c7acfdadae38a1a19e29d521643b78ebe5 100644 (file)
@@ -107,7 +107,7 @@ void W_SetupShot_Dir_ProjectileSize_Range(entity ent, .entity weaponentity, vect
        //vector prevend = w_shotend;
 
        if (antilag)
-       if (!CS(ent).cvar_cl_noantilag)
+       if (!CS_CVAR(ent).cvar_cl_noantilag)
        {
                if (autocvar_g_antilag == 1) // switch to "ghost" if not hitting original
                {
index 0825e4dd086fd1df32316458926d14d223b99fb2..aa55e8e600924559c27aa103f1deb82afd66bae9 100644 (file)
@@ -231,11 +231,9 @@ set g_items_maxdist 4500 "maximum distance at which an item can be viewed, after
 
 set g_grab_range 200 "distance at which dragable objects can be grabbed"
 
-set g_cloaked 0 "display all players mostly invisible"
 set g_player_alpha 1 "default opacity of players"
 set g_player_brightness 0 "set to 2 for brighter players"
 set g_player_damageforcescale 2 "push multiplier of attacks against players"
-set g_balance_cloaked_alpha 0.25 "opacity of cloaked players"
 
 set g_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps"
 set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps"