[nexuiz-commits] r6501 - in trunk/data/qcsrc: client server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Apr 16 05:58:22 EDT 2009
Author: div0
Date: 2009-04-16 05:58:22 -0400 (Thu, 16 Apr 2009)
New Revision: 6501
Modified:
trunk/data/qcsrc/client/particles.qc
trunk/data/qcsrc/server/g_triggers.qc
Log:
more fixes for pointparticles bgm script
Modified: trunk/data/qcsrc/client/particles.qc
===================================================================
--- trunk/data/qcsrc/client/particles.qc 2009-04-16 09:09:35 UTC (rev 6500)
+++ trunk/data/qcsrc/client/particles.qc 2009-04-16 09:58:22 UTC (rev 6501)
@@ -76,7 +76,6 @@
.float scriptline;
.float scriptline0;
-.float scriptstate;
.float scriptvelocity;
.float scripttime;
.float switchedon;
@@ -124,30 +123,38 @@
if(t < e.scripttime)
{
e.scriptline = e.scriptline0;
- e.scriptstate = 0;
+ e.scripttime = 0;
tokenize_sane(bufstr_get(pointparticles_scriptbuf, e.scriptline));
}
if(argv(0) != e.bgmscript)
{
- e.scriptstate = 0; // end of script, will revert to beginning later
+ // end of script, will revert to beginning later
}
else if(t >= stof(argv(1)))
{
// time code reached!
e.scriptvelocity = stof(argv(2));
if(e.scriptvelocity > 0)
+ {
e.switchedon = TRUE;
- e.scripttime = stof(argv(1));
+ e.scripttime = stof(argv(1));
+ }
+ else
+ e.scripttime = 0;
e.scriptline += 1;
}
- if(e.scriptstate)
+ if(e.scripttime)
{
if(e.bgmscriptdecay >= 1)
- return (e.scriptstate == 2);
+ {
+ return e.switchedon;
+ }
else
+ {
return pow(0.5, (t - e.scripttime) * (e.bgmscriptdecay / (1 - e.bgmscriptdecay))) * e.scriptvelocity;
+ }
}
else
return 0;
@@ -272,7 +279,8 @@
}
else
{
- self.waterlevel = self.count = self.glow_color = 0;
+ self.waterlevel = self.glow_color = 0;
+ self.count = 1;
}
if(self.noise)
strunzone(self.noise);
Modified: trunk/data/qcsrc/server/g_triggers.qc
===================================================================
--- trunk/data/qcsrc/server/g_triggers.qc 2009-04-16 09:09:35 UTC (rev 6500)
+++ trunk/data/qcsrc/server/g_triggers.qc 2009-04-16 09:58:22 UTC (rev 6501)
@@ -566,7 +566,7 @@
fl |= 0x10; // 2 bytes
if(self.movedir != '0 0 0' || self.velocity != '0 0 0')
fl |= 0x20; // 4 bytes - saves CPU
- if(self.glow_color || self.waterlevel || self.glow_color)
+ if(self.glow_color || self.waterlevel || self.count != 1)
fl |= 0x40; // 4 bytes - obscure features almost never used
if(self.mins != '0 0 0' || self.maxs != '0 0 0')
fl |= 0x80; // 14 bytes - saves lots of space
@@ -675,6 +675,8 @@
self.atten = 0;
if(!self.volume)
self.volume = 1;
+ if(!self.count)
+ self.count = 1;
if(!self.modelindex)
{
More information about the nexuiz-commits
mailing list