… | |
… | |
1604 | if (distance <= MAX_SOUND_DISTANCE) |
1604 | if (distance <= MAX_SOUND_DISTANCE) |
1605 | ns->play_sound (sound, dx, dy); |
1605 | ns->play_sound (sound, dx, dy); |
1606 | } |
1606 | } |
1607 | } |
1607 | } |
1608 | |
1608 | |
|
|
1609 | void |
|
|
1610 | maptile::say_msg (const char *msg, int x, int y) const |
|
|
1611 | { |
|
|
1612 | for_all_players (pl) |
|
|
1613 | if (client *ns = pl->ns) |
|
|
1614 | { |
|
|
1615 | int dx = x - pl->ob->x; |
|
|
1616 | int dy = y - pl->ob->y; |
|
|
1617 | |
|
|
1618 | int distance = idistance (dx, dy); |
|
|
1619 | |
|
|
1620 | if (distance <= MAX_SOUND_DISTANCE) |
|
|
1621 | ns->send_msg (NDI_GREY | NDI_DEF, SAY_CHANNEL, msg); |
|
|
1622 | } |
|
|
1623 | } |
|
|
1624 | |
1609 | static void |
1625 | static void |
1610 | split_to_tiles (dynbuf &buf, maptile *m, int x0, int y0, int x1, int y1, int dx, int dy) |
1626 | split_to_tiles (dynbuf &buf, maptile *m, int x0, int y0, int x1, int y1, int dx, int dy) |
1611 | { |
1627 | { |
1612 | // clip to map to the left |
1628 | // clip to map to the left |
1613 | if (x0 < 0) |
1629 | if (x0 < 0) |