Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Slightly modified code originally made by Rook, modified a bit by Cobalt
- //
- //placed in subs.qc
- //
- vector (vector m1, vector m2) Rvec =
- {
- local vector v;
- m2 = m2 - m1;
- v_x = m2_x * random() + m1_x;
- v_y = m2_y * random() + m1_y;
- v_z = m2_z * random() + m1_z;
- return v;
- };
- //
- // Placed in world.qc
- //
- void () place_weathernoise =
- {
- local vector sound1
- sound1 = Rvec(self.dest1,self.dest2);
- // coordinate has to be CONTENT_EMPTY, no sense spawning noise inside a solid, or in a liquid
- if ((pointcontents (sound1) == -1))
- {
- // Spawn some test models just so we can assure they are within the bounding box supplied for that map
- local entity q;
- q = spawn ();
- q.classname = "pointsound";
- q.origin = sound1;
- setorigin (q, sound1);
- setmodel (q, "progs/s_bubble.spr");
- setsize (q, '-8 -8 -8', '8 8 8');
- // Generate the sound
- pointsound (sound1, "weather/nodrip1.wav", 1, 1);
- }
- else
- place_weathernoise (); // Repeat this function again, till we are in CONTENT_EMPTY location...did not think it would compile but it did !
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement