ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/map.C
(Generate patch)

Comparing deliantra/server/common/map.C (file contents):
Revision 1.150 by root, Thu Dec 4 03:48:19 2008 UTC vs.
Revision 1.153 by root, Tue Dec 23 06:58:23 2008 UTC

24#include <unistd.h> 24#include <unistd.h>
25 25
26#include "global.h" 26#include "global.h"
27#include "loader.h" 27#include "loader.h"
28#include "path.h" 28#include "path.h"
29
30sint8 maptile::outdoor_darkness;
29 31
30/* This rolls up wall, blocks_magic, blocks_view, etc, all into 32/* This rolls up wall, blocks_magic, blocks_view, etc, all into
31 * one function that just returns a P_.. value (see map.h) 33 * one function that just returns a P_.. value (see map.h)
32 * it will also do map translation for tiled maps, returning 34 * it will also do map translation for tiled maps, returning
33 * new values into newmap, nx, and ny. Any and all of those 35 * new values into newmap, nx, and ny. Any and all of those
963/* 965/*
964 * This routine is supposed to find out the difficulty of the map. 966 * This routine is supposed to find out the difficulty of the map.
965 * difficulty does not have a lot to do with character level, 967 * difficulty does not have a lot to do with character level,
966 * but does have a lot to do with treasure on the map. 968 * but does have a lot to do with treasure on the map.
967 * 969 *
968 * Difficulty can now be set by the map creature. If the value stored 970 * Difficulty can now be set by the map creator. If the value stored
969 * in the map is zero, then use this routine. Maps should really 971 * in the map is zero, then use this routine. Maps should really
970 * have a difficulty set than using this function - human calculation 972 * have a difficulty set rather than using this function - human calculation
971 * is much better than this functions guesswork. 973 * is much better than this function's guesswork.
972 */ 974 */
973int 975int
974maptile::estimate_difficulty () const 976maptile::estimate_difficulty () const
975{ 977{
976 long monster_cnt = 0; 978 long monster_cnt = 0;
1625maptile::play_sound (faceidx sound, int x, int y) const 1627maptile::play_sound (faceidx sound, int x, int y) const
1626{ 1628{
1627 if (!sound) 1629 if (!sound)
1628 return; 1630 return;
1629 1631
1630 for_all_players (pl) 1632 for_all_players_on_map (pl, this)
1631 if (pl->ob->map == this)
1632 if (client *ns = pl->ns) 1633 if (client *ns = pl->ns)
1633 { 1634 {
1634 int dx = x - pl->ob->x; 1635 int dx = x - pl->ob->x;
1635 int dy = y - pl->ob->y; 1636 int dy = y - pl->ob->y;
1636 1637
1637 int distance = idistance (dx, dy); 1638 int distance = idistance (dx, dy);
1638 1639
1639 if (distance <= MAX_SOUND_DISTANCE) 1640 if (distance <= MAX_SOUND_DISTANCE)
1640 ns->play_sound (sound, dx, dy); 1641 ns->play_sound (sound, dx, dy);
1641 } 1642 }
1642} 1643}
1643 1644

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines