r2285 - branches/nexuiz-2.0/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Apr 3 17:31:57 EDT 2007


Author: div0
Date: 2007-04-03 17:31:56 -0400 (Tue, 03 Apr 2007)
New Revision: 2285

Modified:
   branches/nexuiz-2.0/data/qcsrc/server/arena.qc
   branches/nexuiz-2.0/data/qcsrc/server/builtins.qh
   branches/nexuiz-2.0/data/qcsrc/server/campaign.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/clientcommands.qc
   branches/nexuiz-2.0/data/qcsrc/server/constants.qh
   branches/nexuiz-2.0/data/qcsrc/server/ctf.qc
   branches/nexuiz-2.0/data/qcsrc/server/defs.qh
   branches/nexuiz-2.0/data/qcsrc/server/domination.qc
   branches/nexuiz-2.0/data/qcsrc/server/extensions.qh
   branches/nexuiz-2.0/data/qcsrc/server/g_damage.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/t_quake.qc
   branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
   branches/nexuiz-2.0/data/qcsrc/server/w_rocketlauncher.qc
Log:
strcat cleanups;
extensions.qh now from dpmod;
flood control;
optional chat name coloring


Modified: branches/nexuiz-2.0/data/qcsrc/server/arena.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/arena.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/arena.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -180,7 +180,7 @@
 		{
 			self = spawnqueue_first;
 
-			bprint (strcat("^4", self.netname, "^4 is the next challenger\n"));
+			bprint ("^4", self.netname, "^4 is the next challenger\n");
 
 			Spawnqueue_Remove(self);
 			Spawnqueue_Mark(self);

Modified: branches/nexuiz-2.0/data/qcsrc/server/builtins.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/builtins.qh	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/builtins.qh	2007-04-03 21:31:56 UTC (rev 2285)
@@ -63,5 +63,3 @@
 string	precache_model2 (string s)							= #75;
 string	precache_sound2 (string s)							= #76;
 string	precache_file2 (string s)							= #77;
-entity(.float fld, float match) findchainflags						= #450;
-entity(entity start, .float fld, float match) findflags					= #449;

Modified: branches/nexuiz-2.0/data/qcsrc/server/campaign.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/campaign.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/campaign.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -74,8 +74,8 @@
 	{
 		while((l = fgets(fh)))
 		{
-			cvarname = strcat(cvarname);
-			contents = strcat(contents);
+			cvarname = strcat1(cvarname);
+			contents = strcat1(contents);
 			len = tokenize(l);
 			if(len != 3)
 				continue;

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_client.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -295,9 +295,9 @@
 	DistributeFragsAmongTeam(self, self.team, 1);
 
 	if(self.frags <= 0 && self.frags > -666 && cvar("g_lms") && self.killcount != -666)
-		bprint (strcat("^4", self.netname, "^4 has no more lives left\n"));
+		bprint ("^4", self.netname, "^4 has no more lives left\n");
 	else if(self.killcount != -666)
-		bprint (strcat("^4", self.netname, "^4 is spectating now\n"));
+		bprint ("^4", self.netname, "^4 is spectating now\n");
 
 	self.classname = "observer";
 	self.health = -666;
@@ -669,7 +669,7 @@
 	stuffcmd(e, strcat("set cl_movement_friction_on_land ", ftos(cvar("sv_friction_on_land")), "\n"));
 	stuffcmd(e, strcat("set cl_movement_airaccel_qw ", ftos(cvar("sv_airaccel_qw")), "\n"));
 	stuffcmd(e, strcat("set cl_movement_airaccel_sideways_friction ", ftos(cvar("sv_airaccel_sideways_friction")), "\n"));
-	stuffcmd(e, strcat("cl_movement_edgefriction 1\n"));
+	stuffcmd(e, "cl_movement_edgefriction 1\n");
 }
 
 /*
@@ -765,7 +765,7 @@
 		stuffcmd(self, strcat("set teamplay ", ftos(t), "\n"));
 	}
 	else
-		stuffcmd(self, strcat("set teamplay 0\n"));
+		stuffcmd(self, "set teamplay 0\n");
 
 	if(cvar("g_lms"))
 	{
@@ -1326,7 +1326,7 @@
 			campaign_bots_may_start = 1;
 		PutClientInServer();
 		if(!(self.flags & FL_NOTARGET))
-			bprint (strcat("^4", self.netname, "^4 is playing now\n"));
+			bprint ("^4", self.netname, "^4 is playing now\n");
 		centerprint(self,"");
 		return;
 	} else {
@@ -1346,6 +1346,10 @@
 .float vote_nagtime;
 void PlayerPreThink (void)
 {
+	if(strlen(self.netname) > 0)
+		if(substring(self.netname, strlen(self.netname) - 1, 1) == "^")
+			self.netname = strzone(strcat(substring(self.netname, 0, strlen(self.netname) - 1), " ")); // BROKEN COLORS can be annoying!
+
 	// version nagging
 	if(self.version_nagtime)
 		if(self.cvar_g_nexuizversion)
@@ -1372,7 +1376,7 @@
 		local vector m1, m2;
 
 //		if(self.netname == "Wazat")
-//			bprint(strcat(self.classname, "\n"));
+//			bprint(self.classname, "\n");
 
 		CheckRules_Player();
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/cl_player.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -488,22 +488,16 @@
 			if(save != UpdateSelectedPlayer_countvalue(self.selected_player_count))
 			{
 				string namestr, healthstr;
+				namestr = playername(selected);
 				if(teams_matter)
 				{
-					namestr = decolorize(selected.netname);
 					healthstr = ftos(floor(selected.health));
 					if(self.team == selected.team)
 					{
-						namestr = strcat(Team_ColorCode(selected.team), namestr, " (", healthstr, "%)");
+						namestr = strcat(namestr, " (", healthstr, "%)");
 						self.selected_player_display_needs_update = TRUE;
 					}
-					else
-						namestr = strcat(Team_ColorCode(selected.team), namestr);
 				}
-				else
-				{
-					namestr = selected.netname;
-				}
 				centerprint_atprio(self, CENTERPRIO_POINT, namestr);
 			}
 		}
@@ -514,7 +508,6 @@
 			self.selected_player_time = time;
 			self.selected_player_count = 0;
 			self.selected_player_display_needs_update = FALSE;
-			// dprint("Selected: ", selected.netname, "\n");
 		}
 	}
 	else

Modified: branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/clientcommands.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -3,11 +3,18 @@
 void(entity e) DropFlag;
 string MapVote_Suggest(string m);
 
+.float floodcontrol_chat;
+.float floodcontrol_team;
 void Say(entity source, float teamsay, string msgin)
 {
-	string msgstr, colorstr, cmsgstr;
+	string msgstr, colorstr, cmsgstr, namestr;
+	float flood;
 	entity head;
 
+	if(!teamsay)
+		if(substring(msgin, 0, 1) == " ")
+			msgin = substring(msgin, 1, strlen(msgin) - 1); // work around DP say bug (say_team does not have this!)
+
 	msgin = formatmessage(msgin);
 
 	if(msgin == "")
@@ -24,6 +31,8 @@
 	if(source.classname != "player") // observers can't
 		teamsay = FALSE;
 
+	/*
+	 * using bprint solves this... me stupid
 	// how can we prevent the message from appearing in a listen server?
 	// for now, just give "say" back and only handle say_team
 	if(!teamsay)
@@ -31,17 +40,68 @@
 		clientcommand(self, strcat("say ", msgin));
 		return;
 	}
+	*/
 
+	if(cvar("g_chat_teamcolors"))
+		namestr = playername(source);
+	else
+		namestr = source.netname;
 	if(teamsay)
 	{
-		msgstr = strzone(strcat("\{1}\{13}", colorstr, "(^3", source.netname, colorstr, ") ^7", msgin, "\n"));
-		cmsgstr = strcat(colorstr, "(^3", source.netname, colorstr, ")\n^7", wordwrap(msgin, 50));
+		msgstr = strzone(strcat("\{1}\{13}", colorstr, "(^3", namestr, colorstr, ") ^7", msgin, "\n"));
+		cmsgstr = strcat(colorstr, "(^3", namestr, colorstr, ")\n^7", wordwrap(msgin, 50));
 	}
 	else
-		msgstr = strzone(strcat("\{1}^3", source.netname, "^7: ", msgin, "\n"));
+		msgstr = strzone(strcat("\{1}^3", namestr, "^7: ", msgin, "\n"));
 
-	if(teamsay)
+	// FLOOD CONTROL
+	flood = 0;
 	{
+		float flood_spl;
+		float flood_burst;
+		float flood_lmax;
+		var .float flood_field;
+		float lines;
+		if(teamsay)
+		{
+			flood_spl = cvar("g_chat_flood_spl_team");
+			flood_burst = cvar("g_chat_flood_burst_team");
+			flood_lmax = cvar("g_chat_flood_lmax_team");
+			flood_field = floodcontrol_team;
+		}
+		else
+		{
+			flood_spl = cvar("g_chat_flood_spl");
+			flood_burst = cvar("g_chat_flood_burst");
+			flood_lmax = cvar("g_chat_flood_lmax");
+			flood_field = floodcontrol_chat;
+		}
+		flood_burst = max(0, flood_burst - 1);
+		// to match explanation in default.cfg, a value of 3 must allow three-line bursts and not four!
+		lines = ceil(strlennocol(msgstr) / 75);
+		if(flood_lmax && lines > flood_lmax)
+			flood = 2;
+		else if(time >= self.flood_field)
+			self.flood_field = max(time - flood_burst * flood_spl, self.flood_field) + lines * flood_spl;
+		else
+			flood = 1;
+	}
+
+	if(flood)
+	{
+		if(cvar("g_chat_flood_notify_flooder"))
+		{
+			if(flood == 1)
+				sprint(self, strcat("^3FLOOD CONTROL: ^7wait ^1", ftos(self.flood_field - time), "^3 seconds\n"));
+			else if(flood == 2)
+				sprint(self, "^3FLOOD CONTROL: ^7message too long\n");
+		}
+		else
+			sprint(self, msgstr);
+		ServerConsoleEcho(strcat("NOTE: ", playername(self), "^7 is flooding."), TRUE);
+	}
+	else if(teamsay)
+	{
 		FOR_EACH_REALPLAYER(head)
 		{
 			if(head.team == source.team)
@@ -106,7 +166,7 @@
 						sprint(self, "^1Your vote is empty. See help for more info.\n");
 					} else if(time < self.vote_next) {
 						sprint(self, strcat("^1You have to wait ^2", ftos(self.vote_next - time), "^1 seconds before you can again call a vote.\n"));
-					} else if(VoteAllowed(strcat(argv(2)))) { // strcat seems to be necessary
+					} else if(VoteAllowed(strcat1(argv(2)))) { // strcat seems to be necessary
 						if(!ValidateMap(vote))
 							return;
 						votecalled = TRUE;
@@ -120,7 +180,7 @@
 						votefinished = time + cvar("sv_vote_timeout");
 						votecaller.vote_vote = 1; // of course you vote yes
 						votecaller.vote_next = time + cvar("sv_vote_wait");
-						bprint(strcat("\{1}^2* ^3", votecaller.netname, "^2 calls a vote for ^1", votecalledvote, "\n"));
+						bprint("\{1}^2* ^3", votecaller.netname, "^2 calls a vote for ^1", votecalledvote, "\n");
 						VoteCount(); // needed if you are the only one
 					} else {
 						sprint(self, "^1This vote is not ok. See help for more info.\n");
@@ -149,7 +209,7 @@
 					votefinished = time + cvar("sv_vote_timeout");
 					votecaller.vote_vote = 1; // of course you vote yes
 					votecaller.vote_next = time + cvar("sv_vote_wait");
-					bprint(strcat("\{1}^2* ^3", votecaller.netname, "^2 calls a vote to become ^3master^2.\n"));
+					bprint("\{1}^2* ^3", votecaller.netname, "^2 calls a vote to become ^3master^2.\n");
 					VoteCount(); // needed if you are the only one
 				}
 			} else {
@@ -163,7 +223,7 @@
 					self.vote_master = (masterpwd == argv(3));
 					if(self.vote_master) {
 						ServerConsoleEcho(strcat("Accepted master login from ", self.netname), TRUE);
-						bprint(strcat("\{1}^2* ^3", self.netname, "^2 logged in as ^3master^2\n"));
+						bprint("\{1}^2* ^3", self.netname, "^2 logged in as ^3master^2\n");
 					}
 					else
 						ServerConsoleEcho(strcat("REJECTED master login from ", self.netname), TRUE);
@@ -175,14 +235,14 @@
 				dovote = VoteParse();
 				if(dovote == "") {
 					sprint(self, "^1Your command was empty. See help for more info.\n");
-				} else if(VoteAllowed(strcat(argv(2)))) { // strcat seems to be necessary
+				} else if(VoteAllowed(strcat1(argv(2)))) { // strcat seems to be necessary
 					if(!ValidateMap(dovote))
 						return;
 					// remap chmap to gotomap (forces intermission)
 					if(strlen(dovote) >= 6)
 						if(substring(dovote, 0, 6) == "chmap ")
 							vote = strcat("gotomap ", substring(dovote, 6, strlen(dovote) - 6));
-					bprint("\{1}^2* ^3", strcat(self.netname, "^2 used his ^3master^2 status to do \"^2", dovote, "^2\".\n"));
+					bprint("\{1}^2* ^3", self.netname, "^2 used his ^3master^2 status to do \"^2", dovote, "^2\".\n");
 					localcmd(strcat(dovote, "\n"));
 				} else {
 					sprint(self, "^1This command is not ok. See help for more info.\n");
@@ -267,7 +327,7 @@
 		{
 			self.classname = "player";
 			self.frags = 0;
-			bprint (strcat("^4", self.netname, "^4 is playing now\n"));
+			bprint ("^4", self.netname, "^4 is playing now\n");
 			PutClientInServer();
 		}
 	} else if( argv(0) == "selectteam" ) {
@@ -453,7 +513,7 @@
 }
 
 void VoteAccept() {
-	bprint(strcat("\{1}^2* ^3", votecaller.netname, "^2's vote for ^1", votecalledvote, "^2 was accepted\n"));
+	bprint("\{1}^2* ^3", votecaller.netname, "^2's vote for ^1", votecalledvote, "^2 was accepted\n");
 	if(votecalledmaster)
 	{
 		votecaller.vote_master = 1;
@@ -465,17 +525,17 @@
 }
 
 void VoteReject() {
-	bprint(strcat("\{1}^2* ^3", votecaller.netname, "^2's vote for ^1", votecalledvote, "^2 was rejected\n"));
+	bprint("\{1}^2* ^3", votecaller.netname, "^2's vote for ^1", votecalledvote, "^2 was rejected\n");
 	VoteReset();
 }
 
 void VoteTimeout() {
-	bprint(strcat("\{1}^2* ^3", votecaller.netname, "^2's vote for ^1", votecalledvote, "^2 timed out\n"));
+	bprint("\{1}^2* ^3", votecaller.netname, "^2's vote for ^1", votecalledvote, "^2 timed out\n");
 	VoteReset();
 }
 
 void VoteStop(entity stopper) {
-	bprint(strcat("\{1}^2* ^3", stopper.netname, "^2 stopped ^3", votecaller.netname, "^2's vote\n"));
+	bprint("\{1}^2* ^3", stopper.netname, "^2 stopped ^3", votecaller.netname, "^2's vote\n");
 	if(stopper == votecaller) {
 		// no wait for next vote so you can correct your vote
 		votecaller.vote_next = 0;

Modified: branches/nexuiz-2.0/data/qcsrc/server/constants.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/constants.qh	2007-04-03 21:31:56 UTC (rev 2285)
@@ -30,7 +30,7 @@
 float	MOVETYPE_NOCLIP				= 8;
 float	MOVETYPE_FLYMISSILE			= 9;
 float	MOVETYPE_BOUNCE				= 10;
-//float	MOVETYPE_BOUNCEMISSILE	= 11;	// Like bounce but doesn't lose speed on bouncing
+float	MOVETYPE_BOUNCEMISSILE	= 11;	// Like bounce but doesn't lose speed on bouncing
 //float	MOVETYPE_FOLLOW				= 12;	// 'Attaches' the entity to its aim_ent
 
 float	SOLID_NOT				= 0;
@@ -127,8 +127,6 @@
 float	EF_MUZZLEFLASH				= 2;
 float	EF_BRIGHTLIGHT				= 4;
 float	EF_DIMLIGHT				= 8;
-float	EF_NOSHADOW				= 4096;
-float	EF_DOUBLESIDED				= 32768;
 
 float	MSG_BROADCAST				= 0;
 float	MSG_ONE					= 1;

Modified: branches/nexuiz-2.0/data/qcsrc/server/ctf.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/ctf.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/ctf.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -91,7 +91,7 @@
 		dprint("FLAG: drop - owner is not carrying this flag??\n");
 		return;
 	}
-	bprint(strcat(p.netname, "^7 lost the ", e.netname, "\n"));
+	bprint(p.netname, "^7 lost the ", e.netname, "\n");
 	LogCTF("dropped", p.team, p.flagcarried);
 
 	setattachment(e, world, "");
@@ -150,7 +150,7 @@
 		setattachment(self, world, "");
 		if (time > self.pain_finished)
 		{
-			bprint(strcat("The ", self.netname, " has returned to base\n"));
+			bprint("The ", self.netname, " has returned to base\n");
 			sound (e, CHAN_AUTO, self.noise3, 1, ATTN_NONE);
 			LogCTF("returned", self.team, world);
 			ReturnFlag(self);

Modified: branches/nexuiz-2.0/data/qcsrc/server/defs.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/defs.qh	2007-04-03 21:31:56 UTC (rev 2285)
@@ -1,4 +1,3 @@
-
 // Globals
 
 entity	activator;
@@ -167,7 +166,6 @@
 void(float to, string s)	WriteString	= #58;
 void(float to, entity s)	WriteEntity	= #59;
 .vector dest1, dest2;
-void(entity clent) dropclient = #453;
 
 float gameover;
 float intermission_running;

Modified: branches/nexuiz-2.0/data/qcsrc/server/domination.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/domination.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/domination.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -55,7 +55,7 @@
 	//bprint(self.message);
 	//bprint("\n");
 
-	bprint(strcat("^3", head.netname, "^3", self.message, "\n"));
+	bprint("^3", head.netname, "^3", self.message, "\n");
 
 	if (head.noise != "")
 		sound(self, CHAN_BODY, head.noise, 1, ATTN_NORM);

Modified: branches/nexuiz-2.0/data/qcsrc/server/extensions.qh
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/extensions.qh	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/extensions.qh	2007-04-03 21:31:56 UTC (rev 2285)
@@ -1,13 +1,22 @@
 
 //DarkPlaces supported extension list, draft version 1.04
 
+//things that don't have extensions yet:
+.float disableclientprediction;
+
+//definitions that id Software left out:
+//these are passed as the 'nomonsters' parameter to traceline/tracebox (yes really this was supported in all quake engines, nomonsters is misnamed)
+float MOVE_NORMAL = 0; // same as FALSE
+float MOVE_NOMONSTERS = 1; // same as TRUE
+float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
+
 //checkextension function
 //idea: expected by almost everyone
 //darkplaces implementation: LordHavoc
 float(string s) checkextension = #99;
 //description:
 //check if (cvar("pr_checkextension")) before calling this, this is the only
-//guarenteed extension to be present in the extension system, it allows you
+//guaranteed extension to be present in the extension system, it allows you
 //to check if an extension is available, by name, to check for an extension
 //use code like this:
 //// (it is recommended this code be placed in worldspawn or a worldspawn called function somewhere)
@@ -16,39 +25,31 @@
 //	ext_setcolor = TRUE;
 //from then on you can check ext_setcolor to know if that extension is available
 
-//DP_QC_CVAR_STRING
-//idea: Paul Timofeyev
-//DarkPlaces implementation: Paul Timofeyev, LordHavoc
-//builtin definitions:
-string(string s) cvar_string = #448;
+//BX_WAL_SUPPORT
+//idea: id Software
+//darkplaces implementation: LordHavoc
 //description:
-//returns the value of a cvar, as a tempstring.
+//indicates the engine supports .wal textures for filenames in the textures/ directory
+//(note: DarkPlaces has supported this since 2001 or 2002, but did not advertise it as an extension, then I noticed Betwix was advertising it and added the extension accordingly)
 
-//DP_QC_TRACE_MOVETYPES
-//idea: LordHavoc
-//darkplaces implementation: id Software
-//constant definitions:
-float MOVE_NORMAL = 0; // same as FALSE
-float MOVE_NOMONSTERS = 1; // same as TRUE
-float MOVE_MISSILE = 2; // save as movement with .movetype == MOVETYPE_FLYMISSILE
-//description:
-//this extension does nothing (do not check for it), it only documents existing MOVE_ values that were never defined in defs.qc, these are passed as the 'nomonsters' parameter to traceline/tracebox
-
-//DP_QC_TRACE_MOVETYPE_WORLDONLY
-//idea: LordHavoc
+//DP_BUTTONCHAT
+//idea: Vermeulen
 //darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_WORLDONLY = 3;
+//field definitions:
+.float buttonchat;
 //description:
-//allows traces to hit only world (see DP_QC_TRACE_MOVETYPES for how to use this)
+//true if the player is currently chatting (in messagemode, menus or console)
 
-//DP_QC_TRACE_MOVETYPE_HITMODEL
-//idea: LordHavoc
+//DP_BUTTONUSE
+//idea: id Software
 //darkplaces implementation: LordHavoc
-//constant definitions:
-float MOVE_HITMODEL = 4;
+//field definitions:
+.float buttonuse;
+//client console commands:
+//+use
+//-use
 //description:
-//allows traces to hit alias models (not sprites!) instead of entity boxes (see DP_QC_TRACE_MOVETYPES for how to use this)
+//made +use and -use commands work, they now control the .buttonuse field (.button1 was used by many mods for other purposes).
 
 // LordHavoc: HIGHLY experimental, do not implement this in other engines
 //DP_CGAME
@@ -67,6 +68,36 @@
 //description:
 //sets global skybox for the map for this client (can be stuffed to a client by QC), does not hurt much to repeatedly execute this command, please don't use this in mods if it can be avoided (only if changing skybox is REALLY needed, otherwise please use DP_GFX_SKYBOX).
 
+//DP_CON_SET
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "set" console command which creates or sets a non-archived cvar (not saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_SETA
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports the "seta" console command which creates or sets an archived cvar (saved to config.cfg on exit), it is recommended that set and seta commands be placed in default.cfg for mod-specific cvars.
+
+//DP_CON_ALIASPARAMETERS
+//idea: many
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports aliases containing $1 through $9 parameter macros (which when called will expand to the parameters passed to the alias, for example alias test "say $2 $1", then you can type test hi there and it will execute say there hi), as well as $0 (name of the alias) and $* (all parameters $1 onward).
+
+//DP_CON_EXPANDCVAR
+//idea: many, PHP
+//darkplaces implementation: Black
+//description:
+//indicates this engine supports console commandlines containing $cvarname which will expand to the contents of that cvar as a parameter, for instance say my fov is $fov, will say "my fov is 90", or similar.
+
+//DP_CON_STARTMAP
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//adds two engine-called aliases named startmap_sp and startmap_dm which are called when the engine tries to start a singleplayer game from the menu (startmap_sp) or the -listen or -dedicated options are used or the engine is a dedicated server (uses startmap_dm), these allow a mod or game to specify their own map instead of start, and also distinguish between singleplayer and -listen/-dedicated, also these need not be a simple "map start" command, they can do other things if desired, startmap_sp and startmap_dm both default to "map start".
+
 //DP_EF_ADDITIVE
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -83,6 +114,14 @@
 //description:
 //entity emits blue light (used for quad)
 
+//DP_EF_DOUBLESIDED
+//idea: LordHavoc
+//darkplaces implementation: [515] and LordHavoc
+//effects bit:
+float EF_DOUBLESIDED = 32768;
+//description:
+//render entity as double sided (backfaces are visible, I.E. you see the 'interior' of the model, rather than just the front), can be occasionally useful on transparent stuff.
+
 //DP_EF_FLAME
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -99,6 +138,14 @@
 //description:
 //entity is always brightly lit
 
+//DP_EF_NODEPTHTEST
+//idea: Supa
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NODEPTHTEST       = 8192;
+//description:
+//makes entity show up to client even through walls, useful with EF_ADDITIVE for special indicators like where team bases are in a map, so that people don't get lost
+
 //DP_EF_NODRAW
 //idea: id Software
 //darkplaces implementation: LordHavoc
@@ -107,6 +154,14 @@
 //description:
 //prevents server from sending entity to client (forced invisible, even if it would have been a light source or other such things)
 
+//DP_EF_NOSHADOW
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//effects bit:
+float   EF_NOSHADOW     = 4096;
+//description:
+//realtime lights will not cast shadows from this entity (but can still illuminate it)
+
 //DP_EF_RED
 //idea: id Software
 //darkplaces implementation: LordHavoc
@@ -123,11 +178,10 @@
 //description:
 //entity emits bouncing sparkles in every direction
 
-//entity attributes used for rendering/networking:
+//DP_ENT_ALPHA
 //idea: Nehahra
 //darkplaces implementation: LordHavoc
-//DP_ENT_ALPHA
-//field definition:
+//fields:
 .float alpha;
 //description:
 //controls opacity of the entity, 0.0 is forced to be 1.0 (otherwise everything would be invisible), use -1 if you want to make something invisible, 1.0 is solid (like normal).
@@ -163,7 +217,7 @@
 //fields:
 .entity exteriormodeltoclient;
 //description:
-//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown.
+//the entity is visible to all clients with one exception: if the specified client is using first person view (not using chase_active) the entity will not be shown.  Also if tag attachments are supported any entities attached to the player entity will not be drawn in first person.
 
 //DP_ENT_GLOW
 //idea: LordHavoc
@@ -199,22 +253,6 @@
 //description:
 //this is a very special capability, attachs the entity to the view of the client specified, origin and angles become relative to the view of that client, all effects can be used (multiple skins on a weapon model etc)...  the entity is not visible to any other client.
 
-//DP_GFX_FOG
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
-//description:
-//global fog for the map, can not be changed by QC
-
-//DP_GFX_SKYBOX
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//worldspawn fields:
-//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
-//description:
-//global skybox for the map, can not be changed by QC
-
 //DP_GFX_EXTERNALTEXTURES
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -243,7 +281,7 @@
 type 11 (RLE compressed 8bit greyscale)
 attribute bit 0x20 (Origin At Top Left, top to bottom, left to right)
 
-image formats guarenteed to be supported: tga, pcx, lmp
+image formats guaranteed to be supported: tga, pcx, lmp
 image formats that are optional: png, jpg
 
 mdl/spr/spr32 examples:
@@ -265,7 +303,7 @@
 example names for the texture "quake" of model "maps/start.bsp":
 game/override/quake.tga
 game/textures/quake.tga
-game/progs/quake.tga
+game/quake.tga
 
 sbar/menu/console textures: for example the texture "conchars" (console font) in gfx.wad
 game/override/gfx/conchars.tga
@@ -273,6 +311,26 @@
 game/gfx/conchars.tga
 */
 
+//DP_GFX_EXTERNALTEXTURES_PERMAPTEXTURES
+//idea: Fuh?
+//darkplaces implementation: LordHavoc
+//description:
+//Q1BSP and HLBSP map loading loads external textures found in textures/<mapname>/ as well as textures/.
+//Where mapname is the bsp filename minus the extension (typically .bsp) and minus maps/ if it is in maps/ (any other path is not removed)
+//example:
+//maps/e1m1.bsp uses textures in the directory textures/e1m1/ and falls back to textures/
+//maps/b_batt0.bsp uses textures in the directory textures/b_batt0.bsp and falls back to textures/
+//as a more extreme example:
+//progs/something/blah.bsp uses textures in the directory textures/progs/something/blah/ and falls back to textures/
+
+//DP_GFX_FOG
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"fog" (parameters: "density red green blue", example: "0.1 0.3 0.3 0.3")
+//description:
+//global fog for the map, can not be changed by QC
+
 //DP_GFX_QUAKE3MODELTAGS
 //idea: id Software
 //darkplaces implementation: LordHavoc
@@ -286,6 +344,7 @@
 //note 2: if the tag is not found, it defaults to "" (attach to origin/angles of entity)
 //note 3: attaching to world turns off attachment
 //note 4: the entity that this is attached to must be visible for this to work
+//note 5: if an entity is attached to the player entity it will not be drawn in first person.
 
 //DP_GFX_SKINFILES
 //idea: LordHavoc
@@ -313,6 +372,14 @@
 //this feature is intended to allow multiple skin sets on md3 models (which otherwise only have one skin set).
 //other commands might be added someday but it is not expected.
 
+//DP_GFX_SKYBOX
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//worldspawn fields:
+//"sky" (parameters: "basename", example: "mtnsun_" would load "mtnsun_up.tga" and "mtnsun_rt.tga" and similar names, note: "sky" is also used the same way by Quake2)
+//description:
+//global skybox for the map, can not be changed by QC
+
 //DP_HALFLIFE_MAP
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -327,6 +394,12 @@
 //description:
 //engine sets this cvar when loading a map to indicate if it is halflife format or not.
 
+//DP_HALFLIFE_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//simply indicates that the engine supports HalfLife sprites.
+
 //DP_INPUTBUTTONS
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -339,7 +412,30 @@
 .float button8;
 //description:
 //set to the state of the +button3, +button4, +button5, +button6, +button7, and +button8 buttons from the client, this does not involve protocol changes (the extra 6 button bits were simply not used).
+//the exact mapping of protocol button bits on the server is:
+//self.button0 = (bits & 1) != 0;
+///* button1 is skipped because mods abuse it as a variable, and accordingly it has no bit */
+//self.button2 = (bits & 2) != 0;
+//self.button3 = (bits & 4) != 0;
+//self.button4 = (bits & 8) != 0;
+//self.button5 = (bits & 16) != 0;
+//self.button6 = (bits & 32) != 0;
+//self.button7 = (bits & 64) != 0;
+//self.button8 = (bits & 128) != 0;
 
+//DP_LITSPRITES
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine supports lighting on sprites, any sprite with ! in its filename (both on disk and in the qc) will be lit rather than having forced EF_FULLBRIGHT (EF_FULLBRIGHT on the entity can still force these sprites to not be lit).
+
+//DP_LITSUPPORT
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//indicates this engine loads .lit files for any quake1 format .bsp files it loads to enhance maps with colored lighting.
+//implementation description: these files begin with the header QLIT followed by version number 1 (as little endian 32bit), the rest of the file is a replacement lightmaps lump, except being 3x as large as the lightmaps lump of the map it matches up with (and yes the between-lightmap padding is expanded 3x to keep this consistent), so the lightmap offset in each surface is simply multiplied by 3 during loading to properly index the lit data, and the lit file is loaded instead of the lightmap lump, other renderer changes are needed to display these of course...  see the litsupport.zip sample code (almost a tutorial) at http://icculus.org/twilight/darkplaces for more information.
+
 //DP_MONSTERWALK
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -350,7 +446,7 @@
 //idea: id Software
 //darkplaces implementation: id Software
 //movetype definitions:
-float MOVETYPE_BOUNCEMISSILE = 11;
+//float MOVETYPE_BOUNCEMISSILE = 11; // already in defs.qc
 //description:
 //MOVETYPE_BOUNCE but without gravity, and with full reflection (no speed loss like grenades have), in other words - bouncing laser bolts.
 
@@ -373,6 +469,23 @@
 //hole.view_ofs = hole.origin - bmodel.origin; // relative origin
 //hole.v_angle = hole.angles - bmodel.angles; // relative angles
 
+//DP_QC_ASINACOSATANATAN2TAN
+//idea: Urre
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float DEG2RAD = 0.0174532925199432957692369076848861271344287188854172545609719144;
+float RAD2DEG = 57.2957795130823208767981548141051703324054724665643215491602438612;
+float PI      = 3.1415926535897932384626433832795028841971693993751058209749445923;
+//builtin definitions:
+float(float s) asin = #471; // returns angle in radians for a given sin() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c) acos = #472; // returns angle in radians for a given cos() value, the result is in the range 0 to PI
+float(float t) atan = #473; // returns angle in radians for a given tan() value, the result is in the range -PI*0.5 to PI*0.5
+float(float c, float s) atan2 = #474; // returns angle in radians for a given cos() and sin() value pair, the result is in the range -PI to PI (this is identical to vectoyaw except it returns radians rather than degrees)
+float(float a) tan = #475; // returns tangent value (which is simply sin(a)/cos(a)) for the given angle in radians, the result is in the range -infinity to +infinity
+//description:
+//useful math functions for analyzing vectors, note that these all use angles in radians (just like the cos/sin functions) not degrees unlike makevectors/vectoyaw/vectoangles, so be sure to do the appropriate conversions (multiply by DEG2RAD or RAD2DEG as needed).
+//note: atan2 can take unnormalized vectors (just like vectoyaw), and the function was included only for completeness (more often you want vectoyaw or vectoangles), atan2(v_x,v_y) * RAD2DEG gives the same result as vectoyaw(v)
+
 //DP_QC_CHANGEPITCH
 //idea: id Software
 //darkplaces implementation: id Software
@@ -392,13 +505,21 @@
 //description:
 //copies all data in the entity to another entity.
 
+//DP_QC_CVAR_STRING
+//idea: VorteX
+//DarkPlaces implementation: VorteX, LordHavoc
+//builtin definitions:
+string(string s) cvar_string = #448;
+//description:
+//returns the value of a cvar, as a tempstring.
+
 //DP_QC_ETOS
 //idea: id Software
 //darkplaces implementation: id Software
 //builtin definitions:
 string(entity ent) etos = #65;
 //description:
-//lists all of the entity's fields into a string (similar to edict command in console). (this was a Q2 builtin)
+//prints "entity 1" or similar into a string. (this was a Q2 builtin)
 
 //DP_QC_FINDCHAIN
 //idea: LordHavoc
@@ -408,6 +529,14 @@
 //description:
 //similar to find() but returns a chain of entities like findradius.
 
+//DP_QC_FINDCHAINFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(.float fld, float match) findchainflags = #450;
+//description:
+//similar to findflags() but returns a chain of entities like findradius.
+
 //DP_QC_FINDCHAINFLOAT
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -417,6 +546,14 @@
 //description:
 //similar to findentity()/findfloat() but returns a chain of entities like findradius.
 
+//DP_QC_FINDFLAGS
+//idea: Sajt
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+entity(entity start, .float fld, float match) findflags = #449;
+//description:
+//finds an entity with the specified flag set in the field, similar to find()
+
 //DP_QC_FINDFLOAT
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -426,6 +563,20 @@
 //description:
 //finds an entity or float field value, similar to find(), but for entity and float fields.
 
+//DP_QC_FS_SEARCH
+//idea: Black
+//darkplaces implementation: Black
+//builtin definitions:
+float(string pattern, float caseinsensitive, float quiet) search_begin = #444;
+void(float handle) search_end = #445;
+float(float handle) search_getsize = #446;
+string(float handle, float num) search_getfilename = #447;
+//description:
+//search_begin performs a filename search with the specified pattern (for example "maps/*.bsp") and stores the results in a search slot (minimum of 128 supported by any engine with this extension), the other functions take this returned search slot number, be sure to search_free when done (they are also freed on progs reload).
+//search_end frees a search slot (also done at progs reload).
+//search_getsize returns how many filenames were found.
+//search_getfilename returns a filename from the search.
+
 //DP_QC_GETLIGHT
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -447,39 +598,62 @@
 //description:
 //functions to query surface information.
 
+//DP_QC_GETTAGINFO
+//idea: VorteX, LordHavoc (somebody else?)
+//DarkPlaces implementation: VorteX
+//builtin definitions:
+float(entity ent, string tagname) gettagindex = #451;
+vector(entity ent, float tagindex) gettaginfo = #452;
+//description:
+//gettagindex returns the number of a tag on an entity, this number is the same as set by setattachment (in the .tag_index field), allowing the qc to save a little cpu time by keeping the number around if it wishes (this could already be done by calling setattachment and saving off the tag_index).
+//gettaginfo returns the origin of the tag in worldspace and sets v_forward, v_right, and v_up to the current orientation of the tag in worldspace, this automatically resolves all dependencies (attachments, including viewmodelforclient), this means you could fire a shot from a tag on a gun entity attached to the view for example.
+
 //DP_QC_MINMAXBOUND
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
 //builtin definitions:
-float(float a, ...) min = #94;
-//float(float a, float b, ...) min = #94;
-//float(float a, float b, float c) min3 = #94;
-//float(float a, float b, float c, float d) min4 = #94;
-//float(float a, float b, float c, float d, float e) min5 = #94;
-//float(float a, float b, float c, float d, float e, float f) min6 = #94;
-//float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
-//float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
-float(float a, ...) max = #95;
-//float(float a, float b, ...) max = #95;
-//float(float a, float b, float c) max3 = #95;
-//float(float a, float b, float c, float d) max4 = #95;
-//float(float a, float b, float c, float d, float e) max5 = #95;
-//float(float a, float b, float c, float d, float e, float f) max6 = #95;
-//float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
-//float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
+float(float a, float b) min = #94;
+float(float a, float b, float c) min3 = #94;
+float(float a, float b, float c, float d) min4 = #94;
+float(float a, float b, float c, float d, float e) min5 = #94;
+float(float a, float b, float c, float d, float e, float f) min6 = #94;
+float(float a, float b, float c, float d, float e, float f, float g) min7 = #94;
+float(float a, float b, float c, float d, float e, float f, float g, float h) min8 = #94;
+float(float a, float b) max = #95;
+float(float a, float b, float c) max3 = #95;
+float(float a, float b, float c, float d) max4 = #95;
+float(float a, float b, float c, float d, float e) max5 = #95;
+float(float a, float b, float c, float d, float e, float f) max6 = #95;
+float(float a, float b, float c, float d, float e, float f, float g) max7 = #95;
+float(float a, float b, float c, float d, float e, float f, float g, float h) max8 = #95;
 float(float minimum, float val, float maximum) bound = #96;
 //description:
 //min returns the lowest of all the supplied numbers.
 //max returns the highest of all the supplied numbers.
 //bound clamps the value to the range and returns it.
 
+//DP_QC_MULTIPLETEMPSTRINGS
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//this extension makes all builtins returning tempstrings (ftos for example)
+//cycle through a pool of multiple tempstrings (at least 16), allowing
+//multiple ftos results to be gathered before putting them to use, normal
+//quake only had 1 tempstring, causing many headaches.
+//
+//Note that for longer term storage (or compatibility on engines having
+//FRIK_FILE but not this extension) the FRIK_FILE extension's
+//strzone/strunzone builtins provide similar functionality (slower though).
+//
+//NOTE: this extension is superseded by DP_QC_UNLIMITEDTEMPSTRINGS
+
 //DP_QC_RANDOMVEC
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
 //builtin definitions:
 vector() randomvec = #91;
 //description:
-//returns a vector of length < 1, much quicker version of this QC: do {v_x = random();v_y = random();v_z = random();} while(vlen(v) > 1)
+//returns a vector of length < 1, much quicker version of this QC: do {v_x = random()*2-1;v_y = random()*2-1;v_z = random()*2-1;} while(vlen(v) > 1)
 
 //DP_QC_SINCOSSQRTPOW
 //idea: id Software, LordHavoc
@@ -492,13 +666,54 @@
 //description:
 //useful math functions, sine of val, cosine of val, square root of val, and raise a to power b, respectively.
 
+//DP_QC_STRFTIME
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+string(float uselocaltime, string format, ...) strftime = #478;
+//description:
+//provides the ability to get the local (in your timezone) or world (Universal Coordinated Time) time as a string using the formatting of your choice:
+//example: "%Y-%m-%d %H:%M:%S"   (result looks like: 2007-02-08 01:03:15)
+//note: "%F %T" gives the same result as "%Y-%m-%d %H:%M:%S" (ISO 8601 date format and 24-hour time)
+//for more format codes please do a web search for strftime 3 and you should find the man(3) pages for this standard C function.
+//
+//practical uses:
+//changing day/night cycle (shops closing, monsters going on the prowl) in an RPG, for this you probably want to use s = strftime(TRUE, "%H");hour = ftos(s);
+//printing current date/time for competitive multiplayer games, such as the beginning/end of each round in real world time.
+//activating eastereggs in singleplayer games on certain dates.
+//
+//note: some codes such as %x and %X use your locale settings and thus may not make sense to international users, it is not advisable to use these as the server and clients may be in different countries.
+//note: if you display local time to a player, it would be a good idea to note whether it is local time using a string like "%F %T (local)", and otherwise use "%F %T (UTC)".
+//note: be aware that if the game is saved and reloaded a week later the date and time will be different, so if activating eastereggs in a singleplayer game or something you may want to only check when a level is loaded and then keep the same easteregg state throughout the level so that the easteregg does not deactivate when reloading from a savegame (also be aware that precaches should not depend on such date/time code because reloading a savegame often scrambles the precaches if so!).
+//note: this function can return a NULL string (you can check for it with if (!s)) if the localtime/gmtime functions returned NULL in the engine code, such as if those functions don't work on this platform (consoles perhaps?), so be aware that this may return nothing.
+
+//DP_QC_STRINGCOLORFUNCTIONS
+//idea: Dresk
+//darkplaces implementation: Dresk
+//builtin definitions:
+float(string s) strlennocol = #476; // returns how many characters are in a string, minus color codes
+string(string s) strdecolorize = #477; // returns a string minus the color codes of the string provided
+//description:
+//provides additional functionality to strings by supporting functions that isolate and identify strings with color codes
+
+//DP_QC_TOKENIZEBYSEPARATOR
+//idea: Electro, SavageX, LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+float(string s, string separator1, ...) tokenizebyseparator = #479;
+//description:
+//this function returns tokens separated by any of the supplied separator strings, example:
+//numnumbers = tokenizebyseparator("10.2.3.4", ".");
+//returns 4 and the tokens are "10" "2" "3" "4"
+//possibly useful for parsing IPv4 addresses (such as "1.2.3.4") and IPv6 addresses (such as "[1234:5678:9abc:def0:1234:5678:9abc:def0]:26000")
+
 //DP_QC_TRACEBOX
 //idea: id Software
 //darkplaces implementation: id Software
 //builtin definitions:
 void(vector v1, vector min, vector max, vector v2, float nomonsters, entity forent) tracebox = #90;
 //description:
-//similar to traceline but much more useful, traces a box of the size specified (technical note: currently the hull size can only be one of the sizes used in the map for bmodel collisions, entity collisions will pay attention to the exact size specified however, this is a collision code limitation in quake itself, and will be fixed eventually).
+//similar to traceline but much more useful, traces a box of the size specified (technical note: in quake1 and halflife bsp maps the mins and maxs will be rounded up to one of the hull sizes, quake3 bsp does not have this problem, this is the case with normal moving entities as well).
 
 //DP_QC_TRACETOSS
 //idea: id Software
@@ -508,6 +723,47 @@
 //description:
 //simulates movement of the entity as if it is MOVETYPE_TOSS and starting with it's current state (location, velocity, etc), returns relevant trace_ variables (trace_fraction is always 0, all other values are supported - trace_ent, trace_endpos, trace_plane_normal), does not actually alter the entity.
 
+//DP_QC_TRACE_MOVETYPE_HITMODEL
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_HITMODEL = 4;
+//description:
+//allows traces to hit alias models (not sprites!) instead of entity boxes, use as the nomonsters parameter to trace functions, note that you can hit invisible model entities (alpha < 0 or EF_NODRAW or model "", it only checks modelindex)
+
+//DP_QC_TRACE_MOVETYPE_WORLDONLY
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//constant definitions:
+float MOVE_WORLDONLY = 3;
+//description:
+//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions
+
+//DP_QC_UNLIMITEDTEMPSTRINGS
+//idea: div0
+//darkplaces implementation: LordHavoc
+//description:
+//this extension alters Quake behavior such that instead of reusing a single
+//tempstring (or multiple) there are an unlimited number of tempstrings, which
+//are removed only when a QC function invoked by the engine returns,
+//eliminating almost all imaginable concerns with string handling in QuakeC.
+//
+//in short:
+//you can now use and abuse tempstrings as much as you like, you still have to
+//use strzone (FRIK_FILE) for permanent storage however.
+//
+//
+//
+//implementation notes for other engine coders:
+//these tempstrings are expected to be stored in a contiguous buffer in memory
+//which may be fixed size or controlled by a cvar, or automatically grown on
+//demand (in the case of DarkPlaces).
+//
+//this concept is similar to quake's Zone system, however these are all freed
+//when the QC interpreter returns.
+//
+//this is basically a poor man's garbage collection system for strings.
+
 //DP_QC_VECTORVECTORS
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -522,6 +778,18 @@
 //description:
 //shows that the engine supports Quake2 .md2 files.
 
+//DP_QUAKE2_SPRITE
+//idea: LordHavoc
+//darkplaces implementation: Elric
+//description:
+//shows that the engine supports Quake2 .sp2 files.
+
+//DP_QUAKE3_MAP
+//idea: quake community
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports Quake3 .bsp files.
+
 //DP_QUAKE3_MODEL
 //idea: quake community
 //darkplaces implementation: LordHavoc
@@ -535,7 +803,33 @@
 float(string name, string value) registercvar = #93;
 //description:
 //adds a new console cvar to the server console (in singleplayer this is the player's console), the cvar exists until the mod is unloaded or the game quits.
+//NOTE: DP_CON_SET is much better.
 
+//DP_SND_DIRECTIONLESSATTNNONE
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//make sounds with ATTN_NONE have no spatialization (enabling easy use as music sources).
+
+//DP_SND_FAKETRACKS
+//idea: requested
+//darkplaces implementation: Elric
+//description:
+//the engine plays sound/cdtracks/track001.wav instead of cd track 1 and so on if found, this allows games and mods to have music tracks without using ambientsound.
+//Note: also plays .ogg with DP_SND_OGGVORBIS extension.
+
+//DP_SND_OGGVORBIS
+//idea: Transfusion
+//darkplaces implementation: Elric
+//description:
+//the engine supports loading Ogg Vorbis sound files.  Use either the .ogg filename directly, or a .wav of the same name (will try to load the .wav first and then .ogg).
+
+//DP_SND_STEREOWAV
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//description:
+//the engine supports stereo WAV files.  (useful with DP_SND_DIRECTIONLESSATTNNONE for music)
+
 //DP_SOLIDCORPSE
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -605,6 +899,7 @@
 //DP_SV_CLIENTCOLORS
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
+//field definitions:
 .float clientcolors; // colors of the client (format: pants + shirt * 16)
 //description:
 //allows qc to read and modify the client colors associated with a client entity (not particularly useful on other entities), and automatically sends out any appropriate network updates if changed
@@ -612,8 +907,26 @@
 //DP_SV_CLIENTNAME
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
+//description:
 //allows qc to modify the client's .netname, and automatically sends out any appropriate network updates if changed
 
+//DP_SV_CUSTOMIZEENTITYFORCLIENT
+//idea: LordHavoc
+//darkplaces implementation: [515] and LordHavoc
+//field definitions:
+.float() customizeentityforclient; // self = this entity, other = client entity
+//description:
+//allows qc to modify an entity before it is sent to each client, the function returns TRUE if it should send, FALSE if it should not, and is fully capable of editing the entity's fields, this allows cloaked players to appear less transparent to their teammates, navigation markers to only show to their team, etc
+//tips on writing customize functions:
+//it is a good idea to return FALSE early in the function if possible to reduce cpu usage, because this function may be called many thousands of times per frame if there are many customized entities on a 64+ player server.
+//you are free to change anything in self, but please do not change any other entities (the results may be very inconsistent).
+//example ideas for use of this extension:
+//making icons over teammates' heads which are only visible to teammates.  for exasmple: float() playericon_customizeentityforclient = {return self.owner.team == other.team;};
+//making cloaked players more visible to their teammates than their enemies.  for example: float() player_customizeentityforclient = {if (self.items & IT_CLOAKING) {if (self.team == other.team) self.alpha = 0.6;else self.alpha = 0.1;} return TRUE;};
+//making explosion models that face the viewer (does not work well with chase_active).  for example: float() explosion_customizeentityforclient = {self.angles = vectoangles(other.origin + other.view_ofs - self.origin);self.angles_x = 0 - self.angles_x;};
+//implementation notes:
+//entity customization is done before per-client culling (visibility for instance) because the entity may be doing setorigin to display itself in different locations on different clients, may be altering its .modelindex, .effects and other fields important to culling, so customized entities increase cpu usage (non-customized entities can use all the early culling they want however, as they are not changing on a per client basis).
+
 //DP_SV_DRAWONLYTOCLIENT
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -622,6 +935,14 @@
 //description:
 //the entity is only visible to the specified client.
 
+//DP_SV_DROPCLIENT
+//idea: FrikaC
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(entity clent) dropclient = #453;
+//description:
+//causes the server to immediately drop the client, more reliable than stuffcmd(clent, "disconnect\n"); which could be intentionally ignored by the client engine
+
 //DP_SV_EFFECT
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -633,6 +954,16 @@
 //description:
 //clientside playback of simple custom sprite effects (explosion sprites, etc).
 
+//DP_SV_ENTITYCONTENTSTRANSITION
+//idea: Dresk
+//darkplaces implementation: Dresk
+//field definitions:
+.void(float nOriginalContents, float nNewContents) contentstransition;
+//description:
+//This field function, when provided, is triggered on an entity when the contents (ie. liquid / water / etc) is changed.
+//The first parameter provides the entities original contents, prior to the transition.  The second parameter provides the new contents.
+//NOTE: If this field function is provided on an entity, the standard watersplash sound IS SUPPRESSED to allow for authors to create their own transition sounds.
+
 //DP_SV_NODRAWTOCLIENT
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -641,11 +972,29 @@
 //description:
 //the entity is not visible to the specified client.
 
+//DP_SV_PING
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.float ping;
+//description:
+//continuously updated field indicating client's ping (based on average of last 16 packet time differences).
+
+//DP_SV_PUNCHVECTOR
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//field definitions:
+.vector punchvector;
+//description:
+//offsets client view in worldspace, similar to view_ofs but all 3 components are used and are sent with at least 8 bits of fraction, this allows the view to be kicked around by damage or hard landings or whatever else, note that unlike punchangle this is not faded over time, it is up to the mod to fade it (see also DP_SV_PLAYERPHYSICS).
+
 //DP_SV_PLAYERPHYSICS
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
 //field definitions:
 .vector movement;
+//cvar definitions:
+//"sv_playerphysicsqc" (0/1, default 1, allows user to disable qc player physics)
 //engine-called QC prototypes:
 //void() SV_PlayerPhysics;
 //description:
@@ -658,6 +1007,19 @@
 //description:
 //this is identical to dprint except that it always prints regardless of the developer cvar.
 
+//DP_SV_PRECACHEANYTIME
+//idea: id Software (Quake2)
+//darkplaces implementation: LordHavoc
+//description:
+//this extension allows precache_model and precache_sound (and any variants) to be used during the game (with automatic messages to clients to precache the new model/sound indices), also setmodel/sound/ambientsound can be called without precaching first (they will cause an automatic precache).
+
+//DP_SV_ROTATINGBMODEL
+//idea: id Software
+//darkplaces implementation: LordHavoc
+//description:
+//this extension merely indicates that MOVETYPE_PUSH supports avelocity, allowing rotating brush models to be created, they rotate around their origin (needs rotation supporting qbsp/light utilities because id ones expected bmodel entity origins to be '0 0 0', recommend setting "origin" key in the entity fields in the map before compiling, there may be other methods depending on your qbsp, most are more complicated however).
+//tip: level designers can create a func_wall with an origin, and avelocity (for example "avelocity" "0 90 0"), and "nextthink" "99999999" to make a rotating bmodel without any qc modifications, such entities will be solid in stock quake but will not rotate)
+
 //DP_SV_SETCOLOR
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -679,6 +1041,15 @@
 //sets the time scale of the server, mainly intended for use in singleplayer by the player, however potentially useful for mods, so here's an extension for it.
 //range is 0 to infinite, recommended values to try are 0.1 (very slow, 10% speed), 1 (normal speed), 5 (500% speed).
 
+//DP_SV_WRITEUNTERMINATEDSTRING
+//idea: FrikaC
+//darkplaces implementation: Sajt
+//builtin definitions:
+void(float to, string s) WriteUnterminatedString = #456;
+//description:
+//like WriteString, but does not write a terminating 0 after the string. This means you can include things like a player's netname in the middle of a string sent over the network. Just be sure to end it up with either a call to WriteString (which includes the trailing 0) or WriteByte(0) to terminate it yourself.
+//A historical note: this extension was suggested by FrikaC years ago, more recently Shadowalker has been badmouthing LordHavoc and Spike for stealing 'his' extension writestring2 which does exactly the same thing but uses a different builtin number and name and extension string, this argument hinges on the idea that it was his idea in the first place, which is incorrect as FrikaC first suggested it and used a rough equivilant of it in his FrikBot mod years ago involving WriteByte calls on each character.
+
 //DP_TE_BLOOD
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -745,8 +1116,10 @@
 //DP_TE_FLAMEJET
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org, vector vel, float howmany) te_flamejet = #457;
 //temp entity definitions:
-float TE_FLAMEJET = 74;
+//float TE_FLAMEJET = 74;
 //protocol:
 //vector origin
 //vector velocity
@@ -804,6 +1177,18 @@
 //description:
 //creates a shower of snow, the snow will appear either at the top (if falling down) or bottom (if falling up) of the cube, low velocities are advisable for convincing snow.
 
+//DP_TE_PLASMABURN
+//idea: LordHavoc
+//darkplaces implementation: LordHavoc
+//builtin definitions:
+void(vector org) te_plasmaburn = #433;
+//temp entity definitions:
+//float TE_PLASMABURN = 75;
+//protocol:
+//vector origin
+//description:
+//creates a small light flash (radius 200, time 0.2) and marks the walls.
+
 //DP_TE_QUADEFFECTS1
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
@@ -863,7 +1248,7 @@
 void(vector org) te_knightspike = #424;
 void(vector org) te_lavasplash = #425;
 void(vector org) te_teleport = #426;
-void(vector org, float color) te_explosion2 = #427;
+void(vector org, float color, float colorlength) te_explosion2 = #427;
 void(entity own, vector start, vector end) te_lightning1 = #428;
 void(entity own, vector start, vector end) te_lightning2 = #429;
 void(entity own, vector start, vector end) te_lightning3 = #430;
@@ -871,27 +1256,15 @@
 //description:
 //to make life easier on mod coders.
 
-//DP_TE_PLASMABURN
-//idea: LordHavoc
-//darkplaces implementation: LordHavoc
-//builtin definitions:
-void(vector org) te_plasmaburn = #433;
-//temp entity definitions:
-//float TE_PLASMABURN = 75;
-//protocol:
-//vector origin
-//description:
-//creates a small light flash (radius 200, time 0.2) and marks the walls.
-
 //DP_TRACE_HITCONTENTSMASK_SURFACEINFO
 //idea: LordHavoc
 //darkplaces implementation: LordHavoc
 //globals:
-//.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
+.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls
 float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace
 float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit)
 float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface
-//string trace_dphittexturename; // texture name of impacted surface
+string trace_dphittexturename; // texture name of impacted surface
 //constants:
 float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box
 float DPCONTENTS_WATER = 2;
@@ -941,6 +1314,15 @@
 //description:
 //scales fov and sensitivity of player, valid range is 0 to 1 (intended for sniper rifle zooming, and such)
 
+//EXT_BITSHIFT
+//idea: Spike
+//darkplaces implementation: [515]
+//builtin definitions:
+float(float number, float quantity) bitshift = #218;
+//description:
+//multiplies number by a power of 2 corresponding to quantity (0 = *1, 1 = *2, 2 = *4, 3 = *8, -1 = /2, -2 = /4x, etc), and rounds down (due to integer math) like other bit operations do (& and | and the like).
+//note: it is faster to use multiply if you are shifting by a constant, avoiding the quakec function call cost, however that does not do a floor for you.
+
 //FRIK_FILE
 //idea: FrikaC
 //darkplaces implementation: LordHavoc
@@ -949,12 +1331,12 @@
 float(string filename, float mode) fopen = #110; // opens a file inside quake/gamedir/data/ (mode is FILE_READ, FILE_APPEND, or FILE_WRITE), returns fhandle >= 0 if successful, or fhandle < 0 if unable to open file for any reason
 void(float fhandle) fclose = #111; // closes a file
 string(float fhandle) fgets = #112; // reads a line of text from the file and returns as a tempstring
-void(float fhandle, string s) fputs = #113; // writes a line of text to the end of the file
+void(float fhandle, string s, ...) fputs = #113; // writes a line of text to the end of the file
 float(string s) strlen = #114; // returns how many characters are in a string
-string(string s1, ...) strcat = #115; // concatenates two strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
+string(string s1, string s2, ...) strcat = #115; // concatenates two or more strings (for example "abc", "def" would return "abcdef") and returns as a tempstring
 string(string s, float start, float length) substring = #116; // returns a section of a string as a tempstring
 vector(string s) stov = #117; // returns vector value from a string
-string(string s) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
+string(string s, ...) strzone = #118; // makes a copy of a string into the string zone and returns it, this is often used to keep around a tempstring for longer periods of time (tempstrings are replaced often)
 void(string s) strunzone = #119; // removes a copy of a string from the string zone (you can not use that string again or it may crash!!!)
 //constants:
 float FILE_READ = 0;
@@ -964,6 +1346,9 @@
 //pr_zone_min_strings : default 64 (64k), min 64 (64k), max 8192 (8mb)
 //description:
 //provides text file access functions and string manipulation functions, note that you may want to set pr_zone_min_strings in the worldspawn function if 64k is not enough string zone space.
+//
+//NOTE: strzone functionality is partially superseded by
+//DP_QC_UNLIMITEDTEMPSTRINGS when longterm storage is not needed
 
 //KRIMZON_SV_PARSECLIENTCOMMAND
 //idea: KrimZon
@@ -977,6 +1362,12 @@
 //description:
 //provides QC the ability to completely control server interpretation of client commands ("say" and "color" for example, clientcommand is necessary for this and substring (FRIK_FILE) is useful) as well as adding new commands (tokenize, argv, and stof (FRIK_FILE) are useful for this)), whenever a clc_stringcmd is received the QC function is called, and it is up to the QC to decide what (if anything) to do with it
 
+//NEH_CMD_PLAY2
+//idea: Nehahra
+//darkplaces implementation: LordHavoc
+//description:
+//shows that the engine supports the "play2" console command (plays a sound without spatialization).
+
 //NEH_RESTOREGAME
 //idea: Nehahra
 //darkplaces implementation: LordHavoc
@@ -985,11 +1376,23 @@
 //description:
 //when a savegame is loaded, this function is called
 
-//NEH_CMD_PLAY2
-//idea: Nehahra
+//NEXUIZ_PLAYERMODEL
+//idea: Nexuiz
+//darkplaces implementation: Black
+//console commands:
+//playermodel <name> - FIXME: EXAMPLE NEEDED
+//playerskin <name> - FIXME: EXAMPLE NEEDED
+//field definitions:
+.string playermodel; // name of player model sent by client
+.string playerskin; // name of player skin sent by client
+//description:
+//these client properties are used by Nexuiz.
+
+//NXQ_GFX_LETTERBOX
+//idea: nxQuake
 //darkplaces implementation: LordHavoc
 //description:
-//shows that the engine supports the "play2" console command (plays a sound without spatialization).
+//shows that the engine supports the "r_letterbox" console variable, set to values in the range 0-100 this restricts the view vertically (and turns off sbar and crosshair), value is a 0-100 percentage of how much to constrict the view, <=0 = normal view height, 25 = 75% of normal view height, 50 = 50%, 75 = 25%, >=100 = no view
 
 //PRYDON_CLIENTCURSOR
 //idea: FrikaC
@@ -1029,6 +1432,7 @@
 //more powerful dynamic light settings
 //warning: it is best not to use cubemaps on a light entity that has a model, as using a skin number that a model does not have will cause issues in glquake, and produce warnings in darkplaces (use developer 1 to see them)
 //changes compared to tenebrae (because they're too 'leet' for standards):
+//note: networking should send entities with PFLAGS_FULLDYNAMIC set even if they have no model (lights in general do not have a model, nor should they)
 //EF_FULLDYNAMIC effects flag replaced by PFLAGS_FULLDYNAMIC flag (EF_FULLDYNAMIC conflicts with EF_NODRAW)
 
 //TW_SV_STEPCONTROL
@@ -1039,18 +1443,3 @@
 //sv_stepheight (default 18)
 //description:
 //sv_jumpstep allows stepping up onto stairs while airborn, sv_stepheight controls how high a single step can be.
-
-// NEXUIZ_PLAYERMODEL
-// NEXUIZ_PLAYERSKIN
-//idea:
-//darkplaces implementation: Black
-.string playermodel; // contains the name of the model set by a client with playermodel
-.string playerskin; // contains the name of the skin set by a client with playerskin
-
-//unassigned stuff:  (need to write up specs but haven't yet)
-.vector punchvector; // DP_SV_PUNCHVECTOR
-.float  ping; // DP_SV_PING
-
-
-.float buttonchat;
-.float buttonuse;

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_damage.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_damage.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_damage.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -91,7 +91,7 @@
 
 void Obituary (entity attacker, entity targ, float deathtype)
 {
-	string	s, m;
+	string	s, a, m;
 
 	if (targ.classname == "player" || targ.classname == "corpse")
 	{
@@ -99,6 +99,7 @@
 			s = "A corpse";
 		else
 			s = targ.netname;
+		a = attacker.netname;
 
 		if (targ == attacker)
 		{
@@ -130,15 +131,15 @@
 				return;
 			}
 			else if (deathtype == DEATH_CAMP)
-				centerprint(targ, strcat("^1Die camper!\n\n\n"));
+				centerprint(targ, "^1Die camper!\n\n\n");
 			else if (deathtype == DEATH_NOAMMO)
-				centerprint(targ, strcat("^1You were killed for running out of ammo...\n\n\n"));
+				centerprint(targ, "^1You were killed for running out of ammo...\n\n\n");
 			else if (deathtype == DEATH_ROT)
-				centerprint(targ, strcat("^1You grew too old without taking your medicine\n\n\n"));
+				centerprint(targ, "^1You grew too old without taking your medicine\n\n\n");
 			else if (deathtype == DEATH_MIRRORDAMAGE)
-				centerprint(targ, strcat("^1Don't shoot your team mates!\n\n\n"));
+				centerprint(targ, "^1Don't shoot your team mates!\n\n\n");
 			else
-				centerprint(targ, strcat("^1You killed your own dumb self!\n\n\n"));
+				centerprint(targ, "^1You killed your own dumb self!\n\n\n");
 
 			if (deathtype == IT_GRENADE_LAUNCHER)
 				bprint ("^1",s, "^1 detonated\n");
@@ -174,13 +175,13 @@
 		{
 			if(teamplay && attacker.team == targ.team)
 			{
-				centerprint(attacker, strcat("^1Moron! You fragged a teammate!\n\n\n"));
-				bprint ("^1", attacker.netname, "^1 mows down a teammate\n");
+				centerprint(attacker, "^1Moron! You fragged a teammate!\n\n\n");
+				bprint ("^1", a, "^1 mows down a teammate\n");
 				GiveFrags(attacker, targ, -1);
 				if (targ.killcount > 2)
 					bprint ("^1",s,"'s ^1",ftos(targ.killcount)," kill spree was ended by a teammate!\n");
 				if (attacker.killcount > 2)
-					bprint ("^1",attacker.netname,"^1 ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n");
+					bprint ("^1",a,"^1 ended a ",ftos(attacker.killcount)," kill spree by killing a teammate\n");
 				attacker.killcount = 0;
 
 				LogDeath("tk", deathtype, attacker, targ);
@@ -193,98 +194,98 @@
 					//sound(world, CHAN_AUTO, "announcer/firstblood.wav", 1, ATTN_NONE);
 					//if (cvar("g_minstagib"))
 						//sound(world, CHAN_AUTO, "announce/male/mapkill1.ogg", 1, ATTN_NONE);
-					bprint("^1",attacker.netname, "^1 drew first blood", "\n");
+					bprint("^1",a, "^1 drew first blood", "\n");
 				}
 
 				centerprint(attacker, strcat("^4You fragged ^7", s, "\n\n\n"));
-				centerprint(targ, strcat("^1You were fragged by ^7", attacker.netname, "\n\n\n"));
+				centerprint(targ, strcat("^1You were fragged by ^7", a, "\n\n\n"));
 
 				if (deathtype == IT_LASER)
-					bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was blasted by ", a, "\n");
 				else if (deathtype == IT_UZI)
-					bprint ("^1",s, "^1 was riddled full of holes by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was riddled full of holes by ", a, "\n");
 				else if (deathtype == IT_SHOTGUN)
-					bprint ("^1",s, "^1 was gunned by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was gunned by ", a, "\n");
 				else if (deathtype == IT_GRENADE_LAUNCHER)
-					bprint ("^1", s, "^1 was blasted by ", attacker.netname, "\n");
+					bprint ("^1", s, "^1 was blasted by ", a, "\n");
 				else if (deathtype == IT_ELECTRO)
-					bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was blasted by ", a, "\n");
 				else if (deathtype == IT_CRYLINK)
-					bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was blasted by ", a, "\n");
 				else if (deathtype == IT_NEX)
-					bprint ("^1",s, "^1 has been vaporized by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 has been vaporized by ", a, "\n");
 				else if (deathtype == IT_HAGAR)
-					bprint ("^1",s, "^1 was pummeled by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was pummeled by ", a, "\n");
 				else if (deathtype == IT_ROCKET_LAUNCHER)
-					bprint ("^1",s, "^1 was blasted by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was blasted by ", a, "\n");
 				else if (deathtype == DEATH_TELEFRAG)
-					bprint ("^1",s, "^1 was telefragged by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was telefragged by ", a, "\n");
 				else if (deathtype == DEATH_DROWN)
-					bprint ("^1",s, "^1 was drowned by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was drowned by ", a, "\n");
 				else if (deathtype == DEATH_SLIME)
-					bprint ("^1",s, "^1 was slimed by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was slimed by ", a, "\n");
 				else if (deathtype == DEATH_LAVA)
-					bprint ("^1",s, "^1 was cooked by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was cooked by ", a, "\n");
 				else if (deathtype == DEATH_FALL)
-					bprint ("^1",s, "^1 was grounded by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was grounded by ", a, "\n");
 				else if (deathtype == DEATH_SHOOTING_STAR)
-					bprint ("^1",s, "^1 was shot into space by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was shot into space by ", a, "\n");
 				else if (deathtype == DEATH_SWAMP)
-					bprint ("^1",s, "^1 was conserved by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was conserved by ", a, "\n");
 				else if (deathtype == DEATH_HURTTRIGGER)
-					bprint ("^1",s, "^1 was thrown into a world of hurt by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was thrown into a world of hurt by ", a, "\n");
 				else
-					bprint ("^1",s, "^1 was fragged by ", attacker.netname, "\n");
+					bprint ("^1",s, "^1 was fragged by ", a, "\n");
 
 				GiveFrags(attacker, targ, 1);
 				if (targ.killcount > 2)
-					bprint ("^1",s,"'s ^1", ftos(targ.killcount), " kill spree was ended by ", attacker.netname, "\n");
+					bprint ("^1",s,"'s ^1", ftos(targ.killcount), " kill spree was ended by ", a, "\n");
 				attacker.killcount = attacker.killcount + 1;
 				if (attacker.killcount > 2)
-					bprint ("^1",attacker.netname,"^1 has ",ftos(attacker.killcount)," frags in a row\n");
+					bprint ("^1",a,"^1 has ",ftos(attacker.killcount)," frags in a row\n");
 
 				LogDeath("frag", deathtype, attacker, targ);
 
 				if (attacker.killcount == 3)
 				{
-					bprint (attacker.netname,"^7 made a ^1TRIPLE FRAG\n");
+					bprint (a,"^7 made a ^1TRIPLE FRAG\n");
 					stuffcmd(attacker, "play2 announcer/male/03kills.ogg\n");
 				}
 				else if (attacker.killcount == 5)
 				{
-					bprint (attacker.netname,"^7 made a ^1FIVE FRAG COMBO\n");
+					bprint (a,"^7 made a ^1FIVE FRAG COMBO\n");
 					stuffcmd(attacker, "play2 announcer/male/05kills.ogg\n");
 				}
 				else if (attacker.killcount == 10)
 				{
-					bprint (attacker.netname,"^7 is on a ^1RAGE\n");
+					bprint (a,"^7 is on a ^1RAGE\n");
 					stuffcmd(attacker, "play2 announcer/male/10kills.ogg\n");
 				}
 				else if (attacker.killcount == 15)
 				{
-					bprint (attacker.netname,"^7 has done a ^1MASSACRE!\n");
+					bprint (a,"^7 has done a ^1MASSACRE!\n");
 					stuffcmd(attacker, "play2 announcer/male/15kills.ogg\n");
 				}
 				else if (attacker.killcount == 20)
 				{
-					bprint (attacker.netname,"^7 is ^1UNHUMAN!\n");
+					bprint (a,"^7 is ^1UNHUMAN!\n");
 					stuffcmd(attacker, "play2 announcer/male/20kills.ogg\n");
 				}
 				else if (attacker.killcount == 25)
 				{
-					bprint (attacker.netname,"^7 is a ^1DEATH INCARNATION!\n");
+					bprint (a,"^7 is a ^1DEATH INCARNATION!\n");
 					stuffcmd(attacker, "play2 announcer/male/25kills.ogg\n");
 				}
 				else if (attacker.killcount == 30)
 				{
-					bprint (attacker.netname,"^7 is maybe a ^1AIMBOTTER?!\n");
+					bprint (a,"^7 is maybe a ^1AIMBOTTER?!\n");
 					stuffcmd(attacker, "play2 announcer/male/30kills.ogg\n");
 				}
 			}
 		}
 		else
 		{
-			centerprint(targ, strcat("^1Watch your step!\n\n\n"));
+			centerprint(targ, "^1Watch your step!\n\n\n");
 			if (deathtype == DEATH_HURTTRIGGER && attacker.message != "")
 				bprint ("^1",s, "^1 ", attacker.message, "\n");
 			else if (deathtype == DEATH_DROWN)

Modified: branches/nexuiz-2.0/data/qcsrc/server/g_world.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/g_world.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -745,8 +745,7 @@
 	if(cvar("lastlevel"))
 	{
 		GameResetCfg();
-		localcmd(strcat("set lastlevel 0\n"));
-		localcmd(strcat("togglemenu\n"));
+		localcmd("set lastlevel 0\ntogglemenu\n");
 		return TRUE;
 	}
 	return FALSE;
@@ -1014,7 +1013,7 @@
 		self = other;
 
 		if(other.winning)
-			bprint(strcat(other.netname, " ^7wins.\n"));
+			bprint(other.netname, " ^7wins.\n");
 
 		if(!currentbots)
 		{
@@ -1258,7 +1257,7 @@
 float(float fraglimit) WinningConditionBase_Teamplay =
 {
 	tdm_old_score = tdm_max_score;
-	tdm_max_score = max(team1_score, team2_score, team3_score, team4_score);
+	tdm_max_score = max4(team1_score, team2_score, team3_score, team4_score);
 
 	checkrules_equality =
 	(
@@ -1438,8 +1437,8 @@
 	result = "";
 	for(i = 0; i < litems; ++i)
 	{
-		m = strcat(m);
-		result = strcat(result);
+		m = strcat1(m);
+		result = strcat1(result);
 		if(argv(i) == m)
 			found += 1;
 		else
@@ -1474,7 +1473,7 @@
 	inserted = 0;
 	for(i = 0; i < litems; ++i)
 	{
-		m = strcat(m);
+		m = strcat1(m);
 		if(i == ipos)
 		{
 			result = strcat(result, "'", m, "'");
@@ -2025,3 +2024,45 @@
 
 	MapVote_Tick();
 };
+
+
+
+float beamindex_modulo;
+void EndFrame()
+{
+	entity e;
+	string value;
+	vector mi, ma;
+	float i;
+
+	value = cvar_string("_entityboxes_for");
+	if(value == "")
+		return;
+
+	i = beamindex_modulo;
+	beamindex_modulo += 1;
+	if(beamindex_modulo >= 32)
+		beamindex_modulo = 0;
+	for(e = world; (e = find(e, classname, value)) != world; )
+	{
+		mi = e.absmin;
+		ma = e.absmax;
+		i = i + 1;
+		if(i >= 32)
+		{
+			i = 0;
+			te_lightning1(world, mi_x * '1 0 0' + mi_y * '0 1 0' + mi_z * '0 0 1', ma_x * '1 0 0' + mi_y * '0 1 0' + mi_z * '0 0 1');
+			te_lightning1(world, mi_x * '1 0 0' + mi_y * '0 1 0' + ma_z * '0 0 1', ma_x * '1 0 0' + mi_y * '0 1 0' + ma_z * '0 0 1');
+			te_lightning1(world, mi_x * '1 0 0' + ma_y * '0 1 0' + mi_z * '0 0 1', ma_x * '1 0 0' + ma_y * '0 1 0' + mi_z * '0 0 1');
+			te_lightning1(world, mi_x * '1 0 0' + ma_y * '0 1 0' + ma_z * '0 0 1', ma_x * '1 0 0' + ma_y * '0 1 0' + ma_z * '0 0 1');
+			te_lightning1(world, mi_x * '1 0 0' + mi_y * '0 1 0' + mi_z * '0 0 1', mi_x * '1 0 0' + ma_y * '0 1 0' + mi_z * '0 0 1');
+			te_lightning1(world, mi_x * '1 0 0' + mi_y * '0 1 0' + ma_z * '0 0 1', mi_x * '1 0 0' + ma_y * '0 1 0' + ma_z * '0 0 1');
+			te_lightning1(world, ma_x * '1 0 0' + mi_y * '0 1 0' + mi_z * '0 0 1', ma_x * '1 0 0' + ma_y * '0 1 0' + mi_z * '0 0 1');
+			te_lightning1(world, ma_x * '1 0 0' + mi_y * '0 1 0' + ma_z * '0 0 1', ma_x * '1 0 0' + ma_y * '0 1 0' + ma_z * '0 0 1');
+			te_lightning1(world, mi_x * '1 0 0' + mi_y * '0 1 0' + mi_z * '0 0 1', mi_x * '1 0 0' + mi_y * '0 1 0' + ma_z * '0 0 1');
+			te_lightning1(world, mi_x * '1 0 0' + ma_y * '0 1 0' + mi_z * '0 0 1', mi_x * '1 0 0' + ma_y * '0 1 0' + ma_z * '0 0 1');
+			te_lightning1(world, ma_x * '1 0 0' + mi_y * '0 1 0' + mi_z * '0 0 1', ma_x * '1 0 0' + mi_y * '0 1 0' + ma_z * '0 0 1');
+			te_lightning1(world, ma_x * '1 0 0' + ma_y * '0 1 0' + mi_z * '0 0 1', ma_x * '1 0 0' + ma_y * '0 1 0' + ma_z * '0 0 1');
+		}
+	}
+}

Modified: branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/miscfunctions.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -4,6 +4,11 @@
 #define FOR_EACH_PLAYER(v) for(v = world; (v = find(v, classname, STR_PLAYER)) != world; )
 #define FOR_EACH_REALPLAYER(v) FOR_EACH_PLAYER(v) if(clienttype(v) == CLIENTTYPE_REAL)
 
+// change that to actually calling strcat when running on an engine without
+// unlimited tempstrings:
+// string strcat1(string s) = #115; // FRIK_FILE
+#define strcat1(s) (s)
+
 float logfile_open;
 float logfile;
 
@@ -315,7 +320,7 @@
 		msg_save = strzone(msg);
 		p = p + 2;
 	}
-	msg = strcat(msg_save);
+	msg = strcat(msg_save, "");
 	strunzone(msg_save);
 	return msg;
 }
@@ -471,25 +476,25 @@
 			if(ch2 == "^")
 				out = strcat(out, "^^");
 			else if(ch2 == "0")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "1")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "2")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "3")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "4")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "5")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "6")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "7")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "8")
-				out = strcat(out);
+				out = strcat1(out);
 			else if(ch2 == "9")
-				out = strcat(out);
+				out = strcat1(out);
 			else
 			{
 				n = 1;
@@ -505,6 +510,8 @@
 	}
 	return out;
 }
+#define strdecolorize(s) decolorize(s)
+#define strlennocol(s) strlen(decolorize(s))
 
 #define CENTERPRIO_POINT 1
 #define CENTERPRIO_REBALANCE 2
@@ -541,3 +548,16 @@
 }
 
 void VoteNag();
