7 void Net_AdvanceMusic()
9 // run AFTER all the thinks!
13 if(music_target && time < music_target.lifetime)
17 for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); )
24 e.state = min(1, e.state + frametime / e.fade_time);
32 e.state = max(1, e.state - frametime / e.fade_rate);
37 sound(e, CHAN_PROJECTILE, "", e.volume * e.state, ATTN_NONE);
39 music_trigger = world;
42 void Net_TargetMusic()
44 float vol, fai, fao, tim, id;
49 vol = ReadByte() / 255.0;
50 fai = ReadByte() / 16.0;
51 fao = ReadByte() / 16.0;
55 for(e = world; (e = findfloat(e, enttype, ENT_CLIENT_TRIGGER_MUSIC)); )
63 e.enttype = ENT_CLIENT_TRIGGER_MUSIC;
66 e.noise = strzone(noi);
67 sound(e, CHAN_PROJECTILE, self.noise, 0, ATTN_NONE);
81 e.lifetime = time + tim;
86 void Ent_TriggerMusic_Think()
88 if(WarpZoneLib_BoxTouchesBrush(view_origin, view_origin, self, world))
90 self.nextthink = time;
93 void Ent_TriggerMusic_Remove()
96 strunzone(self.noise);
97 self.noise = string_null;
100 void Ent_ReadTriggerMusic()
106 self.origin_x = ReadCoord();
107 self.origin_y = ReadCoord();
108 self.origin_z = ReadCoord();
112 self.modelindex = ReadShort();
115 self.mins_x = ReadCoord();
116 self.mins_y = ReadCoord();
117 self.mins_z = ReadCoord();
118 self.maxs_x = ReadCoord();
119 self.maxs_y = ReadCoord();
120 self.maxs_z = ReadCoord();
125 self.maxs_x = ReadCoord();
126 self.maxs_y = ReadCoord();
127 self.maxs_z = ReadCoord();
130 self.volume = ReadByte() / 255.0;
131 self.fade_time = ReadByte() / 16.0;
132 self.fade_rate = ReadByte() / 16.0;
134 strunzone(self.noise);
135 self.noise = strzone(ReadString());
139 self.think = Ent_TriggerMusic_Think;
140 self.nextthink = time;