[nexuiz-commits] r6884 - in branches/nexuiz-2.0: . data data/models/player data/particles data/qcsrc/client data/qcsrc/common data/qcsrc/menu/nexuiz data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jun 6 11:11:33 EDT 2009


Author: div0
Date: 2009-06-06 11:11:32 -0400 (Sat, 06 Jun 2009)
New Revision: 6884

Modified:
   branches/nexuiz-2.0/.patchsets
   branches/nexuiz-2.0/data/defaultNexuiz.cfg
   branches/nexuiz-2.0/data/effectinfo.txt
   branches/nexuiz-2.0/data/models/player/carni.txt
   branches/nexuiz-2.0/data/models/player/carniarmor.txt
   branches/nexuiz-2.0/data/models/player/fricka.txt
   branches/nexuiz-2.0/data/models/player/grunt.txt
   branches/nexuiz-2.0/data/models/player/headhunter.txt
   branches/nexuiz-2.0/data/models/player/heroine.txt
   branches/nexuiz-2.0/data/models/player/insurrectionist.txt
   branches/nexuiz-2.0/data/models/player/lurk.txt
   branches/nexuiz-2.0/data/models/player/lycanthrope.txt
   branches/nexuiz-2.0/data/models/player/marine.txt
   branches/nexuiz-2.0/data/models/player/mulder.txt
   branches/nexuiz-2.0/data/models/player/nexus.txt
   branches/nexuiz-2.0/data/models/player/pyria.txt
   branches/nexuiz-2.0/data/models/player/quark.txt
   branches/nexuiz-2.0/data/models/player/reptile.txt
   branches/nexuiz-2.0/data/models/player/shock.txt
   branches/nexuiz-2.0/data/models/player/skadi.txt
   branches/nexuiz-2.0/data/models/player/specop.txt
   branches/nexuiz-2.0/data/models/player/xolar.txt
   branches/nexuiz-2.0/data/particles/particlefont.tga
   branches/nexuiz-2.0/data/qcsrc/client/Main.qc
   branches/nexuiz-2.0/data/qcsrc/client/View.qc
   branches/nexuiz-2.0/data/qcsrc/client/gibs.qc
   branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
   branches/nexuiz-2.0/data/qcsrc/common/constants.qh
   branches/nexuiz-2.0/data/qcsrc/common/util.qc
   branches/nexuiz-2.0/data/qcsrc/common/util.qh
   branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playermodel.c
   branches/nexuiz-2.0/data/qcsrc/server/bots.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
   branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
   branches/nexuiz-2.0/data/qcsrc/server/constants.qh
   branches/nexuiz-2.0/data/qcsrc/server/defs.qh
   branches/nexuiz-2.0/data/qcsrc/server/g_violence.qc
   branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
   branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
   branches/nexuiz-2.0/data/qcsrc/server/runematch.qc
   branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc
   branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
   branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc
Log:
r6776 | mrbougo | 2009-05-26 08:54:24 -0400 (Tue, 26 May 2009) | 2 lines
new gib types: alien and robot_shiny, and blood types, depending on playermodel
r6777 | mrbougo | 2009-05-26 09:59:56 -0400 (Tue, 26 May 2009) | 1 line
make human blood brighter, fix typo. one problem left: gamecode can not control the effect used in te_bloodshower
r6778 | greenmarine | 2009-05-26 12:57:39 -0400 (Tue, 26 May 2009) | 1 line
fixed bug in the score-area of the HUD (showing your score, rank and difference to 1st placed), so that in case you are spectating someone and not playing yourself, it now shows the score of the spectated player
r6779 | div0 | 2009-05-27 08:31:47 -0400 (Wed, 27 May 2009) | 2 lines
keep shot origins outside walls (maybe fixes a bug dokujisan found)
r6780 | div0 | 2009-05-27 12:32:23 -0400 (Wed, 27 May 2009) | 4 lines
- move RandomSelection to misc/
- allow strings to be randomly selected too
r6781 | div0 | 2009-05-28 03:20:22 -0400 (Thu, 28 May 2009) | 2 lines
fix cl_cmd help
r6782 | div0 | 2009-05-28 11:15:55 -0400 (Thu, 28 May 2009) | 2 lines
item pickup effect
r6783 | mand1nga | 2009-05-28 21:03:57 -0400 (Thu, 28 May 2009) | 1 line
New file based configuration for bots by Taoki
r6784 | mand1nga | 2009-05-28 21:06:47 -0400 (Thu, 28 May 2009) | 1 line
New cvar checksum


Modified: branches/nexuiz-2.0/.patchsets
===================================================================
--- branches/nexuiz-2.0/.patchsets	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/.patchsets	2009-06-06 15:11:32 UTC (rev 6884)
@@ -1,2 +1,2 @@
 master = svn://svn.icculus.org/nexuiz/trunk
-revisions_applied = 1-6774
+revisions_applied = 1-6774,6776-6784

Modified: branches/nexuiz-2.0/data/defaultNexuiz.cfg
===================================================================
--- branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/defaultNexuiz.cfg	2009-06-06 15:11:32 UTC (rev 6884)
@@ -24,7 +24,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 ca174b42ef38020187602cfda6d8ef43
+set cvar_check_default 2374fb15eacd4470860923b3ccddc0ad
 
 // Nexuiz version (formatted for machines)
 // used to determine if a client version is compatible
@@ -332,6 +332,7 @@
 
 seta cl_playerdetailreduction 0	"the higher, the less detailed"
 
+set bot_config_file bots.txt "Name and path of the bot configuration file"
 set bot_number 0	"Minimum number of bots"
 seta bot_usemodelnames 0	"Use player model names for bot names"
 set bot_nofire 0	"When set, bots never fire. Mainly for testing in g_waypointeditor mode"

Modified: branches/nexuiz-2.0/data/effectinfo.txt
===================================================================
--- branches/nexuiz-2.0/data/effectinfo.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/effectinfo.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -741,6 +741,7 @@
 tex 24 32
 size 3 8
 alpha 256 256 64
+color 0x90FFFF 0x90FFFFF
 bounce -1
 airfriction 1
 liquidfriction 4
