- 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 '^:'
-Mon Nov 30 07:23:45 CET 2020
+Thu Dec 10 07:23:45 CET 2020
# 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 ""
// ===============
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"
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
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;
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;
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');
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); \
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)
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));
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))
{
{
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));
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))
{
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));
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);
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;
.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
#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)
}
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);
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
{
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;
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;
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;
bool Notification_ShouldSend(NOTIF broadcast, entity to_client, entity other_client)
{
+ if(!IS_REAL_CLIENT(to_client))
+ return false;
+
switch (broadcast)
{
case NOTIF_ONE:
// 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],
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),
#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; \
}
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;
#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;
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);
}
#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
#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
// 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); }
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)
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);
.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;
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);
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);
);
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)
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;
#include "xonotic/serverlist.qh"
#include "xonotic/slider_resolution.qh"
-.string cvarName;
+.string controlledCvar;
#include "xonotic/util.qh"
{
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)
}
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);
}
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)
{
{
// 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);
// 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)
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);
}
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);
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);
{
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);
}
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);
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)
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);
}
}
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);
}
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);
// no change
break;
}
- me.cvarName = "_cl_color";
+ me.controlledCvar = "_cl_color";
me.cvarValueFloat = theValue;
me.cvarPart = theColor;
me.loadCvars(me);
}
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)
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));
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))
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));
{
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);
}
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)
{
r = 0;
if(key == K_ENTER || key == K_KP_ENTER)
{
- if(me.cvarName)
+ if(me.controlledCvar)
{
me.saveCvars(me);
r = 1;
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);
}
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);
{
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
{
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
{
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));
}
}
}
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);
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
}
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);
}
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);
{
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))
}
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;
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);
}
}
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)
}
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
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)
}
}
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);
}
}
}
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);
depthfirst(root, parent, firstChild, nextSibling, funcPre, funcPost, pass);
}
-.string cvarName;
+.string controlledCvar;
void SUB_Null_ee(entity e1, entity e2)
{
}
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)
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
}
void makeMulti(entity e, string otherCvars)
{
- e.cvarNames_Multi = otherCvars;
+ e.controlledCvars_Multi = otherCvars;
e.saveCvars_Multi = e.saveCvars;
e.saveCvars = saveCvarsMulti;
}
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;
}
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);
}
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);
// 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()
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];
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);
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;
}
}
}
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 {
.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);
}
// 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);
}
}
}
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);
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);
// 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);
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));
{
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;
}
}
}
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");
tokenize_console(s);
}
- GetCvars(caller, CS(caller), 1);
+ GetCvars(caller, CS_CVAR(caller), 1);
return;
}
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;
}
get_cvars_s = s;
MUTATOR_CALLHOOK(GetCvars);
- Notification_GetCvars(this);
+ Notification_GetCvars(this, store);
ReplicateVars(this, store, s, f);
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)
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;
}
{
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)) )
// 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)
{
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)
{
int _switchweapon = 0;
- if(CS(e).autoswitch)
+ if(CS_CVAR(e).autoswitch)
{
for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
{
void race_SendTime(entity e, float cp, float t, float tvalid)
{
- float snew, l;
-
if(g_race_qualifying)
t += e.race_penalty_accumulator;
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)
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;
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);
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);
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);
}
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);
}
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
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
.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);
//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
{
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"