--- deliantra/server/include/map.h 2007/09/04 05:43:21 1.87 +++ deliantra/server/include/map.h 2007/09/12 11:10:10 1.88 @@ -105,11 +105,6 @@ #define P_NEW_MAP 0x20000 /* Coordinates passed result in a new tiled map */ -/* P_NO_PASS is used for ob_blocked() return value. It needs - * to be here to make sure the bits don't match with anything. - */ -#define P_NO_PASS 0x80000 - /* Instead of having numerous arrays that have information on a * particular space (was map, floor, floor2, map_ob), * have this structure take care of that information. @@ -156,6 +151,11 @@ // return the item volume on this mapspace in cm³ uint64 volume () const; + + bool blocks (MoveType mt) const + { + return move_block && (mt & move_block) == mt; + } }; struct shopitems : zero_initialised @@ -350,10 +350,10 @@ object *part; }; +// comaptibility cruft start //TODO: these should be refactored into things like xy_normalise // and so on. int get_map_flags (maptile *oldmap, maptile **newmap, sint16 x, sint16 y, sint16 *nx, sint16 *ny); -int ob_blocked (const object *ob, maptile *m, sint16 x, sint16 y); int out_of_map (maptile *m, int x, int y); maptile *get_map_from_coord (maptile *m, sint16 *x, sint16 *y); void get_rangevector (object *op1, object *op2, rv_vector *retval, int flags); @@ -362,7 +362,7 @@ int adjacent_map (const maptile *map1, const maptile *map2, int *dx, int *dy); // adjust map, x and y for tiled maps and return true if the position is valid at all -inline bool +static inline bool xy_normalise (maptile *&map, sint16 &x, sint16 &y) { // when in range, do a quick return, otherwise go the slow route @@ -370,6 +370,7 @@ (IN_RANGE_EXC (x, 0, map->width) && IN_RANGE_EXC (y, 0, map->height)) || !(get_map_flags (map, &map, x, y, &x, &y) & P_OUT_OF_MAP); } +// comaptibility cruft end inline mapspace & object::ms () const @@ -377,7 +378,6 @@ return map->at (x, y); } -// not used anywhere *yet* struct mapxy { maptile *m; sint16 x, y; @@ -409,7 +409,7 @@ } mapspace *operator ->() const { return &m->at (x, y); } - mapspace *operator * () const { return &m->at (x, y); } + mapspace &operator * () const { return m->at (x, y); } bool normalise () {