@@ -782,7 +783,7 @@
 effect TR_BLOOD
 trailspacing 16
 type blood
-color 0xFFFFFF 0xFFFFFF
+color 0x90FFFF 0x90FFFF
 tex 24 32
 size 8 8
 alpha 384 384 192
@@ -799,7 +800,7 @@
 effect TR_SLIGHTBLOOD
 trailspacing 32
 type blood
-color 0xFFFFFF 0xFFFFFF
+color 0x90FFFF 0x90FFFF
 tex 24 32
 size 8 8
 alpha 384 384 192
@@ -829,7 +830,6 @@
 //lighttime 0
 //lightcolor 0.4 0.9 0.9
 
-
 // flare particle and light
 // used in qcsrc/server/t_items.qc:	//pointparticles(particleeffectnum("item_respawn"), self.origin + self.mins_z * '0 0 1' + '0 0 48', '0 0 0', 1)
 // used in qcsrc/server/t_items.qc:	pointparticles(particleeffectnum("item_respawn"), self.origin + 0.5 * (self.mins + self.maxs), '0 0 0', 1)
@@ -3252,3 +3252,121 @@
 tex 40 40
 //lightradius 200
 //lighttime 0
+
+effect alien_blood
+count 0.333
+type blood
+tex 24 32
+size 3 8
+alpha 256 256 64
+color 0xDC9BCD 0xDC9BCD
+bounce -1
+airfriction 1
+liquidfriction 4
+velocityjitter 64 64 64
+velocitymultiplier 5
+//blood mist
+effect alien_blood
+countabsolute 1
+type alphastatic
+tex 0 8
+size 25 30
+alpha 100 256 400
+color 0x000000 0x236432
+originjitter 11 11 11
+
+effect robot_blood
+count 0.333
+type blood
+tex 24 32
+size 3 8
+alpha 256 256 64
+bounce -1
+airfriction 1
+liquidfriction 4
+velocityjitter 64 64 64
+velocitymultiplier 5
+//blood mist
+effect robot_blood
+countabsolute 1
+type alphastatic
+tex 0 8
+size 25 30
+alpha 100 256 400
+color 0x000000 0x321964
+originjitter 11 11 11
+
+
+effect alien_TR_BLOOD
+trailspacing 16
+type blood
+color 0xDC9BCD 0xDC9BCD
+tex 24 32
+size 8 8
+alpha 384 384 192
+bounce -1
+airfriction 1
+liquidfriction 4
+velocityjitter 64 64 64
+velocitymultiplier 0.5
+
+effect robot_TR_BLOOD
+trailspacing 16
+type blood
+color 0xCDE69B 0xCDE69B
+tex 24 32
+size 8 8
+alpha 384 384 192
+bounce -1
+airfriction 1
+liquidfriction 4
+velocityjitter 64 64 64
+velocitymultiplier 0.5
+
+effect alien_TR_SLIGHTBLOOD
+trailspacing 32
+type blood
+color 0xDC9BCD 0xDC9BCD
+tex 24 32
+size 80 80
+alpha 384 384 192
+bounce -1
+airfriction 1
+liquidfriction 4
+velocityjitter 64 64 64
+velocitymultiplier 0.5
+
+effect robot_TR_SLIGHTBLOOD
+trailspacing 32
+type blood
+color 0xCDE69B 0xCDE69B
+tex 24 32
+size 8 8
+alpha 384 384 192
+bounce -1
+airfriction 1
+liquidfriction 4
+velocityjitter 64 64 64
+velocitymultiplier 0.5
+
+
+// flare particle and light
+// used in qcsrc/server/t_items.qc:	pointparticles(particleeffectnum("item_pickup"), self.origin, '0 0 0', 1)
+effect item_pickup
+countabsolute 1
+type static
+color 0x63F2EA 0x63f2EA
+size 16 16
+alpha 128 128 128
+// cloud of particles which expand rapidly and then slow to form a ball
+effect item_pickup
+count 256
+type spark
+tex 41 41
+color 0x63F2EA 0x63f2EA
+size 1 1
+alpha 256 256 1280
+//originjitter 24 24 24
+velocityjitter 256 256 256
+
+

Modified: branches/nexuiz-2.0/data/models/player/carni.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/carni.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/carni.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,9 +2,10 @@
 models/player/carni
 0
 models/player/carni.zym
+species alien
 
 Mutated Warrior
 
 Sex: Male
 Weight: 236 lb
-Age: 15
\ No newline at end of file
+Age: 15

Modified: branches/nexuiz-2.0/data/models/player/carniarmor.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/carniarmor.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/carniarmor.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/carniarmor
 1
 models/player/carni.zym
+species alien
 
 Mutated Warrior
 

Modified: branches/nexuiz-2.0/data/models/player/fricka.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/fricka.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/fricka.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,9 +2,10 @@
 models/player/fricka
 1
 models/player/visitant.zym
+species alien
 
 Mutated Warrior
 
 Sex: Female
 Weight: 126 lb
-Age: 16
\ No newline at end of file
+Age: 16

Modified: branches/nexuiz-2.0/data/models/player/grunt.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/grunt.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/grunt.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/grunt
 0
 models/player/grunt.zym
+species robot_shiny
 
 Half Mechanical 
 Human Fighter

Modified: branches/nexuiz-2.0/data/models/player/headhunter.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/headhunter.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/headhunter.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/headhunter
 0
 models/player/headhunter.zym
+species alien
 
 Mutated Warrior
 

Modified: branches/nexuiz-2.0/data/models/player/heroine.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/heroine.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/heroine.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/heroine
 1
 models/player/jeandarc.zym
+species human
 
 Solo Fighter
 

Modified: branches/nexuiz-2.0/data/models/player/insurrectionist.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/insurrectionist.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/insurrectionist.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/insurrectionist
 0
 models/player/insurrectionist.zym
+species human
 
 Warrior
 

Modified: branches/nexuiz-2.0/data/models/player/lurk.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/lurk.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/lurk.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/lurk
 0
 models/player/lurk.zym
+species alien
 
 Reptilian Combatant
 

