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.16 by root, Thu Jul 26 00:38:34 2007 UTC vs.
Revision 1.17 by root, Thu Jul 26 21:44:43 2007 UTC

74 i->second = face; 74 i->second = face;
75 else 75 else
76 ht.insert (std::make_pair (strdup (str), face)); 76 ht.insert (std::make_pair (strdup (str), face));
77} 77}
78 78
79//TODO: remove
80// for gcfclient-compatibility, to vanish at some point
81faceidx old_sound_index [SOUND_CAST_SPELL_0];
82
79/* 83/*
80 * Plays a sound for specified player only 84 * Plays a sound for specified player only
81 */ 85 */
82void 86void
83client::play_sound (faceidx sound, int dx, int dy) 87client::play_sound (faceidx sound, int dx, int dy)
105 109
106 send_packet (sl); 110 send_packet (sl);
107 } 111 }
108 else if (this->sound) 112 else if (this->sound)
109 { 113 {
114 //TODO: remove, or make bearable
110 // gcfclient compatibility 115 // gcfclient compatibility
111 // fetch compatibility sound index first
112 116
117 int gcfclient_sound;
118 for (gcfclient_sound = SOUND_CAST_SPELL_0; gcfclient_sound--; )
119 if (old_sound_index [gcfclient_sound] == sound)
120 {
113 packet sl ("sound"); 121 packet sl ("sound");
114 122
115 sl << uint8 (dx) 123 sl << uint8 (dx)
116 << uint8 (dy) 124 << uint8 (dy)
117 << uint16 (sound) 125 << uint16 (gcfclient_sound)
118 << uint8 (SOUND_NORMAL); 126 << uint8 (SOUND_NORMAL);
119 127
120 send_packet (sl); 128 send_packet (sl);
129
130 break;
131 }
121 } 132 }
122} 133}
123 134

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines