… | |
… | |
1625 | maptile::play_sound (faceidx sound, int x, int y) const |
1625 | maptile::play_sound (faceidx sound, int x, int y) const |
1626 | { |
1626 | { |
1627 | if (!sound) |
1627 | if (!sound) |
1628 | return; |
1628 | return; |
1629 | |
1629 | |
1630 | for_all_players (pl) |
1630 | for_all_players_on_map (pl, this) |
1631 | if (pl->ob->map == this) |
|
|
1632 | if (client *ns = pl->ns) |
1631 | if (client *ns = pl->ns) |
1633 | { |
1632 | { |
1634 | int dx = x - pl->ob->x; |
1633 | int dx = x - pl->ob->x; |
1635 | int dy = y - pl->ob->y; |
1634 | int dy = y - pl->ob->y; |
1636 | |
1635 | |
1637 | int distance = idistance (dx, dy); |
1636 | int distance = idistance (dx, dy); |
1638 | |
1637 | |
1639 | if (distance <= MAX_SOUND_DISTANCE) |
1638 | if (distance <= MAX_SOUND_DISTANCE) |
1640 | ns->play_sound (sound, dx, dy); |
1639 | ns->play_sound (sound, dx, dy); |
1641 | } |
1640 | } |
1642 | } |
1641 | } |
1643 | |
1642 | |