Modified: branches/nexuiz-2.0/data/models/player/lycanthrope.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/lycanthrope.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/lycanthrope.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/lycanthrope
 0
 models/player/lycanthrope.zym
+species human
 
 Monsterous Opponent
 

Modified: branches/nexuiz-2.0/data/models/player/marine.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/marine.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/marine.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/marine
 0
 models/player/marine.zym
+species human
 
 Service Man
 

Modified: branches/nexuiz-2.0/data/models/player/mulder.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/mulder.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/mulder.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/mulder
 1
 models/player/nexus.zym
+species robot_shiny
 
 Nexuiz's Soldier
 

Modified: branches/nexuiz-2.0/data/models/player/nexus.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/nexus.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/nexus.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/nexus
 0
 models/player/nexus.zym
+species human
 
 Nexuiz's Soldier
 

Modified: branches/nexuiz-2.0/data/models/player/pyria.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/pyria.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/pyria.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/pyria
 0
 models/player/pyria.zym
+species human
 
 Necro Warrior
 

Modified: branches/nexuiz-2.0/data/models/player/quark.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/quark.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/quark.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/quark
 0
 models/player/crash.zym
+species robot_shiny
 
 Robot Fighter
 

Modified: branches/nexuiz-2.0/data/models/player/reptile.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/reptile.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/reptile.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/reptile
 1
 models/player/lurk.zym
+species alien
 
 Reptilian Combatant
 

Modified: branches/nexuiz-2.0/data/models/player/shock.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/shock.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/shock.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/shock
 0
 models/player/shock.zym
+species human
 
 Necro Warrior
 

Modified: branches/nexuiz-2.0/data/models/player/skadi.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/skadi.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/skadi.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/skadi
 0
 models/player/skadi.zym
+species human
 
 Necro Warrior
 

Modified: branches/nexuiz-2.0/data/models/player/specop.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/specop.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/specop.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/specop
 0
 models/player/specop.zym
+species human
 
 Solo Warrior
 

Modified: branches/nexuiz-2.0/data/models/player/xolar.txt
===================================================================
--- branches/nexuiz-2.0/data/models/player/xolar.txt	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/models/player/xolar.txt	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2,6 +2,7 @@
 models/player/xolar
 2
 models/player/nexus.zym
+species robot_shiny
 
 Nexuiz's Soldier
 

Modified: branches/nexuiz-2.0/data/particles/particlefont.tga
===================================================================
(Binary files differ)

Modified: branches/nexuiz-2.0/data/qcsrc/client/Main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/client/Main.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -420,12 +420,13 @@
 
 	if(argv(0) == "help" || argc == 0)
 	{
-		print("Usage: sv_cmd COMMAND..., where possible commands are:\n");
+		print("Usage: cl_cmd COMMAND..., where possible commands are:\n");
 		print("  settemp cvar value\n");
 		print("  radar\n");
 		print("  sbar_columns_set ...\n");
 		print("  sbar_columns_help\n");
 		GameCommand_Generic("help");
+		return;
 	}
 
 	if(GameCommand_Generic(msg))

Modified: branches/nexuiz-2.0/data/qcsrc/client/View.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/client/View.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -210,7 +210,7 @@
 {
 	float nudge = 1; // added to traceline target and subtracted from result
 	vector vecs, trueaimpoint, w_shotorg;
-	vector mi, ma;
+	vector mi, ma, dv;
 
 	mi = ma = '0 0 0';
 
@@ -244,8 +244,13 @@
 	else
 		vecs = '0 0 0';
 
-	w_shotorg = view_origin + view_right * vecs_y + view_up * vecs_z;
+	dv = view_right * vecs_y + view_up * vecs_z;
+	w_shotorg = view_origin + dv;
 
+	// move the vecs sideways as much as requested if possible
+	traceline(view_origin, w_shotorg + normalize(dv) * nudge, MOVE_NORMAL, trueaim);
+	w_shotorg = trace_endpos - normalize(dv) * nudge;
+
 	// now move the vecs forward as much as requested if possible
 	traceline(w_shotorg, w_shotorg + view_forward * (vecs_x + nudge), MOVE_NORMAL, trueaim); // FIXME this MOVE_NORMAL part will misbehave a little in csqc
 	w_shotorg = trace_endpos - view_forward * nudge;

Modified: branches/nexuiz-2.0/data/qcsrc/client/gibs.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/gibs.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/client/gibs.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -1,3 +1,17 @@
+string species_prefix(float specnum)
+{
+	switch(specnum)
+	{
+		case SPECIES_HUMAN:       return "";
+		case SPECIES_ALIEN:       return "alien_";
+		case SPECIES_ROBOT_SHINY: return "robot_";
+		case SPECIES_ROBOT_RUSTY: return "robot_"; // use the same effects, only different gibs
+		case SPECIES_ANIMAL:      return "animal_";
+		case SPECIES_RESERVED:    return "reserved_";
+		default:         return "";
+	}
+}
+
 void SUB_RemoveOnNoImpact()
 {
 	if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_NOIMPACT)
@@ -15,7 +29,7 @@
 	}
 	
 	sound(self, CHAN_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTN_NORM);
-	pointparticles(particleeffectnum("blood"), self.origin + '0 0 1', '0 0 30', 10);
+	pointparticles(particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
 
 	remove(self);
 }
@@ -30,9 +44,9 @@
 		return;
 	
 	if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie...
-		trailparticles(self, particleeffectnum("TR_SLIGHTBLOOD"), oldorg, self.origin);
+		trailparticles(self, particleeffectnum(strcat(species_prefix(self.cnt), "TR_SLIGHTBLOOD")), oldorg, self.origin);
 	else
-		trailparticles(self, particleeffectnum("TR_BLOOD"), oldorg, self.origin);
+		trailparticles(self, particleeffectnum(strcat(species_prefix(self.cnt), "TR_BLOOD")), oldorg, self.origin);
 
 	self.renderflags = 0;
 	self.alpha = bound(0, self.nextthink - time, 1);
@@ -43,7 +57,7 @@
 		R_AddEntity(self);
 }
 