+
+// decolorizes and team colors the player name when needed
+string playername(entity p)
+{
+	string t;
+	if(teams_matter && !intermission_running && p.classname == "player")
+	{
+		t = Team_ColorCode(p.team);
+		return strcat(t, strdecolorize(p.netname));
+	}
+	else
+		return p.netname;
+}

Modified: branches/nexuiz-2.0/data/qcsrc/server/runematch.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/runematch.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/runematch.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -218,9 +218,9 @@
 	//	RuneName(self.runes & (RUNE_LAST*2-1)), " and "));
 	//sprint(other, strcat(RuneName(self.enemy.runes & (CURSE_WEAK | CURSE_VULNER | CURSE_VENOM | CURSE_SLOW | CURSE_EMPATHY)), "\n"));
 
-	bprint(strcat("^3", other.netname, "^7 has picked up ",
-		RuneName(self.runes & (RUNE_LAST*2-1)), "^7 and "));
-	bprint(strcat(RuneName(self.enemy.runes & (CURSE_WEAK | CURSE_VULNER | CURSE_VENOM | CURSE_SLOW | CURSE_EMPATHY)), "\n"));
+	bprint("^3", other.netname, "^7 has picked up ",
+		RuneName(self.runes & (RUNE_LAST*2-1)), "^7 and ");
+	bprint(RuneName(self.enemy.runes & (CURSE_WEAK | CURSE_VULNER | CURSE_VENOM | CURSE_SLOW | CURSE_EMPATHY)), "\n");
 }
 
 void rune_respawn()
