From: Rudolf Polzer Date: Tue, 9 Nov 2010 21:04:23 +0000 (+0100) Subject: cvar: sv_allow_fullbright X-Git-Tag: xonotic-v0.1.0preview~169 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a8984299a3be0b649c31067accce7aefd7004c93;p=xonotic%2Fxonotic-data.pk3dir.git cvar: sv_allow_fullbright --- diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index 59c3be6e4..19d728abe 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -2009,6 +2009,9 @@ r_polygonoffset_decals_factor 0 mod_q3shader_default_polygonoffset -14 mod_q3shader_default_polygonfactor 0 +// allow fullbright +set sv_allow_fullbright 0 "when set, clients may use r_fullbright on this server without getting a night vision effect overlay" + // other config files exec balanceXonotic.cfg exec ctfscoring-ai.cfg diff --git a/qcsrc/client/Defs.qc b/qcsrc/client/Defs.qc index 959d593a3..8e47e6fa5 100644 --- a/qcsrc/client/Defs.qc +++ b/qcsrc/client/Defs.qc @@ -269,3 +269,5 @@ string weaponorder_byimpulse; string weaponorder_bypriority; float nex_charge_movingavg; + +float serverflags; diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 4846a9fef..d358a59a5 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -1093,6 +1093,8 @@ void Ent_Init() nex_scope = !ReadByte(); campingrifle_scope = !ReadByte(); + serverflags = ReadByte(); + if(!postinit) PostInit(); } diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 3c1b699fb..1c58d3904 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -566,7 +566,8 @@ void CSQC_UpdateView(float w, float h) // next R_RenderScene call drawstring('0 0 0', "", '1 1 0', '1 1 1', 0, 0); - if(cvar("r_fakelight") == 2 || cvar("r_fullbright") == 1) + if(cvar("r_fakelight") >= 2 || cvar("r_fullbright") >= 1) + if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT) { // apply night vision effect vector rgb, tc_00, tc_01, tc_10, tc_11; diff --git a/qcsrc/common/constants.qh b/qcsrc/common/constants.qh index 9eb7a1610..4acf797b7 100644 --- a/qcsrc/common/constants.qh +++ b/qcsrc/common/constants.qh @@ -646,3 +646,5 @@ string HUD_PANELNAME_ENGINEINFO = "engineinfo"; string HUD_PANELNAME_INFOMESSAGES = "infomessages"; float HUD_MENU_ENABLE = 0; + +#define SERVERFLAG_ALLOW_FULLBRIGHT 1 diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 45394eb79..74797441c 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -660,3 +660,5 @@ string deathmessage; .float nex_charge; float allowed_to_spawn; // boolean variable used by the clan arena code to determine if a player can spawn (after the round has ended) + +float serverflags; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index b074164a5..738c32eba 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -1187,6 +1187,10 @@ void readlevelcvars(void) if(cvar("g_rocket_flying")) MUTATOR_ADD(mutator_rocketflying); + serverflags = 0; + if(cvar("sv_allow_fullbright")) + serverflags |= SERVERFLAG_ALLOW_FULLBRIGHT; + g_bugrigs = cvar("g_bugrigs"); g_bugrigs_planar_movement = cvar("g_bugrigs_planar_movement"); g_bugrigs_planar_movement_car_jumping = cvar("g_bugrigs_planar_movement_car_jumping");