-void TossGib (string mdlname, vector org, vector vconst, vector vrand, float destroyontouch)
+void TossGib (string mdlname, vector org, vector vconst, vector vrand, float specnum, float destroyontouch)
 {
 	entity gib;
 
@@ -54,8 +68,10 @@
 	gib.move_movetype = MOVETYPE_BOUNCE;
 	gib.gravity = 1;
 	gib.solid = SOLID_CORPSE;
+	gib.cnt = specnum;
 
 	setmodel (gib, mdlname); // precision set above
+	gib.skin = specnum;
 
 	setsize (gib, '-8 -8 -8', '8 8 8');
                                           
@@ -76,8 +92,9 @@
 
 void Ent_GibSplash()
 {
-	float amount, type;
+	float amount, type, specnum;
 	vector org, vel, mi, ma;
+	string specstr;
 
 	float c, gibfactor, randomvalue;
 
@@ -104,51 +121,55 @@
 	
 	self.origin = org; // for the sounds
 
+	specnum = (type & 0x78) / 8; // blood/gibmodel type: using four bits (0..15, bit indexes 3,4,5,6)
+	type = type & 0x87; // remove the species bits: bit 7 = gentle, bit 0,1,2 = kind of gib
+	specstr = species_prefix(specnum);
+
 	switch(type)
 	{
 		case 0x01:
 			sound (self, CHAN_PAIN, "misc/gib.wav", VOL_BASE, ATTN_NORM);
 
 			if(prandom() < amount)
-				TossGib("models/gibs/eye.md3", org, vel, prandomvec() * 150, 0);
+				TossGib ("models/gibs/eye.md3", org, vel, prandomvec() * 150, specnum, 0);
 			te_bloodshower(org + mi, org + ma, 1200, 1000 * amount);
 			if(prandom() < amount)
-				TossGib("models/gibs/bloodyskull.md3", org, vel, prandomvec() * 100, 0);
+				TossGib ("models/gibs/bloodyskull.md3", org, vel, prandomvec() * 100, specnum, 0);
 
 			for(c = 0; c < amount; ++c)
 			{
 				randomvalue = amount - c;
 					
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/arm.md3", org, vel, prandomvec() * (prandom() * 120 + 90),0);
+					TossGib ("models/gibs/arm.md3", org, vel, prandomvec() * (prandom() * 120 + 90), specnum,0);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/arm.md3", org, vel, prandomvec() * (prandom() * 120 + 90),0);
+					TossGib ("models/gibs/arm.md3", org, vel, prandomvec() * (prandom() * 120 + 90), specnum,0);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/chest.md3", org + '0 0 -12', vel, prandomvec() * (prandom() * 120 + 80),0);
+					TossGib ("models/gibs/chest.md3", org + '0 0 -12', vel, prandomvec() * (prandom() * 120 + 80), specnum,0);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/smallchest.md3", org, vel, prandomvec() * (prandom() * 120 + 80),0);
+					TossGib ("models/gibs/smallchest.md3", org, vel, prandomvec() * (prandom() * 120 + 80), specnum,0);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/leg1.md3", org + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85),0);
+					TossGib ("models/gibs/leg1.md3", org + '0 0 -5', vel, prandomvec() * (prandom() * 120 + 85), specnum,0);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/leg2.md3", org + '0 0 -9', vel, prandomvec() * (prandom() * 120 + 85),0);
+					TossGib ("models/gibs/leg2.md3", org + '0 0 -9', vel, prandomvec() * (prandom() * 120 + 85), specnum,0);
 
 				// these splat on impact
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450,1);
+					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450, specnum,1);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450,1);
+					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450, specnum,1);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450,1);
+					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450, specnum,1);
 				if(prandom() < randomvalue)
-					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450,1);
+					TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * 450, specnum,1);
 			}
 			break;
 		case 0x02:
-			pointparticles(particleeffectnum("blood"), org, vel, amount * 16);
+			pointparticles(particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
 			break;
 		case 0x03:
 			if(prandom() < amount)
-				TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * (prandom() * 30 + 20), 1); // TODO maybe adjust to more randomization?
+				TossGib ("models/gibs/chunk.mdl", org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1); // TODO maybe adjust to more randomization?
 			break;
 		case 0x81:
 			pointparticles(particleeffectnum("damage_dissolve"), org, vel, amount);

Modified: branches/nexuiz-2.0/data/qcsrc/client/sbar.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/client/sbar.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -1094,12 +1094,20 @@
 
 void Sbar_Score(float margin)
 {
-	float timelimit, minutes, seconds, timeleft, minutesLeft, secondsLeft, distribution, myplace, score;
+	float timelimit, minutes, seconds, timeleft, minutesLeft, secondsLeft, distribution, myplace, score, desiredPlayerId;
 	vector sbar_save, place, timer_color;
 	entity tm, pl, me;
-	sbar_save = sbar;
-	
-	myteam = GetPlayerColor(player_localentnum - 1);
+	sbar_save = sbar;
+	
+	//get the ID (could be "me", or the player I'm spectating)
+	desiredPlayerId = player_localentnum - 1;
+	if (spectatee_status) {
+		if (spectatee_status != -1) {
+			desiredPlayerId = spectatee_status - 1;
+		}
+	}
+	
+	myteam = GetPlayerColor(desiredPlayerId);
 
 	sbar_y = vid_conheight - (32+12);
 	sbar_x -= margin;
@@ -1134,7 +1142,7 @@
 		{
 			if(me.team != COLOR_SPECTATOR)
 				++myplace;
-			if(me.sv_entnum == player_localentnum - 1)
+			if(me.sv_entnum == desiredPlayerId)
 				break;
 		}
 		pl = players.sort_next;

Modified: branches/nexuiz-2.0/data/qcsrc/common/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/common/constants.qh	2009-06-06 15:11:32 UTC (rev 6884)
@@ -381,6 +381,13 @@
 float PROJECTILE_BULLET_GLOWING = 18;
 float PROJECTILE_CRYLINK_BOUNCING = 19;
 
+float SPECIES_HUMAN        =  0;
+float SPECIES_ROBOT_SHINY  =  1;
+float SPECIES_ALIEN        =  2;
+float SPECIES_ROBOT_RUSTY  =  3;
+float SPECIES_ANIMAL       =  4;
+float SPECIES_RESERVED     = 15;
+
 // Deathtypes (weapon deathtypes are the IT_* constants below)
 // NOTE: when adding death types, please add an explanation to Docs/spamlog.txt too.
 float DEATH_SPECIAL_START = 10000;

Modified: branches/nexuiz-2.0/data/qcsrc/common/util.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/util.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/common/util.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -1533,3 +1533,34 @@
 		// end of siftdown
 	}
 }