@@ -310,9 +310,9 @@
 	e.velocity = '0 0 200' + '0 100 0'*crandom() + '100 0 0'*crandom();
 
 
-	bprint(strcat("^3", pl.netname, "^7 has lost ",
-		RuneName(e.runes & (RUNE_LAST*2-1)), "^7 and "));
-	bprint(strcat(RuneName(e.enemy.runes & (CURSE_WEAK | CURSE_VULNER | CURSE_VENOM | CURSE_SLOW | CURSE_EMPATHY)), "\n"));
+	bprint("^3", pl.netname, "^7 has lost ",
+		RuneName(e.runes & (RUNE_LAST*2-1)), "^7 and ");
+	bprint(RuneName(e.enemy.runes & (CURSE_WEAK | CURSE_VULNER | CURSE_VENOM | CURSE_SLOW | CURSE_EMPATHY)), "\n");
 }
 
 float RuneMatchesCurse(float r, float c)

Modified: branches/nexuiz-2.0/data/qcsrc/server/t_quake.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/t_quake.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/t_quake.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -42,6 +42,9 @@
 	self.color = '0 0 0';
 	self.style = 0;
 	self.jumppadsused = world;
-	bprint(ftos(sv_maxairspeed), "\n");
+	self.disableclientprediction = 0;
+	self.contentstransition = SUB_Null;
+	self.dphitcontentsmask = 0;
+	trace_dphittexturename = "";
 }
 

Modified: branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/teamplay.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -466,8 +466,8 @@
 
 	if(!noprint && t != s)
 	{
-		//bprint(strcat(pl.netname, " has changed to ", TeamNoName(t), "\n"));
-		bprint(strcat(pl.netname, "^7 has changed from ", TeamNoName(s), " to ", TeamNoName(t), "\n"));
+		//bprint(pl.netname, " has changed to ", TeamNoName(t), "\n");
+		bprint(pl.netname, "^7 has changed from ", TeamNoName(s), " to ", TeamNoName(t), "\n");
 	}
 
 	if(t != s)
@@ -923,7 +923,7 @@
 		}
 	}
 
-//	bprint(strcat("allow change teams from ", ftos(steam), " to ", ftos(dteam), "\n"));
+//	bprint("allow change teams from ", ftos(steam), " to ", ftos(dteam), "\n");
 
 	if(cvar("teamplay") && self.classname == "player" && steam != dteam)
 	{

Modified: branches/nexuiz-2.0/data/qcsrc/server/w_rocketlauncher.qc
===================================================================
--- branches/nexuiz-2.0/data/qcsrc/server/w_rocketlauncher.qc	2007-04-03 21:29:51 UTC (rev 2284)
+++ branches/nexuiz-2.0/data/qcsrc/server/w_rocketlauncher.qc	2007-04-03 21:31:56 UTC (rev 2285)
@@ -131,7 +131,7 @@
 
 			if(self.enemy != world)
 			{
-				//bprint(strcat("Targeting ", self.enemy.owner.netname, "'s laser\n"));
+				//bprint("Targeting ", self.enemy.owner.netname, "'s laser\n");
 				if(!self.speed)
 					self.speed = vlen(self.velocity);
 				e = self.enemy;//self.owner.weaponentity.lasertarget;




More information about the nexuiz-commits mailing list