// attack: from 0 to 1, in time a for a full length
// decay: from 1 to s, in time d
// sustain: s
-
+
if(t < 0)
return 0;
-
+
if(a)
if(t <= a)
return t / a;
if(!r)
return 0;
-
+
if(t > r)
return 0;
-
+
releaseval = s * (1 - t / r);
if(t < -d)
if(!s)
return 0;
-
+
// if amp > s, we may be in the attack or in the prolonged decay curve
releasetime = (1 - amp / s) * r;
e.bgmscriptline = e.bgmscriptline0 = i;
if(i >= bgmscriptbufsize)
{
- print(sprintf("ERROR: bgmscript does not define %s\n", e.bgmscript));
- e.bgmscript = "";
+ printf("ERROR: bgmscript does not define %s\n", e.bgmscript);
+ strunzone(e.bgmscript);
+ e.bgmscript = string_null;
}
}
}
if(e.bgmscript == "")
return 1;
-
+
if(autocvar_bgmvolume <= 0)
return -1;