+
+void RandomSelection_Init()
+{
+	RandomSelection_totalweight = 0;
+	RandomSelection_chosen_ent = world;
+	RandomSelection_chosen_float = 0;
+	RandomSelection_chosen_string = string_null;
+	RandomSelection_best_priority = -1;
+}
+void RandomSelection_Add(entity e, float f, string s, float weight, float priority)
+{
+	if(priority > RandomSelection_best_priority)
+	{
+		RandomSelection_best_priority = priority;
+		RandomSelection_chosen_ent = e;
+		RandomSelection_chosen_float = f;
+		RandomSelection_chosen_string = s;
+		RandomSelection_totalweight = weight;
+	}
+	else if(priority == RandomSelection_best_priority)
+	{
+		RandomSelection_totalweight += weight;
+		if(random() * RandomSelection_totalweight <= weight)
+		{
+			RandomSelection_chosen_ent = e;
+			RandomSelection_chosen_float = f;
+			RandomSelection_chosen_string = s;
+		}
+	}
+}
+

Modified: branches/nexuiz-2.0/data/qcsrc/common/util.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/common/util.qh	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/common/util.qh	2009-06-06 15:11:32 UTC (rev 6884)
@@ -162,3 +162,11 @@
 vector decompressShotOrigin(float f);
 
 string records_reply, lsmaps_reply, maplist_reply; // cached replies
+
+float RandomSelection_totalweight;
+float RandomSelection_best_priority;
+entity RandomSelection_chosen_ent;
+float RandomSelection_chosen_float;
+string RandomSelection_chosen_string;
+void RandomSelection_Init();
+void RandomSelection_Add(entity e, float f, string s, float weight, float priority);

Modified: branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playermodel.c
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playermodel.c	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/menu/nexuiz/playermodel.c	2009-06-06 15:11:32 UTC (rev 6884)
@@ -80,6 +80,7 @@
 			me.currentModelTxtName = strzone(fn);
 			me.currentModelTitle = strzone(t);
 			me.currentModelDescription = "";
