summaryrefslogtreecommitdiff
path: root/src/common/mapindex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/mapindex.c')
-rw-r--r--src/common/mapindex.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index ec829ee56..0d8a69726 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, mapindex->default_map)) {
+ ShowError("mapindex_init: MAP_DEFAULT '%s' not found in cache! update mapindex.h MAP_DEFAULT var!!!\n", mapindex->default_map);
+ return false;
+ }
+ return true;
+}
+
void mapindex_removemap(int index){
strdb_remove(mapindex->db, mapindex->list[index].name);
mapindex->list[index].name[0] = '\0';
@@ -189,6 +196,9 @@ void mapindex_defaults(void) {
/* */
mapindex->db = NULL;
mapindex->num = 0;
+ mapindex->default_map = MAP_DEFAULT;
+ mapindex->default_x = MAP_DEFAULT_X;
+ mapindex->default_y = MAP_DEFAULT_Y;
memset (&mapindex->list, 0, sizeof (mapindex->list));
/* */
@@ -201,4 +211,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;
}