summaryrefslogtreecommitdiff
path: root/src/common/mapindex.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-16 20:43:58 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-16 23:45:25 +0300
commit54c6b9f6cb8e8f8d0e0284838bc1e9b2b3bbac8d (patch)
treee7ccc38cdda5ec55e9ad939b53314a0234b84634 /src/common/mapindex.c
parent86d0ab88920099c164f12e440f232634989bc69b (diff)
downloadhercules-54c6b9f6cb8e8f8d0e0284838bc1e9b2b3bbac8d.tar.gz
hercules-54c6b9f6cb8e8f8d0e0284838bc1e9b2b3bbac8d.tar.bz2
hercules-54c6b9f6cb8e8f8d0e0284838bc1e9b2b3bbac8d.tar.xz
hercules-54c6b9f6cb8e8f8d0e0284838bc1e9b2b3bbac8d.zip
In mapindex move check for default map into separate method.
Diffstat (limited to 'src/common/mapindex.c')
-rw-r--r--src/common/mapindex.c14
1 files changed, 11 insertions, 3 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;
}