+			fgets(fh); // Skip species
 			while((l = fgets(fh)))
 			{
 				if(me.currentModelDescription != "")
@@ -141,6 +142,7 @@
 	me.currentSkin = stof(fgets(fh));
 	me.currentModel = strzone(fgets(fh));
 	me.currentModelDescription = "";
+	fgets(fh); // Skip species
 	while((l = fgets(fh)))
 	{
 		if(me.currentModelDescription != "")

Modified: branches/nexuiz-2.0/data/qcsrc/server/bots.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/bots.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/bots.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -1907,126 +1907,71 @@
 vector shotorg;
 vector shotdir;
 
-const float BOTSKINS = 19;
-const float BOTNAMES = 32;
-string bot_namefornumber(float r)
-{
-	if (r <  1) return "Thunderstorm";
-	if (r <  2) return "Darkness";
-	if (r <  3) return "Scorcher";
-	if (r <  4) return "Paranoia";
-	if (r <  5) return "Eureka";
-	if (r <  6) return "Mystery";
-	if (r <  7) return "Toxic";
-	if (r <  8) return "Dominion";
-	if (r <  9) return "Pegasus";
-	if (r < 10) return "Sensible";
-	if (r < 11) return "Gator";
-	if (r < 12) return "Kangaroo";
-	if (r < 13) return "Deadline";
-	if (r < 14) return "Frosty";
-	if (r < 15) return "Roadkill";
-	if (r < 16) return "Death";
-	if (r < 17) return "Panic";
-	if (r < 18) return "Discovery";
-	if (r < 19) return "Shadow";
-	if (r < 20) return "Acidic";
-	if (r < 21) return "Dominator";
-	if (r < 22) return "Hellfire";
-	if (r < 23) return "Necrotic";
-	if (r < 24) return "Newbie";
-	if (r < 25) return "Spellbinder";
-	if (r < 26) return "Lion";
-	if (r < 27) return "Controlled";
-	if (r < 28) return "Airhead";
-	if (r < 29) return "Delirium";
-	if (r < 30) return "Resurrection";
-	if (r < 31) return "Danger";
-	return "Flatline";
-};
-
-string bot_skinfornumber(float r)
-{
-	     if (r <  1) {self.playermodel = "models/player/carni.zym"          ;self.playerskin = "0";return "Carni"          ;}
-	else if (r <  2) {self.playermodel = "models/player/carni.zym"          ;self.playerskin = "1";return "Armored Carni"  ;}
-	else if (r <  3) {self.playermodel = "models/player/crash.zym"          ;self.playerskin = "0";return "Quark"          ;}
-	else if (r <  4) {self.playermodel = "models/player/grunt.zym"          ;self.playerskin = "0";return "Grunt"          ;}
-	else if (r <  5) {self.playermodel = "models/player/headhunter.zym"     ;self.playerskin = "0";return "HeadHunter"     ;}
-	else if (r <  6) {self.playermodel = "models/player/insurrectionist.zym";self.playerskin = "0";return "Insurrectionist";}
-	else if (r <  7) {self.playermodel = "models/player/lurk.zym"           ;self.playerskin = "0";return "Lurk"           ;}
-	else if (r <  8) {self.playermodel = "models/player/lurk.zym"           ;self.playerskin = "1";return "Reptile"        ;}
-	else if (r <  9) {self.playermodel = "models/player/lycanthrope.zym"    ;self.playerskin = "0";return "Lycanthrope"    ;}
-	else if (r < 10) {self.playermodel = "models/player/marine.zym"         ;self.playerskin = "0";return "Marine"         ;}
-	else if (r < 11) {self.playermodel = "models/player/nexus.zym"          ;self.playerskin = "0";return "Nexus"          ;}
-	else if (r < 12) {self.playermodel = "models/player/nexus.zym"          ;self.playerskin = "1";return "Mulder"         ;}
-	else if (r < 13) {self.playermodel = "models/player/nexus.zym"          ;self.playerskin = "2";return "Xolar"          ;}
-	else if (r < 14) {self.playermodel = "models/player/pyria.zym"          ;self.playerskin = "0";return "Pyria"          ;}
-	else if (r < 15) {self.playermodel = "models/player/shock.zym"          ;self.playerskin = "0";return "Shock"          ;}
-	else if (r < 16) {self.playermodel = "models/player/skadi.zym"          ;self.playerskin = "0";return "Skadi"          ;}
-	else if (r < 17) {self.playermodel = "models/player/specop.zym"         ;self.playerskin = "0";return "Specop"         ;}
-	else             {self.playermodel = "models/player/visitant.zym"       ;self.playerskin = "0";return "Fricka"         ;}
-};
-
+.float bot_team;
 void bot_setnameandstuff()
 {
+	local string readfile, s;
+	local float file, tokens;
+
+	local string bot_name, bot_model, bot_skin, bot_shirt, bot_pants;
 	local string name, prefix, suffix;
-	local float r, b, shirt, pants;
 
+	file = fopen(cvar_string("bot_config_file"), FILE_READ);
+
+	if(file < 0)
+		print(strcat("Error: Can not open the bot configuration file '",cvar_string("bot_config_file"),"'\n"));
+	else
+	{
+		RandomSelection_Init();
+		for(;;)
+		{
+			s = fgets(file);
+			if(!s)
+				break;
+			if(substring(s, 0, 2) == "//")
+				continue;
+			if(substring(s, 0, 1) == "#")
+				continue;
+			RandomSelection_Add(world, 0, s, 1, 0);
+			readfile = RandomSelection_chosen_string;
+		}
+		fclose(file);
+	}
+
+	tokens = tokenizebyseparator(readfile, "\t");
+	if(argv(0) != "") bot_name = argv(0);
+	else bot_name = "Bot";
+
+	if(argv(1) != "") bot_model = argv(1);
+	else bot_model = "marine";
+
+	if(argv(2) != "") bot_skin = argv(2);
+	else bot_skin = "0";
+
+	if(argv(3) != "" && stof(argv(3)) >= 0) bot_shirt = argv(3);
+	else bot_shirt = ftos(floor(random() * 15));
+
+	if(argv(4) != "" && stof(argv(4)) >= 0) bot_pants = argv(4);
+	else bot_pants = ftos(floor(random() * 15));
+
+	self.bot_team = stof(argv(5));
 	prefix = cvar_string("bot_prefix");
 	suffix = cvar_string("bot_suffix");
 
 	// this is really only a default, JoinBestTeam is called later
-	pants = floor(random() * 15);
-	shirt = floor(random() * 15);
-	//shirt = pants;
-	setcolor(self, shirt * 16 + pants);
+	setcolor(self, stof(bot_shirt) * 16 + stof(bot_pants));
 	self.bot_preferredcolors = self.clientcolors;
 
-	// now pick a name...
-
+	// pick the name
 	if (cvar("bot_usemodelnames"))
-	{
-		// first see if all skins are taken
-		b = 0;
-		do
-		{
-			name = bot_skinfornumber(b);
-			b = b + 1;
-		}
-		while (b < BOTSKINS && find(world, netname, name));
-
-		// randomly pick a skin, if it's taken either repeat until we find one,
-		// or give up if we already know all skins are taken
-		do
-		{
-			r = floor(random() * BOTSKINS);
-			name = bot_skinfornumber(r);
-		}
-		while (b < BOTSKINS && find(world, netname, name));
-	}
+		name = bot_model;
 	else
-	{
-		// first see if all names are taken
-		b = 0;
-		do
-		{
-			name = bot_namefornumber(b);
-			b = b + 1;
-		}
-		while (b < BOTNAMES && find(world, netname, name));
+		name = bot_name;
 
-		// randomly pick a name, if it's taken either repeat until we find one,
-		// or give up if we already know all names are taken
-		do
-		{
-			r = floor(random() * BOTNAMES);
-			name = bot_namefornumber(r);
-		}
-		while (b < BOTNAMES && find(world, netname, name));
+	// pick the model and skin
+	self.playermodel = strzone(strcat("models/player/", bot_model, ".zym"));
+	self.playerskin = strzone(bot_skin);
 
-		// randomly pick a skin
-		bot_skinfornumber(floor(random() * BOTSKINS));
-	}
  	if(!cvar("g_campaign"))
  		self.netname = self.netname_freeme = strzone(strcat(prefix, name, suffix));
  	else
@@ -2523,7 +2468,17 @@
 	self.lag_func = bot_lagfunc;
 	self.isbot = TRUE;
 	self.createdtime = self.nextthink;
-	JoinBestTeam(self, FALSE, TRUE);
+
+	switch(self.bot_team)
+	{
+		case 1: self.team = COLOR_TEAM1;
+		case 2:	self.team = COLOR_TEAM2;
+		case 3:	self.team = COLOR_TEAM3;
+		case 4:	self.team = COLOR_TEAM4;
+		default:
+			JoinBestTeam(self, FALSE, TRUE);
+	}
+
 	havocbot_setupbot();
 	self.bot_mouseskill=random()-0.5;
 	self.bot_thinkskill=random()-0.5;

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -261,7 +261,7 @@
 
 	RandomSelection_Init();
 	for(spot = firstspot; spot; spot = spot.chain)
-		RandomSelection_Add(spot, 0, pow(bound(lower, spot.SPAWNPOINT_SCORE, upper), exponent) * spot.cnt, spot.SPAWNPOINT_SCORE >= lower);
+		RandomSelection_Add(spot, 0, string_null, pow(bound(lower, spot.SPAWNPOINT_SCORE, upper), exponent) * spot.cnt, spot.SPAWNPOINT_SCORE >= lower);
 
 	return RandomSelection_chosen_ent;
 }
@@ -610,7 +610,7 @@
 void FixPlayermodel()
 {
 	local string defaultmodel;
-	local float defaultskin;
+	local float defaultskin, chmdl, oldskin;
 	local vector m1, m2;
 
 	defaultmodel = "";
@@ -649,6 +649,7 @@
 		}
 
 		self.skin = defaultskin;
+		self.species = player_getspecies();
 	} else {
 		if (self.playermodel != self.model)
 		{
@@ -657,9 +658,14 @@
 			m2 = self.maxs;
 			setmodel_lod (self, self.playermodel);
 			setsize (self, m1, m2);
+			chmdl = TRUE;
 		}
 
+		oldskin = self.skin;
 		self.skin = RestrictSkin(stof(self.playerskin));
+
+		if(chmdl || oldskin != self.skin)
+			self.species = player_getspecies(); // model or skin has changed
 	}
 
 	if(!teams_matter)

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -45,6 +45,7 @@
 	self.armortype = oldself.armortype;
 	self.model = oldself.model;
 	self.modelindex = oldself.modelindex;
+	self.species = oldself.species;
 	self.movetype = oldself.movetype;
 	self.nextthink = oldself.nextthink;
 	self.skin = oldself.skin;
@@ -68,6 +69,58 @@
 	self = oldself;
 }
 
