diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/mapindex.c | 14 | ||||
-rw-r--r-- | src/common/mapindex.h | 1 | ||||
-rw-r--r-- | src/map/script.c | 2 | ||||
-rw-r--r-- | src/map/unit.c | 2 |
4 files changed, 14 insertions, 5 deletions
diff --git a/src/common/mapindex.c b/src/common/mapindex.c index ec829ee56..e00fc107d 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -165,13 +165,20 @@ int mapindex_init(void) { } fclose(fp); - if( !strdb_iget(mapindex->db, MAP_DEFAULT) ) { - ShowError("mapindex_init: MAP_DEFAULT '%s' not found in cache! update mapindex.h MAP_DEFAULT var!!!\n",MAP_DEFAULT); - } + mapindex->check_default(); return total; } +bool mapindex_check_default(void) +{ + if (!strdb_iget(mapindex->db, MAP_DEFAULT)) { + ShowError("mapindex_init: MAP_DEFAULT '%s' not found in cache! update mapindex.h MAP_DEFAULT var!!!\n",MAP_DEFAULT); + return false; + } + return true; +} + void mapindex_removemap(int index){ strdb_remove(mapindex->db, mapindex->list[index].name); mapindex->list[index].name[0] = '\0'; @@ -201,4 +208,5 @@ void mapindex_defaults(void) { mapindex->getmapname_ext = mapindex_getmapname_ext; mapindex->name2id = mapindex_name2id; mapindex->id2name = mapindex_id2name_sub; + mapindex->check_default = mapindex_check_default; } diff --git a/src/common/mapindex.h b/src/common/mapindex.h index 446a2422d..53d08f8e6 100644 --- a/src/common/mapindex.h +++ b/src/common/mapindex.h @@ -84,6 +84,7 @@ struct mapindex_interface { /* TODO: Hello World! make up your mind, this thing is int on some places and unsigned short on others */ unsigned short (*name2id) (const char*); const char* (*id2name) (unsigned short,const char *file, int line, const char *func); + bool (*check_default) (void); }; struct mapindex_interface *mapindex; diff --git a/src/map/script.c b/src/map/script.c index 6037c61fa..e04ba6f32 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -155,7 +155,7 @@ static void script_dump_stack(struct script_state* st) break; case C_NAME: - ShowMessage(" \"%s\" (id=%d ref=%p subtype=%s)\n", reference_getname(data), data->u.num, data->ref, script_op2name(script->str_data[data->u.num].type)); + ShowMessage(" \"%s\" (id=%d ref=%p subtype=%s)\n", reference_getname(data), data->u.num, data->ref, script->op2name(script->str_data[data->u.num].type)); break; case C_RETINFO: diff --git a/src/map/unit.c b/src/map/unit.c index 3962e771e..c78919f52 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2323,7 +2323,7 @@ int unit_remove_map(struct block_list *bl, clr_type clrtype, const char* file, i //Clear target even if there is no timer if (ud->target || ud->attacktimer != INVALID_TIMER) - unit_stop_attack(bl); + unit->stop_attack(bl); //Clear stepaction even if there is no timer if (ud->stepaction || ud->steptimer != INVALID_TIMER) |