35 #define MAX_SOUND_DISTANCE 10 61 if (!emitter->map && !(emitter->env && emitter->env->map))
64 source = emitter->map ? emitter : emitter->env;
67 int dx =
FABS(source->x-pl->
ob->x),
68 dy =
FABS(source->y-pl->
ob->y);
69 int distance = (
MIN(dx, dy) * 3 +
FABS(dx-dy) * 2) / 2;
73 volume = distance ? volume / distance : volume;
77 name = emitter->type == PLAYER ? emitter->race : emitter->name;
94 #define POW2(x) ((x)*(x)) 111 if (!emitter->map && !(emitter->env && emitter->env->map))
114 source = emitter->map ? emitter : emitter->env;
117 if (pl->
ob->map == emitter->map) {
156 assert(player->contr);
157 assert(player->type == PLAYER);
void SockList_Init(SockList *sl)
void play_sound_player_only(player *pl, int8_t sound_type, object *emitter, int dir, const char *action)
void send_background_music(player *pl, const char *music)
#define MAX_SOUND_DISTANCE
static char const * pick_bg_music(mapstruct map[static 1])
void play_sound_map(int8_t sound_type, object *emitter, int dir, const char *action)
void SockList_Term(SockList *sl)
void player_update_bg_music(object player[static 1])
void SockList_AddString(SockList *sl, const char *data)
void SockList_AddChar(SockList *sl, unsigned char c)
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
const char * get_name_of_region_for_map(const mapstruct *m)
EXTERN player * first_player
void Send_With_Handling(socket_struct *ns, SockList *sl)