--- deliantra/server/socket/sounds.C 2007/07/26 00:27:09 1.15 +++ deliantra/server/socket/sounds.C 2007/07/26 21:44:43 1.17 @@ -76,6 +76,10 @@ ht.insert (std::make_pair (strdup (str), face)); } +//TODO: remove +// for gcfclient-compatibility, to vanish at some point +faceidx old_sound_index [SOUND_CAST_SPELL_0]; + /* * Plays a sound for specified player only */ @@ -85,20 +89,7 @@ if (!sound) return; - if (this->sound) - { - // gcfclient compatibility - - packet sl ("sound"); - - sl << uint8 (dx) - << uint8 (dy) - << uint16 (sound) - << uint8 (SOUND_NORMAL); - - send_packet (sl); - } - else if (fx_want [FT_SOUND]) + if (fx_want [FT_SOUND]) { // cfplus send_face (sound); @@ -118,5 +109,26 @@ send_packet (sl); } + else if (this->sound) + { + //TODO: remove, or make bearable + // gcfclient compatibility + + int gcfclient_sound; + for (gcfclient_sound = SOUND_CAST_SPELL_0; gcfclient_sound--; ) + if (old_sound_index [gcfclient_sound] == sound) + { + packet sl ("sound"); + + sl << uint8 (dx) + << uint8 (dy) + << uint16 (gcfclient_sound) + << uint8 (SOUND_NORMAL); + + send_packet (sl); + + break; + } + } }