ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/sounds.C
(Generate patch)

Comparing deliantra/server/socket/sounds.C (file contents):
Revision 1.17 by root, Thu Jul 26 21:44:43 2007 UTC vs.
Revision 1.19 by root, Tue Jul 31 01:06:20 2007 UTC

93 { 93 {
94 // cfplus 94 // cfplus
95 send_face (sound); 95 send_face (sound);
96 flush_fx (); 96 flush_fx ();
97 97
98 uint8 vol = clamp (255 - idistance (dx, dy) * 255 / 10, 0, 255);
99
100 // cut off volume here
101 if (vol < 16)
102 return;
103
98 packet sl ("sc"); 104 packet sl ("sc");
99 105
100 uint8 *len = sl.cur; 106 uint8 *len = sl.cur;
101 107
102 sl << uint8 (0) // group length 108 sl << uint8 (0) // group length
103 << uint8 (0) // type == one-time effect 109 << uint8 (0) // type == one-time effect
104 << ber32 (sound) 110 << ber32 (sound)
105 << sint8 (dx) 111 << sint8 (dx)
106 << sint8 (dy); 112 << sint8 (dy)
113 << uint8 (vol); // 0 == silent, 255 max
107 114
108 *len = sl.cur - len; // patch in group length 115 *len = sl.cur - len; // patch in group length
109 116
110 send_packet (sl); 117 send_packet (sl);
111 } 118 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines