r4860 - in trunk/data: qcsrc/server scripts

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Oct 24 05:06:56 EDT 2008


Author: div0
Date: 2008-10-24 05:06:45 -0400 (Fri, 24 Oct 2008)
New Revision: 4860

Modified:
   trunk/data/qcsrc/server/g_hook.qc
   trunk/data/qcsrc/server/miscfunctions.qc
   trunk/data/qcsrc/server/portals.qc
   trunk/data/qcsrc/server/sv_main.qc
   trunk/data/qcsrc/server/target_spawn.qc
   trunk/data/qcsrc/server/w_porto.qc
   trunk/data/scripts/entities.def
Log:
more fixes - now we can have a companion cube :P


Modified: trunk/data/qcsrc/server/g_hook.qc
===================================================================
--- trunk/data/qcsrc/server/g_hook.qc	2008-10-24 08:03:21 UTC (rev 4859)
+++ trunk/data/qcsrc/server/g_hook.qc	2008-10-24 09:06:45 UTC (rev 4860)
@@ -222,7 +222,7 @@
 				dv = ((self.owner.velocity - v0) * dir) * dir;
 				if(cvar("g_grappling_hook_tarzan") >= 2)
 				{
-					if(self.aiment.movetype == MOVETYPE_WALK || self.aiment.movetype == MOVETYPE_TOSS)
+					if(self.aiment.movetype == MOVETYPE_WALK)
 					{
 						self.owner.velocity = self.owner.velocity - dv * 0.5;
 						self.aiment.velocity = self.aiment.velocity - dv * 0.5;

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2008-10-24 08:03:21 UTC (rev 4859)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2008-10-24 09:06:45 UTC (rev 4860)
@@ -1292,6 +1292,12 @@
 	objerror_builtin(s);
 }
 
+void remove_unsafely(entity e)
+{
+	e.classname = "";
+	remove_builtin(e);
+}
+
 void remove_safely(entity e)
 {
 	make_safe_for_remove(e);

Modified: trunk/data/qcsrc/server/portals.qc
===================================================================
--- trunk/data/qcsrc/server/portals.qc	2008-10-24 08:03:21 UTC (rev 4859)
+++ trunk/data/qcsrc/server/portals.qc	2008-10-24 09:06:45 UTC (rev 4860)
@@ -239,6 +239,9 @@
 		return; // only handle TouchAreaGrid ones (only these can teleport)
 		// for some unknown reason, this also gets collisions from SV_Impact sometimes
 
+	if(other.classname == "grapplinghook")
+		return;
+
 	if(other.classname == "porto")
 	{
 		if(other.portal_id == self.portal_id)
@@ -261,12 +264,15 @@
 	fixedmakevectors(self.angles);
 	if((other.origin - self.origin) * v_forward < 0)
 		return;
+
+	/*
 	if(other.mins_x < PL_MIN_x || other.mins_y < PL_MIN_y || other.mins_z < PL_MIN_z
 	|| other.maxs_x > PL_MAX_x || other.maxs_y > PL_MAX_y || other.maxs_z > PL_MAX_z)
 	{
 		// can't teleport this
 		return;
 	}
+	*/
 
 	if(Portal_TeleportPlayer(self, other))
 		if(other.classname == "porto")

Modified: trunk/data/qcsrc/server/sv_main.qc
===================================================================
--- trunk/data/qcsrc/server/sv_main.qc	2008-10-24 08:03:21 UTC (rev 4859)
+++ trunk/data/qcsrc/server/sv_main.qc	2008-10-24 09:06:45 UTC (rev 4860)
@@ -133,7 +133,7 @@
 entity SelectSpawnPoint (float anypoint);
 void StartFrame (void)
 {
-	remove = remove_builtin; // not during spawning!
+	remove = remove_unsafely; // not during spawning!
 
 	dprint_load(); // load dprint status from cvar
 

Modified: trunk/data/qcsrc/server/target_spawn.qc
===================================================================
--- trunk/data/qcsrc/server/target_spawn.qc	2008-10-24 08:03:21 UTC (rev 4859)
+++ trunk/data/qcsrc/server/target_spawn.qc	2008-10-24 09:06:45 UTC (rev 4860)
@@ -12,6 +12,16 @@
 .float target_spawn_id;
 float target_spawn_count;
 
+void target_spawn_helper_setmodel()
+{
+	setmodel(self, self.model);
+}
+
+void target_spawn_helper_setsize()
+{
+	setsize(self, self.mins, self.maxs);
+}
+
 void target_spawn_useon(entity e)
 {
 	float i, n, valuefieldpos;
@@ -172,6 +182,8 @@
 		}
 		if(key == "$")
 		{
+			if(substring(value, 0, 1) == "_")
+				value = strcat("target_spawn_helper", value);
 			putentityfieldstring(target_spawn_spawnfunc_field, e, value);
 
 			oldself = self;
@@ -320,4 +332,3 @@
 {
 	self.use = trigger_relay_if_use;
 };
-

Modified: trunk/data/qcsrc/server/w_porto.qc
===================================================================
--- trunk/data/qcsrc/server/w_porto.qc	2008-10-24 08:03:21 UTC (rev 4859)
+++ trunk/data/qcsrc/server/w_porto.qc	2008-10-24 09:06:45 UTC (rev 4860)
@@ -78,7 +78,7 @@
 	norm = trace_plane_normal;
 	if(trace_ent.iscreature)
 	{
-		traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * PL_MIN_z, MOVE_NORMAL, self);
+		traceline(trace_ent.origin, trace_ent.origin + '0 0 2' * PL_MIN_z, MOVE_WORLDONLY, self);
 		if(trace_fraction >= 1)
 			return;
 		if(trace_dphitq3surfaceflags & Q3SURFACEFLAG_SLICK || trace_dphitcontents & DPCONTENTS_PLAYERCLIP)

Modified: trunk/data/scripts/entities.def
===================================================================
--- trunk/data/scripts/entities.def	2008-10-24 08:03:21 UTC (rev 4859)
+++ trunk/data/scripts/entities.def	2008-10-24 09:06:45 UTC (rev 4860)
@@ -1086,6 +1086,7 @@
 The entity field list is a single string of the form:
 'field' 'value' 'field' 'value' ... 'classname' 'item_bullets' ... 'field' 'value'
 The special "field" name $ calls a void(void) function, for example a spawn function.
+Special function names available are _setmodel and _setsize.
 Field values can use various variable replacements:
 $E
 $E.field




More information about the nexuiz-commits mailing list