From 0147ed8a48a7f01d0619dec3eb2813b879f1dee7 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Nov 2014 00:12:05 +0300 Subject: into mapindex add variable with default map and position. --- src/common/mapindex.c | 7 +++++-- src/common/mapindex.h | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'src/common') diff --git a/src/common/mapindex.c b/src/common/mapindex.c index e00fc107d..0d8a69726 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -172,8 +172,8 @@ int mapindex_init(void) { 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); + 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; @@ -196,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)); /* */ diff --git a/src/common/mapindex.h b/src/common/mapindex.h index 53d08f8e6..91bf4562e 100644 --- a/src/common/mapindex.h +++ b/src/common/mapindex.h @@ -67,6 +67,12 @@ struct mapindex_interface { DBMap *db; /* number of entries in the index table */ int num; + /* default map name */ + char *default_map; + /* default x on map */ + int default_x; + /* default y on map */ + int default_y; /* index list -- since map server map count is *unlimited* this should be too */ struct { char name[MAP_NAME_LENGTH]; -- cgit v1.2.3-60-g2f50