+float player_getspecies()
+{
+	local float glob, i, j, fh, len, s, sk;
+	local string fn, l;
+
+	s = -1;
+
+	glob = search_begin("models/player/*.txt", TRUE, TRUE);
+	if(glob < 0)
+		return s;
+	for(j = 0; j <= 1; ++j)
+	{
+		for(i = 0; i < search_getsize(glob); ++i)
+		{
+			fn = search_getfilename(glob, i);
+			fh = fopen(fn, FILE_READ);
+			if(fh < 0)
+				continue;
+			fgets(fh); fgets(fh);
+			sk = stof(fgets(fh));
+			if(sk == (j ? 0 : self.skin)) // 2nd pass skips the skin test
+			if(fgets(fh) == self.model)
+			{
+				l = fgets(fh);
+				len = tokenize_console(l);
+				if (len != 2)
+					break;
+				if (argv(0) != "species")
+					break;
+				switch(argv(1))
+				{
+					case "human":       s = SPECIES_HUMAN;       break;
+					case "alien":       s = SPECIES_ALIEN;       break;
+					case "robot_shiny": s = SPECIES_ROBOT_SHINY; break;
+					case "robot_rusty": s = SPECIES_ROBOT_RUSTY; break;
+					case "animal":      s = SPECIES_ANIMAL;      break;
+					case "reserved":    s = SPECIES_RESERVED;    break;
+				}
+			}
+			fclose(fh);
+		}
+		if (s >= 0)
+			break;
+	}
+	search_end(glob);
+
+	if (s < 0)
+		s = SPECIES_HUMAN;
+
+	return s;
+}
+
 void player_setupanimsformodel()
 {
 	local string animfilename;

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weapons.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -428,7 +428,7 @@
 	RandomSelection_Init();
 	for(j = WEP_FIRST; j <= WEP_LAST; ++j)
 		if(NixNex_CanChooseWeapon(j))
-			RandomSelection_Add(world, j, 1, (j != nixnex_weapon));
+			RandomSelection_Add(world, j, string_null, 1, (j != nixnex_weapon));
 	nixnex_nextweapon = RandomSelection_chosen_float;
 }
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_weaponsystem.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -108,7 +108,7 @@
 	float nudge = 1; // added to traceline target and subtracted from result
 	local vector trueaimpoint;
 	local float oldsolid;
-	vector vecs;
+	vector vecs, dv;
 	oldsolid = ent.dphitcontentsmask;
 	ent.dphitcontentsmask = DPCONTENTS_SOLID | DPCONTENTS_BODY | DPCONTENTS_CORPSE;
 	traceline(ent.origin + ent.view_ofs, ent.origin + ent.view_ofs + v_forward * MAX_SHOT_DISTANCE, MOVE_NOMONSTERS, ent);
@@ -127,8 +127,13 @@
 	if(debug_shotorg != '0 0 0')
 		vecs = debug_shotorg;
 	
-	w_shotorg = ent.origin + ent.view_ofs + v_right * vecs_y + v_up * vecs_z;
+	dv = v_right * vecs_y + v_up * vecs_z;
+	w_shotorg = ent.origin + ent.view_ofs + dv;
 
+	// move the vecs sideways as much as requested if possible
+	traceline(ent.origin + ent.view_ofs, w_shotorg + normalize(dv) * nudge, MOVE_NORMAL, ent);
+	w_shotorg = trace_endpos - normalize(dv) * nudge;
+
 	// now move the shotorg forward as much as requested if possible
 	traceline(w_shotorg, w_shotorg + v_forward * (vecs_x + nudge), MOVE_NORMAL, ent);
 	w_shotorg = trace_endpos - v_forward * nudge;

Modified: branches/nexuiz-2.0/data/qcsrc/server/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2009-06-06 15:11:32 UTC (rev 6884)
@@ -1,4 +1,4 @@
-string CVAR_CHECK_DEFAULT = "ca174b42ef38020187602cfda6d8ef43";
+string CVAR_CHECK_DEFAULT = "2374fb15eacd4470860923b3ccddc0ad";
 string CVAR_CHECK_WEAPONS = "c5b3e579a14c45d555550b08f203a607";
 
 float	FALSE					= 0;

Modified: branches/nexuiz-2.0/data/qcsrc/server/defs.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2009-06-06 15:11:32 UTC (rev 6884)
@@ -167,6 +167,8 @@
 .string playermodel;
 .string playerskin;
 
+.float species;
+
 .float	respawntime;
 .float	respawntimejitter;
 //.float	chasecam;

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_violence.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_violence.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_violence.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -20,9 +20,10 @@
 	e = spawn();
 	e.classname = "gibsplash";
 	e.cnt = amount;
-	e.state = type;
+	e.state = type; // should stay smaller than 15
 	if(sv_gentle)
 		e.state |= 0x80; // "force gentle" bit
