--- deliantra/server/include/map.h 2006/08/15 17:35:50 1.8 +++ deliantra/server/include/map.h 2006/08/29 09:27:58 1.14 @@ -34,6 +34,8 @@ #ifndef MAP_H #define MAP_H +#include "cfperl.h" + /* We set this size - this is to make magic map work properly on * tiled maps. There is no requirement that this matches the * tiled maps size - it just seemed like a reasonable value. @@ -157,7 +159,7 @@ #define AB_NO_PASS 0x04 /*#define P_PASS_THRU 0x08 *//* */ -#define P_SAFE 0x08 /* If this is set the map is a safe map, +#define P_SAFE 0x08 /* If this is set the map tile is a safe map, * that means, nothing harmful there will be done, * like: bombs, potion usage, alchemy, spells * this was introduced to make shops more safe @@ -226,8 +228,8 @@ uint32 rainfall; /* cumulative rainfall */ uint8 darkness; /* indicates level of darkness of map */ uint8 water; /* 0-100 percentage of water tiles */ - /*Dynamic parts*/ - sint16 realtemp; /* temperature at a given calculation step for this tile*/ + /*Dynamic parts*/ + sint16 realtemp; /* temperature at a given calculation step for this tile*/ }; /* @@ -240,15 +242,15 @@ const char *parent_name; /* * So that parent and child regions can be defined in * any order, we keep hold of the parent_name during - * initialisation, and the children get assigned to their - * parents later. (before runtime on the server though) - * nothing outside the init code should ever use this value. - */ + * initialisation, and the children get assigned to their + * parents later. (before runtime on the server though) + * nothing outside the init code should ever use this value. + */ struct region *parent; /* * Pointer to the region that is a parent of the current * region, if a value isn't defined in the current region - * we traverse this series of pointers until it is. - */ + * we traverse this series of pointers until it is. + */ const char *longname; /* Official title of the region, this might be defined * to be the same as name*/ const char *msg; /* the description of the region */ @@ -265,7 +267,7 @@ const char *name_pl; /* plural name */ int typenum; /* itemtype number we need to match 0 if it is the default price*/ sint8 strength; /* the degree of specialisation the shop has in this item, - * as a percentage from -100 to 100 */ + * as a percentage from -100 to 100 */ int index; /* being the size of the shopitems array.*/ }; @@ -277,20 +279,22 @@ * (or even through the macros), but doing so will completely * break map tiling. */ -struct mapstruct { +struct mapstruct : attachable { + static data_type get_dt () { return DT_MAP; } + struct mapstruct *next; /* Next map, linked list */ char *tmpname; /* Name of temporary file */ char *name; /* Name of map as given by its creator */ struct region *region; /* What jurisdiction in the game world this map is ruled by * points to the struct containing all the properties of - * the region */ + * the region */ uint32 reset_time; /* when this map should reset */ uint32 reset_timeout; /* How many seconds must elapse before this map - * should be reset - */ + * should be reset + */ uint32 fixed_resettime:1; /* if true, reset time is not affected by - * players entering/exiting map - */ + * players entering/exiting map + */ uint32 unique:1; /* if set, this is a per player unique map */ uint32 safe_map:1; /* if set, this map doesn't allow using magic or harmful stuff in any way */ uint32 templatemap:1; /* if set, this is a template map */ @@ -299,9 +303,8 @@ sint32 swap_time; /* When it reaches 0, the map will be swapped out */ sint16 players; /* How many plares are on this level right now */ uint32 in_memory; /* If not true, the map has been freed and must - * be loaded before used. The map,omap and map_ob - * arrays will be allocated when the map is loaded */ - uint8 compressed; /* Compression method used */ + * be loaded before used. The map,omap and map_ob + * arrays will be allocated when the map is loaded */ uint16 difficulty; /* What level the player should be to play here */ uint8 darkness; /* indicates level of darkness of map */ @@ -347,8 +350,4 @@ object *part; }; -extern void (*load_original_map_callback)(mapstruct *map); -extern void (*load_temporary_map_callback)(mapstruct *map); -extern void (*clean_temporary_map_callback)(mapstruct *map); - #endif