[nexuiz-commits] r7864 - in trunk/data: . qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Sep 22 11:18:10 EDT 2009
Author: div0
Date: 2009-09-22 11:18:10 -0400 (Tue, 22 Sep 2009)
New Revision: 7864
Modified:
trunk/data/defaultNexuiz.cfg
trunk/data/qcsrc/server/constants.qh
trunk/data/qcsrc/server/miscfunctions.qc
trunk/data/qcsrc/server/t_items.qc
Log:
new cvar: g_ghost_items (1 by default, can be set to 0 to disable ghost items)
Modified: trunk/data/defaultNexuiz.cfg
===================================================================
--- trunk/data/defaultNexuiz.cfg 2009-09-22 12:21:00 UTC (rev 7863)
+++ trunk/data/defaultNexuiz.cfg 2009-09-22 15:18:10 UTC (rev 7864)
@@ -26,7 +26,7 @@
seta g_configversion 0 "Configuration file version (used to upgrade settings) 0: first run, or previous start was <2.4.1 Later, it's overridden by config.cfg, version ranges are defined in config_update.cfg"
// default.cfg versioning (update using update-cvarcount.sh, run that every time after adding a new cvar)
-set cvar_check_default 23bb243e7dbb87bbdfac5c6d68afd196
+set cvar_check_default 28459139144883d7da0c4033615e0b20
// Nexuiz version (formatted for machines)
// used to determine if a client version is compatible
@@ -1725,3 +1725,5 @@
set g_triggerimpulse_accel_multiplier 1 "trigger_impulse accelerator multiplier (applied AFTER the power)"
set g_triggerimpulse_directional_multiplier 1 "trigger_impulse directional field multiplier"
set g_triggerimpulse_radial_multiplier 1 "trigger_impulse radial field multiplier"
+
+set g_ghost_items 1 "enable ghosted items (when between 0 and 1, overrides the alpha value)"
Modified: trunk/data/qcsrc/server/constants.qh
===================================================================
--- trunk/data/qcsrc/server/constants.qh 2009-09-22 12:21:00 UTC (rev 7863)
+++ trunk/data/qcsrc/server/constants.qh 2009-09-22 15:18:10 UTC (rev 7864)
@@ -1,5 +1,5 @@
-string CVAR_CHECK_DEFAULT = "23bb243e7dbb87bbdfac5c6d68afd196";
-string CVAR_CHECK_WEAPONS = "c55b862a83b1579ec2996cb2f92b819d";
+string CVAR_CHECK_DEFAULT = "28459139144883d7da0c4033615e0b20";
+string CVAR_CHECK_WEAPONS = "bc8154746bdc33b6ff517c0e19fa91e0";
float FALSE = 0;
float TRUE = 1;
Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc 2009-09-22 12:21:00 UTC (rev 7863)
+++ trunk/data/qcsrc/server/miscfunctions.qc 2009-09-22 15:18:10 UTC (rev 7864)
@@ -750,6 +750,7 @@
float warmup_start_health;
float warmup_start_armorvalue;
float g_weapon_stay;
+float g_ghost_items;
entity get_weaponinfo(float w);
@@ -1157,6 +1158,9 @@
g_weapon_stay = cvar("g_weapon_stay");
if (!g_weapon_stay && (cvar("deathmatch") == 2))
g_weapon_stay = 1;
+ g_ghost_items = cvar("g_ghost_items");
+ if(g_ghost_items >= 1)
+ g_ghost_items = 0.13; // default alpha value
if not(inWarmupStage)
game_starttime = cvar("g_start_delay");
Modified: trunk/data/qcsrc/server/t_items.qc
===================================================================
--- trunk/data/qcsrc/server/t_items.qc 2009-09-22 12:21:00 UTC (rev 7863)
+++ trunk/data/qcsrc/server/t_items.qc 2009-09-22 15:18:10 UTC (rev 7864)
@@ -46,10 +46,20 @@
if(self.spawnshieldtime)
return TRUE;
if(self.weapons != (self.weapons & other.weapons))
- self.alpha = 0.5;
+ {
+ self.alpha = 0.5 + 0.5 * g_ghost_items; // halfway more alpha
+ return TRUE;
+ }
else
- self.alpha = 0.13;
- return TRUE;
+ {
+ if(g_ghost_items)
+ {
+ self.alpha = g_ghost_items;
+ return TRUE;
+ }
+ else
+ return FALSE;
+ }
}
void Item_Show (entity e, float mode)
@@ -84,23 +94,34 @@
e.solid = SOLID_TRIGGER; // can STILL be picked up!
e.effects |= EF_STARDUST;
//e.colormod = '0.2 1 0.2';
- e.alpha = 0.5;
+ //e.alpha = 0.5; // will be overridden by CEFC though...
e.customizeentityforclient = Item_Customize;
e.spawnshieldtime = 0; // field indicates whether picking it up may give you anything other than the weapon
}
- else
+ else if(g_ghost_items)
{
// make the item translucent green and not touchable
e.model = e.mdl;
e.solid = SOLID_NOT;
//e.colormod = '0.2 1 0.2';
- e.alpha = 0.13;
+ e.alpha = g_ghost_items;
e.customizeentityforclient = func_null;
e.spawnshieldtime = 1;
}
+ else
+ {
+ // hide the item completely
+ e.model = string_null;
+ e.solid = SOLID_NOT;
+ //e.colormod = '0 0 0';
+ e.alpha = 0;
+ e.customizeentityforclient = func_null;
+ e.spawnshieldtime = 1;
+ }
+
if (e.strength_finished || e.invincible_finished)
e.effects |= EF_ADDITIVE | EF_FULLBRIGHT;
if (cvar("g_fullbrightitems"))
More information about the nexuiz-commits
mailing list