summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-30 23:27:06 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-30 23:27:06 +0300
commitce092b3c79d7c624df4632535f65d7a663f6054e (patch)
treea9369f704d4566d073ec78db481bf9838b077437
parent50a97b0ef2a8365d87a8a57047caccb0c050c56b (diff)
downloadevol-hercules-ce092b3c79d7c624df4632535f65d7a663f6054e.tar.gz
evol-hercules-ce092b3c79d7c624df4632535f65d7a663f6054e.tar.bz2
evol-hercules-ce092b3c79d7c624df4632535f65d7a663f6054e.tar.xz
evol-hercules-ce092b3c79d7c624df4632535f65d7a663f6054e.zip
char: add init default map.
-rw-r--r--src/Makefile.am12
-rw-r--r--src/char/init.c4
-rw-r--r--src/common/init.c (renamed from src/common/interfaces.c)8
-rw-r--r--src/common/init.h (renamed from src/common/interfaces.h)1
-rw-r--r--src/login/init.c2
-rw-r--r--src/map/init.c6
6 files changed, 21 insertions, 12 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 29984a5..1208446 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,8 +5,8 @@ CHAR_SRC = char/char.c \
char/config.c \
char/config.h \
char/init.c \
- common/interfaces.c \
- common/interfaces.h \
+ common/init.c \
+ common/init.h \
common/ip.c \
common/ip.h
@@ -17,8 +17,8 @@ LOGIN_SRC = login/config.c \
login/parse.h \
login/send.c \
login/send.h \
- common/interfaces.c \
- common/interfaces.h \
+ common/init.c \
+ common/init.h \
common/ip.c \
common/ip.h
@@ -53,8 +53,8 @@ MAP_SRC = map/clif.c \
map/struct/sessionext.h \
map/utils/formatutils.c \
map/utils/formatutils.h \
- common/interfaces.c \
- common/interfaces.h
+ common/init.c \
+ common/init.h
SHARED_CFLAGS = -pipe -ffast-math -Wall -Wextra -Wno-sign-compare -DPCRE_SUPPORT
SHARED_LDFLAGS = -avoid-version -Wl,--no-undefined
diff --git a/src/char/init.c b/src/char/init.c
index 639c19b..3dabdae 100644
--- a/src/char/init.c
+++ b/src/char/init.c
@@ -26,7 +26,7 @@
#include "../../../char/loginif.h"
#include "../../../char/mapif.h"
-#include "common/interfaces.h"
+#include "common/init.h"
#include "char/char.h"
#include "char/config.h"
@@ -65,6 +65,8 @@ HPExport void server_preinit (void)
{
interfaces_init_common();
+ setDefaultMap();
+
addCharInterConf("inter_server_ip", config_inter_server_ip);
}
diff --git a/src/common/interfaces.c b/src/common/init.c
index 37e8890..38797dc 100644
--- a/src/common/interfaces.c
+++ b/src/common/init.c
@@ -8,6 +8,7 @@
#include "../../../common/HPMi.h"
#include "../../../common/conf.h"
#include "../../../common/malloc.h"
+#include "../../../common/mapindex.h"
#include "../../../common/mmo.h"
#include "../../../common/socket.h"
#include "../../../common/strlib.h"
@@ -28,3 +29,10 @@ void interfaces_init_common(void)
sysinfo = GET_SYMBOL("sysinfo");
DB = GET_SYMBOL("DB");
}
+
+void setDefaultMap(void)
+{
+ mapindex->default_map = "000-1";
+ mapindex->default_x = 80;
+ mapindex->default_y = 109;
+}
diff --git a/src/common/interfaces.h b/src/common/init.h
index 2215978..bd86f5b 100644
--- a/src/common/interfaces.h
+++ b/src/common/init.h
@@ -5,5 +5,6 @@
#define EVOL_COMMON_INTERFACES
void interfaces_init_common(void);
+void setDefaultMap(void);
#endif // EVOL_COMMON_INTERFACES
diff --git a/src/login/init.c b/src/login/init.c
index c781588..33fda69 100644
--- a/src/login/init.c
+++ b/src/login/init.c
@@ -12,7 +12,7 @@
#include "../../../common/strlib.h"
#include "../../../login/login.h"
-#include "common/interfaces.h"
+#include "common/init.h"
#include "login/config.h"
#include "login/parse.h"
diff --git a/src/map/init.c b/src/map/init.c
index c8f2ad3..b6142ca 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -33,7 +33,7 @@
#include "../../../map/trade.h"
#include "../../../map/quest.h"
-#include "common/interfaces.h"
+#include "common/init.h"
#include "map/clif.h"
#include "map/lang.h"
#include "map/npc.h"
@@ -170,9 +170,7 @@ HPExport void server_preinit (void)
mapit = GET_SYMBOL("mapit");
mapindex = GET_SYMBOL("mapindex");
- mapindex->default_map = "000-1";
- mapindex->default_x = 80;
- mapindex->default_y = 109;
+ setDefaultMap();
addHookPre("quest->read_db", equest_read_db);
}