+	e.state |= 8 * self.species; // gib type, ranges from 0 to 15
 	setorigin(e, org);
 	setsize(e, mi, ma);
 	e.velocity = dir;

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -2285,7 +2285,7 @@
 
 	RandomSelection_Init();
 	for(i = 0; i < mapvote_count_real; ++i) if(mapvote_maps[i] != "")
-		RandomSelection_Add(world, i, 1, mapvote_votes[i]);
+		RandomSelection_Add(world, i, string_null, 1, mapvote_votes[i]);
 	firstPlace = RandomSelection_chosen_float;
 	firstPlaceVotes = RandomSelection_best_priority;
 	//dprint("First place: ", ftos(firstPlace), "\n");
@@ -2294,7 +2294,7 @@
 	RandomSelection_Init();
 	for(i = 0; i < mapvote_count_real; ++i) if(mapvote_maps[i] != "")
 		if(i != firstPlace)
-			RandomSelection_Add(world, i, 1, mapvote_votes[i]);
+			RandomSelection_Add(world, i, string_null, 1, mapvote_votes[i]);
 	secondPlace = RandomSelection_chosen_float;
 	secondPlaceVotes = RandomSelection_best_priority;
 	//dprint("Second place: ", ftos(secondPlace), "\n");

Modified: branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -7,37 +7,6 @@
 void() spawnpoint_use;
 string ColoredTeamName(float t);
 
-float RandomSelection_totalweight;
-float RandomSelection_best_priority;
-entity RandomSelection_chosen_ent;
-float RandomSelection_chosen_float;
-void RandomSelection_Init()
-{
-	RandomSelection_totalweight = 0;
-	RandomSelection_chosen_ent = world;
-	RandomSelection_chosen_float = 0;
-	RandomSelection_best_priority = -1;
-}
-void RandomSelection_Add(entity e, float f, float weight, float priority)
-{
-	if(priority > RandomSelection_best_priority)
-	{
-		RandomSelection_best_priority = priority;
-		RandomSelection_chosen_ent = e;
-		RandomSelection_chosen_float = f;
-		RandomSelection_totalweight = weight;
-	}
-	else if(priority == RandomSelection_best_priority)
-	{
-		RandomSelection_totalweight += weight;
-		if(random() * RandomSelection_totalweight <= weight)
-		{
-			RandomSelection_chosen_ent = e;
-			RandomSelection_chosen_float = f;
-		}
-	}
-}
-
 float DistributeEvenly_amount;
 float DistributeEvenly_totalweight;
 void DistributeEvenly_Init(float amount, float totalweight)

Modified: branches/nexuiz-2.0/data/qcsrc/server/runematch.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/runematch.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/runematch.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -59,7 +59,7 @@
 
 	for(e = world; (e = find(e, classname, "runematch_spawn_point")); )
 		if(e.owner == world)
-			RandomSelection_Add(e, 0, e.cnt, 0);
+			RandomSelection_Add(e, 0, string_null, e.cnt, 0);
 
 	return RandomSelection_chosen_ent;
 }
@@ -460,14 +460,14 @@
 		RandomSelection_Init();
 		for(rn = RUNE_FIRST; rn <= RUNE_LAST; rn *= 2)
 			if not(runes_used & rn)
-				RandomSelection_Add(world, rn, 1, 1);
+				RandomSelection_Add(world, rn, string_null, 1, 1);
 		rn = RandomSelection_chosen_float;
 
 		RandomSelection_Init();
 		for(cs = CURSE_FIRST; cs <= CURSE_LAST; cs *= 2)
 			if not(curses_used & cs)
 				if not(prevent_same && cs == RuneMatchesCurse(rn, cs))
-					RandomSelection_Add(world, cs, 1, 1);
+					RandomSelection_Add(world, cs, string_null, 1, 1);
 		cs = RandomSelection_chosen_float;
 
 		if(!rn || !cs)

Modified: branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/sv_main.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -200,7 +200,7 @@
 	{
 		RandomSelection_Init();
 		for(self = world; (self = find(self, classname, "player")); )
-			RandomSelection_Add(self, 0, 1, 0);
+			RandomSelection_Add(self, 0, string_null, 1, 0);
 		self = RandomSelection_chosen_ent;
 		SelectSpawnPoint(0);
 	}

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_items.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_items.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -364,6 +364,8 @@
 	if (self.owner == other)
 		return;
 
+	pointparticles(particleeffectnum("item_pickup"), self.origin, '0 0 0', 1);
+
 	if(!Item_GiveTo(self, other))
 		return;
 
@@ -379,7 +381,7 @@
 		{
 			RandomSelection_Init();
 			for(head = world; (head = findfloat(head, team, self.team)); ) if(head.flags & FL_ITEM)
-				RandomSelection_Add(head, 0, head.cnt, 0);
+				RandomSelection_Add(head, 0, string_null, head.cnt, 0);
 			e = RandomSelection_chosen_ent;
 		}
 		else
@@ -398,7 +400,7 @@
 		dprint("Initializing item team ", ftos(self.team), "\n");
 		RandomSelection_Init();
 		for(head = world; (head = findfloat(head, team, self.team)); ) if(head.flags & FL_ITEM)
-			RandomSelection_Add(head, 0, head.cnt, 0);
+			RandomSelection_Add(head, 0, string_null, head.cnt, 0);
 		e = RandomSelection_chosen_ent;
 		e.state = 0;
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc	2009-06-06 12:37:52 UTC (rev 6883)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_teleporters.qc	2009-06-06 15:11:32 UTC (rev 6884)
@@ -139,9 +139,9 @@
 		for(e = world; (e = find(e, targetname, self.target)); )
 		{
 			if(e.cnt)
-				RandomSelection_Add(e, 0, e.cnt, 0);
+				RandomSelection_Add(e, 0, string_null, e.cnt, 0);
 			else
-				RandomSelection_Add(e, 0, 1, 0);
+				RandomSelection_Add(e, 0, string_null, 1, 0);
 		}
 		e = RandomSelection_chosen_ent;
 	}



More information about the nexuiz-commits mailing list