Go to the documentation of this file.
46 "floor",
"no_pick",
"no_pick",
"item",
"item",
47 "item",
"living",
"living",
"fly",
"fly"
175 snprintf(
t,
buf+size-
t,
"%s", s);
214 return(_access(
buf, 0));
217 if (stat(
buf, &statbuf) != 0)
220 if (!S_ISREG(statbuf.st_mode))
223 if (((statbuf.st_mode&
S_IRGRP) && getegid() == statbuf.st_gid)
224 || ((statbuf.st_mode&
S_IRUSR) && geteuid() == statbuf.st_uid)
228 if ((statbuf.st_mode&
S_IWGRP && getegid() == statbuf.st_gid)
229 || (statbuf.st_mode&
S_IWUSR && geteuid() == statbuf.st_uid)
253 if (
m->maplore != NULL)
256 if (
m->tmpname != NULL)
353 LOG(
llevError,
"blocked_link: Passed map, x, y coordinates outside of map\n");
364 mflags =
m->spaces[sx+
m->width*sy].flags;
551 for (at =
tmp->arch->more, last =
tmp; at != NULL; at = at->
more, last =
op) {
559 if (
tmp->name !=
op->name) {
564 if (
tmp->title !=
op->title) {
594 if (
tmp->head ||
tmp->more)
615 object *
op, *prev = NULL, *last_more = NULL;
621 while ((i =
load_object(fp,
op, bufstate, mapflags,
false))) {
632 if (
op->arch == NULL) {
633 LOG(
llevDebug,
"Discarding object without arch: %s\n",
op->name ?
op->name :
"(null)");
642 LOG(
llevError,
"Discarding invalid item with type PLAYER in map %s\n",
m->path);
648 LOG(
llevError,
" object %s not on valid map position %s:%d:%d\n",
op->name ?
op->name :
"(null)",
m->path,
op->x,
op->y);
691 "load_objects on %s took %ld us\n",
m->path, diff));
692 for (i = 0; i <
m->width; i++) {
693 for (j = 0; j <
m->height; j++) {
726 int i, j = 0, unique = 0;
727 unsigned int count = 0;
732 long serialize_time, write_time;
773 LOG(
llevDebug,
"saved %d objects on %s (%ld us serializing, %ld us writing)\n",
count,
m->path, serialize_time, write_time);
820 map->last_reset_time = 0;
826 return (uint32_t)
m->width * (uint32_t)
m->height;
846 LOG(
llevError,
"allocate_map called with already allocated map (%s)\n",
m->path);
852 if (
m->spaces == NULL)
892 char *shop_string, *p, *
q, *next_semicolon, *next_colon;
894 int i = 0, number_of_entries = 0;
922 for (i = 0; i < number_of_entries; i++) {
924 LOG(
llevError,
"parse_shop_string: I seem to have run out of string, that shouldn't happen.\n");
927 next_semicolon = strchr(p,
';');
928 next_colon = strchr(p,
':');
930 if (next_colon && (!next_semicolon || next_colon < next_semicolon))
931 items[i].
strength = atoi(strchr(p,
':')+1);
933 if (isdigit(*p) || *p ==
'*') {
934 items[i].
typenum = *p ==
'*' ? -1 : atoi(p);
941 q = strpbrk(p,
";:");
953 LOG(
llevError,
"invalid type %s defined in shopitems for %s in string %s\n", p,
map->name, input_string);
956 items[i].
index = number_of_entries;
958 p = ++next_semicolon;
981 output_string[0] =
'\0';
982 for (i = 0; i <
m->shopitems[0].index; i++) {
983 if (
m->shopitems[i].typenum != -1) {
984 if (
m->shopitems[i].strength) {
985 snprintf(
tmp,
sizeof(
tmp),
"%s:%d;",
m->shopitems[i].name,
m->shopitems[i].strength);
987 snprintf(
tmp,
sizeof(
tmp),
"%s;",
m->shopitems[i].name);
989 if (
m->shopitems[i].strength) {
990 snprintf(
tmp,
sizeof(
tmp),
"*:%d;",
m->shopitems[i].strength);
992 snprintf(
tmp,
sizeof(
tmp),
"*;");
994 snprintf(output_string+strlen(output_string), size-strlen(output_string),
"%s",
tmp);
998 if (strlen(output_string) > 0) {
999 output_string[strlen(output_string) - 1] =
'\0';
1025 m->width =
m->height = 0;
1026 while (fgets(
buf,
sizeof(
buf), fp) != NULL) {
1029 p = strchr(
buf,
'\n');
1031 LOG(
llevError,
"Error loading map header - did not find a newline - perhaps file is truncated? Buf=%s\n",
buf);
1037 while (isspace(*
key))
1045 while (isspace(*
value)) {
1047 if (*
value ==
'\0') {
1070 if (!strcmp(
key,
"msg")) {
1074 while (fgets(
buf,
sizeof(
buf), fp) != NULL) {
1075 if (!strcmp(
buf,
"endmsg\n"))
1079 msgpos += strlen(
buf);
1092 }
else if (!strcmp(
key,
"maplore")) {
1094 size_t maplorepos = 0;
1097 if (!strcmp(
buf,
"endmaplore\n"))
1100 if (maplorepos >=
sizeof(maplorebuf)) {
1104 snprintf(maplorebuf+maplorepos,
sizeof(maplorebuf)-maplorepos,
"%s",
buf);
1105 maplorepos += strlen(
buf);
1108 if (maplorepos != 0)
1110 }
else if (!strcmp(
key,
"end")) {
1112 }
else if (
value == NULL) {
1113 LOG(
llevError,
"Got '%s' line without parameter in map header\n",
key);
1114 }
else if (!strcmp(
key,
"arch")) {
1116 if (strcmp(
value,
"map")) {
1117 LOG(
llevError,
"load_map_header: expected 'arch map': check line endings?\n");
1120 }
else if (!strcmp(
key,
"name")) {
1128 }
else if (!strcmp(
key,
"enter_x")) {
1129 m->enter_x = atoi(
value);
1130 }
else if (!strcmp(
key,
"enter_y")) {
1131 m->enter_y = atoi(
value);
1132 }
else if (!strcmp(
key,
"width")) {
1134 }
else if (!strcmp(
key,
"height")) {
1136 }
else if (!strcmp(
key,
"reset_timeout")) {
1137 m->reset_timeout = atoi(
value);
1138 }
else if (!strcmp(
key,
"swap_time")) {
1139 m->timeout = atoi(
value);
1140 }
else if (!strcmp(
key,
"difficulty")) {
1141 m->difficulty = atoi(
value);
1142 }
else if (!strcmp(
key,
"darkness")) {
1143 m->darkness = atoi(
value);
1144 }
else if (!strcmp(
key,
"fixed_resettime")) {
1145 m->fixed_resettime = atoi(
value);
1146 }
else if (!strcmp(
key,
"unique")) {
1148 }
else if (!strcmp(
key,
"template")) {
1149 m->is_template = atoi(
value);
1150 }
else if (!strcmp(
key,
"region")) {
1152 }
else if (!strcmp(
key,
"shopitems")) {
1154 }
else if (!strcmp(
key,
"shopgreed")) {
1155 m->shopgreed = atof(
value);
1156 }
else if (!strcmp(
key,
"shopmin")) {
1157 m->shopmin = atol(
value);
1158 }
else if (!strcmp(
key,
"shopmax")) {
1159 m->shopmax = atol(
value);
1160 }
else if (!strcmp(
key,
"shoprace")) {
1162 }
else if (!strcmp(
key,
"outdoor")) {
1163 m->outdoor = atoi(
value);
1164 }
else if (!strcmp(
key,
"nosmooth")) {
1165 m->nosmooth = atoi(
value);
1166 }
else if (!strcmp(
key,
"first_load")) {
1167 m->last_reset_time = atoi(
value);
1168 }
else if (!strncmp(
key,
"tile_path_", 10)) {
1171 if (tile < 1 || tile > 4) {
1172 LOG(
llevError,
"load_map_header: tile location %d out of bounds (%s)\n",
tile,
m->path);
1174 if (
m->tile_path[
tile-1]) {
1175 LOG(
llevError,
"load_map_header: tile location %d duplicated (%s)\n",
tile,
m->path);
1176 free(
m->tile_path[
tile-1]);
1180 }
else if (!strcmp(
key,
"background_music")) {
1182 }
else if (!strcmp(
key,
"reset_group")) {
1188 if ((
m->width == 0) || (
m->height == 0)) {
1192 if (!
key || strcmp(
key,
"end")) {
1211 if ((fp = fopen(pathname,
"r")) == NULL) {
1213 "Can't open %s: %s\n", pathname, strerror(errno));
1289 LOG(
llevError,
"No temporary filename for map %s\n",
m->path);
1293 if ((fp = fopen(
m->tmpname,
"r")) == NULL) {
1294 LOG(
llevError,
"Cannot open %s: %s\n",
m->tmpname, strerror(errno));
1299 LOG(
llevError,
"Error loading map header for %s (%s)\n",
m->path,
m->tmpname);
1327 if ((fp = fopen(pathname,
"r")) == NULL) {
1333 LOG(
llevError,
"Error loading map header for overlay %s (%s)\n",
m->path, pathname);
1357 int i, j, unique = 0;
1388 snprintf(firstname,
sizeof(firstname),
"%s.v%02d",
name,
count);
1389 if (!access(firstname, R_OK))
1396 if ((fp = fopen(firstname,
"r")) == NULL) {
1405 if (
m->tmpname == NULL)
1434 if (flag && !*
m->path) {
1442 if (!
m->unique && !
m->is_template) {
1448 if (
m->path[0] !=
'~') {
1450 "Cannot save unique map '%s' outside of LOCALDIR. Check "
1451 "that all exits to '%s' have FLAG_UNIQUE set correctly.\n",
1471 fprintf(fp,
"arch map\n");
1473 fprintf(fp,
"name %s\n",
m->name);
1475 fprintf(fp,
"swap_time %d\n",
m->swap_time);
1476 if (
m->reset_timeout)
1477 fprintf(fp,
"reset_timeout %u\n",
m->reset_timeout);
1478 if (
m->fixed_resettime)
1479 fprintf(fp,
"fixed_resettime %d\n",
m->fixed_resettime);
1484 fprintf(fp,
"difficulty %d\n",
m->difficulty);
1486 fprintf(fp,
"region %s\n",
m->region->name);
1489 fprintf(fp,
"shopitems %s\n", shop);
1492 fprintf(fp,
"shopgreed %f\n",
m->shopgreed);
1494 fprintf(fp,
"shopmin %" FMT64U "\n",
m->shopmin);
1496 fprintf(fp,
"shopmax %" FMT64U "\n",
m->shopmax);
1498 fprintf(fp,
"shoprace %s\n",
m->shoprace);
1500 fprintf(fp,
"darkness %d\n",
m->darkness);
1502 fprintf(fp,
"width %d\n",
m->width);
1504 fprintf(fp,
"height %d\n",
m->height);
1506 fprintf(fp,
"enter_x %d\n",
m->enter_x);
1508 fprintf(fp,
"enter_y %d\n",
m->enter_y);
1510 fprintf(fp,
"msg\n%sendmsg\n",
m->msg);
1512 fprintf(fp,
"maplore\n%sendmaplore\n",
m->maplore);
1514 fprintf(fp,
"unique %d\n",
m->unique);
1516 fprintf(fp,
"template %d\n",
m->is_template);
1518 fprintf(fp,
"outdoor %d\n",
m->outdoor);
1520 fprintf(fp,
"nosmooth %d\n",
m->nosmooth);
1521 if (
m->last_reset_time)
1522 fprintf(fp,
"first_load %ld\n",
m->last_reset_time);
1523 if (
m->background_music)
1524 fprintf(fp,
"background_music %s\n",
m->background_music);
1526 fprintf(fp,
"reset_group %s\n",
m->reset_group);
1530 for (i = 0; i < 4; i++)
1531 if (
m->tile_path[i])
1532 fprintf(fp,
"tile_path_%d %s\n", i+1,
m->tile_path[i]);
1534 fprintf(fp,
"end\n");
1545 snprintf(final_unique,
sizeof(final_unique),
"%s.v00",
name);
1546 fp2 =
of_open(&of2, final_unique);
1571 if (ftell(fp2) == 0) {
1577 unlink(final_unique);
1584 if (chmod(final_unique,
SAVE_MODE) != 0) {
1607 LOG(
llevDebug,
"save_map on %s" " took %ld us\n",
m->path, diff));
1643 object *previous_obj = NULL;
1646 if (
op == previous_obj) {
1647 LOG(
llevDebug,
"free_all_objects: Link error, bailing out.\n");
1669 LOG(
llevError,
"free_all_objects: object %s still on map after it should have been freed\n",
op->name);
1687 if (!
m->in_memory) {
1708 if (
m->background_music)
1713 for (i = 0; i < 4; i++) {
1714 if (
m->tile_path[i])
1716 m->tile_map[i] = NULL;
1760 for (i = 0; i < 4; i++)
1761 if (
tmp->tile_map[i] ==
m)
1762 tmp->tile_map[i] = NULL;
1773 LOG(
llevError,
"delete_map: Unable to find map %s in list\n",
m->path);
1775 last->
next =
m->next;
1811 snprintf(buf2,
sizeof(buf2),
"~%s",
name+strlen(
buf)+1);
1816 if (
name[0] ==
'~') {
1836 if (
m == NULL)
return NULL;
1894 if (
m->last_reset_time == 0) {
1924 int64_t exp_pr_sq, total_exp = 0;
1934 total_exp +=
op->stats.exp;
1936 total_exp +=
op->stats.exp;
1939 at =
op->other_arch ?
op->other_arch : NULL;
1943 int lim = atoi(val ? val :
"0");
1945 if (!lim || lim >= 16)
1961 for (i = 1; i < 25; i++)
1977 if (
m->tmpname == NULL)
1979 (
void)unlink(
m->tmpname);
1997 LOG(
llevDebug,
"free_all_maps: Freed %d maps\n", real_maps);
2018 int new_level =
m->darkness+change;
2022 || (new_level <= 0 && m->darkness == 0)
2043 m->darkness = new_level;
2072 static inline void add_face_layer(
int low_layer,
int high_layer,
object *
ob,
object *layers[],
int honor_visibility) {
2076 for (
l = low_layer;
l <= high_layer;
l++) {
2082 if (!honor_visibility)
2089 for (l1 = (
l-1); l1 >= low_layer; l1--) {
2090 if (layers[l1]->face->visibility > layers[l1+1]->
face->
visibility) {
2092 layers[l1+1] = layers[l1];
2102 if (!honor_visibility) {
2106 for (
l = low_layer;
l < high_layer;
l++)
2107 layers[
l] = layers[
l+1];
2108 layers[high_layer] =
ob;
2118 for (
l = high_layer;
l >= low_layer;
l--) {
2120 for (l1 = low_layer; l1 <
l; l1++)
2121 layers[l1] = layers[l1+1];
2143 uint8_t
flags = 0, oldflags, light = 0;
2146 MoveType move_block = 0, move_slow = 0, move_on = 0, move_off = 0, move_allow = 0;
2150 LOG(
llevDebug,
"update_position called with P_NEED_UPDATE not set: %s (%d, %d)\n",
m->path,
x,
y);
2154 memset(layers, 0,
MAP_LAYERS*
sizeof(
object *));
2169 if (
tmp->glow_radius > light)
2170 light =
tmp->glow_radius;
2177 if (
tmp->map_layer) {
2187 memset(layers+1, 0, (
MAP_LAYERS-1)*
sizeof(
object *));
2203 move_slow |=
tmp->move_slow;
2204 move_block |=
tmp->move_block;
2205 move_on |=
tmp->move_on;
2206 move_off |=
tmp->move_off;
2207 move_allow |=
tmp->move_allow;
2229 LOG(
llevDebug,
"update_position: updated flags do not match old flags: %s (x=%d,y=%d) %x != %x\n",
2282 int dest_tile = (tile_num+2)%4;
2288 if (orig_map->
tile_map[tile_num] == NULL) {
2300 return orig_map->
tile_map[tile_num];
2329 if (!
m->tile_path[3])
2334 if (!
m->tile_map[3])
2339 if (!
m->tile_path[1])
2344 if (!
m->tile_map[1])
2351 if (!
m->tile_path[0])
2356 if (!
m->tile_map[0])
2361 if (!
m->tile_path[2])
2366 if (!
m->tile_map[2])
2399 if ( !
m )
return NULL;
2408 if (!
m->tile_path[3])
2413 if (!
m->tile_map[3])
2420 if (!
m->tile_path[1])
2425 if (!
m->tile_map[1])
2434 if (!
m->tile_path[0])
2439 if (!
m->tile_map[0])
2446 if (!
m->tile_path[2])
2451 if (!
m->tile_map[2])
2483 }
else if (map1->
tile_map[0] == map2) {
2486 }
else if (map1->
tile_map[1] == map2) {
2489 }
else if (map1->
tile_map[2] == map2) {
2492 }
else if (map1->
tile_map[3] == map2) {
2560 retval->
part = NULL;
2584 if (tmpi < best_distance) {
2585 best_distance = tmpi;
2594 retval->
part = best;
2634 retval->
part = NULL;
2640 retval->
part = NULL;
2711 if (unlink(
path) != 0) {
2731 if (
item->map != NULL) {
2732 if (strlen(
item->map->path) > 0) {
2733 return item->map->path;
2736 return item->map->name ?
item->map->name :
"(empty path and name)";
2739 if (
item->env != NULL)
2742 return "(no map and no env!)";
#define GET_MAP_OB(M, X, Y)
object * object_get_owner(object *op)
#define FREE_AND_CLEAR_STR_IF(xyz)
#define FREE_OBJ_NO_DESTROY_CALLBACK
#define MAP_NO_DIFFICULTY
void LOG(LogLevel logLevel, const char *format,...)
mapstruct * get_empty_map(int sizex, int sizey)
#define FLAG_OVERLAY_FLOOR
int of_close(OutputFile *of)
static void create_items_path(const char *s, char *buf, size_t size)
region * get_region_by_name(const char *region_name)
FILE * of_open(OutputFile *of, const char *fname)
#define MAP_RESET_TIMEOUT(m)
int blocked_link(object *ob, mapstruct *m, int16_t sx, int16_t sy)
int load_object(FILE *fp, object *op, int bufstate, int map_flags)
#define SAVE_FLAG_NO_REMOVE
static void delete_unique_items(mapstruct *m)
mapstruct * ready_map_name(const char *name, int flags)
#define QUERY_FLAG(xyz, p)
static int load_temporary_map(mapstruct *m)
mapstruct * has_been_loaded(const char *name)
static void print_shop_string(mapstruct *m, char *output_string, int size)
void update_position(mapstruct *m, int x, int y)
static void add_face_layer(int low_layer, int high_layer, object *ob, object *layers[], int honor_visibility)
StringBuffer * stringbuffer_new(void)
#define FLAG_OBJ_ORIGINAL
#define SET_MAP_MOVE_ON(M, X, Y, C)
void map_path(const char *map, int flags, char *pathname, size_t bufsize)
static const Map_Layer_Info map_layer_info[MAP_LAYERS]
static char msgbuf[HUGE_BUF]
static const flag_definition flags[]
void clean_object(object *op)
#define MAP_PLAYER_UNIQUE
#define PROFILE_BEGIN(expr)
void dump_map(const mapstruct *m)
const char * object_get_value(const object *op, const char *const key)
#define GET_MAP_FACE_OBJS(M, X, Y)
#define SAVE_MODE_OVERLAY
#define INS_ABOVE_FLOOR_ONLY
void map_remove_unique_files(const mapstruct *map)
int save_objects(mapstruct *m, FILE *fp, FILE *fp2, int flag)
#define PROFILE_END(var, expr)
static event_registration m
void set_darkness_map(mapstruct *m)
char * stringbuffer_finish(StringBuffer *sb)
void apply_auto_fix(mapstruct *m)
#define MAP_LAYER_NO_PICK2
#define MAP_DIFFICULTY(m)
void object_free_drop_inventory(object *ob)
uint32_t map_size(mapstruct *m)
bool object_value_set_shared(const object *op, sstring key)
void of_cancel(OutputFile *of)
const typedata * get_typedata(int itemtype)
#define MSG_TYPE_ATTACK_NOKEY
char * path_combine_and_normalize(const char *src, const char *dst, char *path, size_t size)
static void load_unique_objects(mapstruct *m)
sstring add_string(const char *str)
void clean_tmp_map(mapstruct *m)
#define SAVE_ERROR_RCREATION
#define MAP_WHEN_RESET(m)
int change_map_light(mapstruct *m, int change)
void void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
mapstruct * mapfile_load_lowlevel(const char *map, const char *pathname, int flags)
int out_of_map(mapstruct *m, int x, int y)
#define SET_MAP_FLAGS(M, X, Y, C)
#define MAP_LAYER_LIVING1
void object_free(object *ob, int flags)
#define GET_MAP_MOVE_BLOCK(M, X, Y)
void free_map(mapstruct *m)
int64_t level_exp(int level, double expmul)
static void free_all_objects(mapstruct *m)
mapstruct * get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y)
object * map_find_by_flag(mapstruct *map, int x, int y, int flag)
void delete_map(mapstruct *m)
int ob_blocked(const object *ob, mapstruct *m, int16_t x, int16_t y)
#define SAVE_ERROR_NO_PATH
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
static void link_multipart_objects(mapstruct *m)
const typedata * get_typedata_by_name(const char *name)
void fatal(enum fatal_error err)
mapstruct * get_linked_map(void)
void create_template_pathname(const char *name, char *buf, size_t size)
size_t strlcpy(char *dst, const char *src, size_t size)
object * object_new(void)
void create_overlay_pathname(const char *name, char *buf, size_t size)
#define OB_MOVE_BLOCK(ob1, ob2)
void set_map_reset_time(mapstruct *map)
void free_string(sstring str)
#define SAVE_ERROR_UCREATION
#define SET_MAP_MOVE_SLOW(M, X, Y, C)
#define FOR_MAP_PREPARE(map_, mx_, my_, it_)
#define OUT_OF_REAL_MAP(M, X, Y)
int find_dir_2(int x, int y)
static mapstruct * load_and_link_tiled_map(mapstruct *orig_map, int tile_num)
#define MAP_LAYER_NO_PICK1
void decay_objects(mapstruct *m)
static int load_map_header(FILE *fp, mapstruct *m)
#define FREE_AND_CLEAR(xyz)
static int adjacent_map(const mapstruct *map1, const mapstruct *map2, int *dx, int *dy)
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
char * create_pathname(const char *name, char *buf, size_t size)
const char * map_get_path(const object *item)
#define SET_MAP_MOVE_BLOCK(M, X, Y, C)
int on_same_map(const object *op1, const object *op2)
#define CLEAR_FLAG(xyz, p)
void save_object_in_sb(StringBuffer *sb, object *op, const int flag)
#define SAVE_ERROR_URENAME
void strip_endline(char *buf)
void object_remove_from_active_list(object *op)
object * arch_to_object(archetype *at)
int get_rangevector(object *op1, const object *op2, rv_vector *retval, int flags)
void update_all_map_los(mapstruct *map)
void allocate_map(mapstruct *m)
void object_fix_multipart(object *tmp)
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
static void fix_container_multipart(object *container)
void free_objectlinkpt(oblinkpt *obp)
void object_remove(object *op)
#define GET_MAP_FLAGS(M, X, Y)
signed long object_sum_weight(object *op)
#define MAP_LAYER_LIVING2
#define OB_TYPE_MOVE_BLOCK(ob1, type)
void make_path_to_file(const char *filename)
int save_map(mapstruct *m, int flag)
int get_rangevector_from_mapcoord(const mapstruct *m, int x, int y, const object *op2, rv_vector *retval, int flags)
int calculate_difficulty(mapstruct *m)
#define SET_MAP_PLAYER(M, X, Y, C)
mapstruct * mapfile_load(const char *map, int flags)
static shopitems * parse_shop_string(const char *input_string, const mapstruct *map)
#define SAVE_FLAG_SAVE_UNPAID
#define SET_MAP_LIGHT(M, X, Y, L)
const char *const map_layer_name[MAP_LAYERS]
static int load_overlay_map(const char *filename, mapstruct *m)
#define FOR_INV_PREPARE(op_, it_)
int check_path(const char *name, int prepend_dir)
void events_execute_global_event(int eventcode,...)
void load_objects(mapstruct *m, FILE *fp, int mapflags)
#define SET_MAP_MOVE_OFF(M, X, Y, C)