r4143 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Aug 22 07:08:26 EDT 2008


Author: div0
Date: 2008-08-22 07:08:26 -0400 (Fri, 22 Aug 2008)
New Revision: 4143

Modified:
   trunk/data/qcsrc/server/g_triggers.qc
   trunk/data/qcsrc/server/miscfunctions.qc
   trunk/data/qcsrc/server/t_halflife.qc
Log:
also make trigger_hurt, func_ladder and trigger_impulse exact triggers. Tell me what's borked now.


Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc	2008-08-22 11:01:02 UTC (rev 4142)
+++ trunk/data/qcsrc/server/g_triggers.qc	2008-08-22 11:08:26 UTC (rev 4143)
@@ -355,17 +355,25 @@
 .float triggerhurttime;
 void trigger_hurt_touch()
 {
+	// only do the EXACTTRIGGER_TOUCH checks when really needed (saves some cpu)
 	if (!other.owner)
 	{
 		if (other.items & IT_KEY1 || other.items & IT_KEY2)	// reset flag
+		{
+			EXACTTRIGGER_TOUCH;
 			other.pain_finished = min(other.pain_finished, time + 2);
+		}
 		else if (other.classname == "rune")			// reset runes
+		{
+			EXACTTRIGGER_TOUCH;
 			other.nextthink = min(other.nextthink, time + 1);
+		}
 	}
 
 	if (other.takedamage)
 	if (other.triggerhurttime < time)
 	{
+		EXACTTRIGGER_TOUCH;
 		other.triggerhurttime = time + 1;
 		Damage (other, self, self, self.dmg, DEATH_HURTTRIGGER, other.origin, '0 0 0');
 	}
@@ -713,6 +721,8 @@
 	if (other.deadflag && other.classname == "player")
 		return;
 
+	EXACTTRIGGER_TOUCH;
+
     targ = find(world, targetname, self.target);
     if(!targ)
     {
@@ -758,6 +768,8 @@
 	if (other.deadflag && other.classname == "player")
 		return;
 
+	EXACTTRIGGER_TOUCH;
+
     pushdeltatime = time - other.lastpushtime;
     if (pushdeltatime > 0.15) pushdeltatime = 0;
     other.lastpushtime = time;
@@ -792,6 +804,8 @@
 	if (other.deadflag && other.classname == "player")
 		return;
 
+	EXACTTRIGGER_TOUCH;
+
     pushdeltatime = time - other.lastpushtime;
     if (pushdeltatime > 0.15) pushdeltatime = 0;
     other.lastpushtime = time;
@@ -831,7 +845,7 @@
 
 void spawnfunc_trigger_impulse()
 {
-    InitTrigger ();
+	EXACTTRIGGER_INIT;
     if(self.radius)
     {
         if(!self.strength) self.strength = 2000;

Modified: trunk/data/qcsrc/server/miscfunctions.qc
===================================================================
--- trunk/data/qcsrc/server/miscfunctions.qc	2008-08-22 11:01:02 UTC (rev 4142)
+++ trunk/data/qcsrc/server/miscfunctions.qc	2008-08-22 11:08:26 UTC (rev 4143)
@@ -1172,6 +1172,9 @@
 {
 	float f, s;
 
+	if not(self.modelindex)
+		return 1;
+
 	s = self.solid;
 	self.solid = SOLID_BSP;
 	ExactTriggerHit_mins = other.absmin + '1 1 1';

Modified: trunk/data/qcsrc/server/t_halflife.qc
===================================================================
--- trunk/data/qcsrc/server/t_halflife.qc	2008-08-22 11:01:02 UTC (rev 4142)
+++ trunk/data/qcsrc/server/t_halflife.qc	2008-08-22 11:08:26 UTC (rev 4143)
@@ -39,19 +39,22 @@
 {
 	if (other.classname != "player")
 		return;
+
+	EXACTTRIGGER_TOUCH;
+
 	other.ladder_time = time + 0.1;
 	other.ladder_entity = self;
 };
 
 void spawnfunc_func_ladder()
 {
-	InitTrigger ();
+	EXACTTRIGGER_INIT;
 	self.touch = func_ladder_touch;
 };
 
 void spawnfunc_func_water()
 {
-	InitTrigger ();
+	EXACTTRIGGER_INIT;
 	self.touch = func_ladder_touch;
 };
 




More information about the nexuiz-commits mailing list