[nexuiz-commits] r7266 - trunk/data/qcsrc/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Jul 25 13:57:10 EDT 2009


Author: div0
Date: 2009-07-25 13:57:10 -0400 (Sat, 25 Jul 2009)
New Revision: 7266

Modified:
   trunk/data/qcsrc/server/g_triggers.qc
Log:
voice script: - in front of duration means adding no delay


Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc	2009-07-25 16:33:19 UTC (rev 7265)
+++ trunk/data/qcsrc/server/g_triggers.qc	2009-07-25 17:57:10 UTC (rev 7266)
@@ -1500,7 +1500,7 @@
 void target_voicescript_next(entity pl)
 {
 	entity vs;
-	float i, n;
+	float i, n, dt;
 
 	vs = pl.voicescript;
 	if(!vs)
@@ -1529,13 +1529,24 @@
 			if(i >= 0)
 			{
 				play2(pl, strcat(vs.netname, "/", argv(i), ".wav"));
-				pl.voicescript_voiceend = time + stof(argv(i + 1));
+				dt = stof(argv(i + 1));
+				if(dt > 0)
+					pl.voicescript_voiceend = dt;
+				else
+					pl.voicescript_voiceend = -dt;
 			}
 			else
+			{
 				pl.voicescript = world;
+				dt = 0;
+			}
 
 			pl.voicescript_index += 1;
-			pl.voicescript_nextthink = pl.voicescript_voiceend + vs.wait * (0.5 + random());
+
+			if(dt > 0)
+				pl.voicescript_nextthink = pl.voicescript_voiceend + vs.wait * (0.5 + random());
+			else
+				pl.voicescript_nextthink = pl.voicescript_voiceend;
 		}
 	}
 }
@@ -1544,7 +1555,9 @@
 {
 	// netname: directory of the sound files
 	// message: list of "sound file" duration "sound file" duration, a *, and again a list
-	//          foo1 4.1 foo2 4.0 foo3 3.1 * fool1 1.1 fool2 7.1 fool3 9.1 fool4 3.7
+	//          foo1 4.1 foo2 4.0 foo3 -3.1 * fool1 1.1 fool2 7.1 fool3 9.1 fool4 3.7
+	//          Here, a - in front of the duration means that no delay is to be
+	//          added after this message
 	// wait: average time between messages
 	// delay: initial delay before the first message
 	



More information about the nexuiz-commits mailing list