summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/char/HPMchar.c32
-rw-r--r--src/char/HPMchar.h4
-rw-r--r--src/char/Makefile.in12
-rw-r--r--src/char/char.c68
-rw-r--r--src/char/char.h6
-rw-r--r--src/char/geoip.c8
-rw-r--r--src/char/geoip.h2
-rw-r--r--src/char/int_auction.c28
-rw-r--r--src/char/int_auction.h2
-rw-r--r--src/char/int_elemental.c24
-rw-r--r--src/char/int_elemental.h2
-rw-r--r--src/char/int_guild.c28
-rw-r--r--src/char/int_guild.h2
-rw-r--r--src/char/int_homun.c24
-rw-r--r--src/char/int_homun.h2
-rw-r--r--src/char/int_mail.c24
-rw-r--r--src/char/int_mail.h2
-rw-r--r--src/char/int_mercenary.c24
-rw-r--r--src/char/int_mercenary.h2
-rw-r--r--src/char/int_party.c28
-rw-r--r--src/char/int_party.h2
-rw-r--r--src/char/int_pet.c24
-rw-r--r--src/char/int_quest.c26
-rw-r--r--src/char/int_storage.c24
-rw-r--r--src/char/inter.c46
-rw-r--r--src/char/inter.h5
-rw-r--r--src/char/loginif.c19
-rw-r--r--src/char/loginif.h2
-rw-r--r--src/char/mapif.c22
-rw-r--r--src/char/mapif.h2
-rw-r--r--src/char/pincode.c18
-rw-r--r--src/char/pincode.h2
-rw-r--r--src/common/HPM.c32
-rw-r--r--src/common/HPM.h4
-rw-r--r--src/common/HPMi.h10
-rw-r--r--src/common/Makefile.in17
-rw-r--r--src/common/atomic.h4
-rw-r--r--src/common/conf.c4
-rw-r--r--src/common/conf.h4
-rw-r--r--src/common/console.c35
-rw-r--r--src/common/console.h12
-rw-r--r--src/common/core.c49
-rw-r--r--src/common/core.h6
-rw-r--r--src/common/db.c12
-rw-r--r--src/common/db.h4
-rw-r--r--src/common/des.c2
-rw-r--r--src/common/des.h2
-rw-r--r--src/common/ers.c10
-rw-r--r--src/common/ers.h2
-rw-r--r--src/common/grfio.c16
-rw-r--r--src/common/malloc.c14
-rw-r--r--src/common/malloc.h2
-rw-r--r--src/common/mapindex.c12
-rw-r--r--src/common/mapindex.h4
-rw-r--r--src/common/md5calc.c4
-rw-r--r--src/common/mmo.h8
-rw-r--r--src/common/mutex.c11
-rw-r--r--src/common/mutex.h2
-rw-r--r--src/common/nullpo.c4
-rw-r--r--src/common/nullpo.h2
-rw-r--r--src/common/random.c10
-rw-r--r--src/common/random.h2
-rw-r--r--src/common/showmsg.c14
-rw-r--r--src/common/showmsg.h10
-rw-r--r--src/common/socket.c20
-rw-r--r--src/common/socket.h6
-rw-r--r--src/common/spinlock.h8
-rw-r--r--src/common/sql.c17
-rw-r--r--src/common/sql.h4
-rw-r--r--src/common/strlib.c8
-rw-r--r--src/common/strlib.h4
-rw-r--r--src/common/sysinfo.c11
-rw-r--r--src/common/sysinfo.h2
-rw-r--r--src/common/thread.c11
-rw-r--r--src/common/thread.h2
-rw-r--r--src/common/timer.c22
-rw-r--r--src/common/timer.h2
-rw-r--r--src/common/utils.c30
-rw-r--r--src/common/utils.h4
-rw-r--r--src/login/HPMlogin.c32
-rw-r--r--src/login/HPMlogin.h4
-rw-r--r--src/login/Makefile.in12
-rw-r--r--src/login/account.h6
-rw-r--r--src/login/account_sql.c22
-rw-r--r--src/login/ipban.h2
-rw-r--r--src/login/ipban_sql.c22
-rw-r--r--src/login/login.c34
-rw-r--r--src/login/login.h4
-rw-r--r--src/login/loginlog.h2
-rw-r--r--src/login/loginlog_sql.c14
-rw-r--r--src/map/HPMmap.c102
-rw-r--r--src/map/HPMmap.h6
-rw-r--r--src/map/Makefile.in12
-rw-r--r--src/map/atcommand.c92
-rw-r--r--src/map/atcommand.h6
-rw-r--r--src/map/battle.c60
-rw-r--r--src/map/battle.h4
-rw-r--r--src/map/battleground.c42
-rw-r--r--src/map/battleground.h6
-rw-r--r--src/map/buyingstore.c26
-rw-r--r--src/map/buyingstore.h4
-rw-r--r--src/map/channel.c36
-rw-r--r--src/map/channel.h8
-rw-r--r--src/map/chat.c28
-rw-r--r--src/map/chat.h6
-rw-r--r--src/map/chrif.c52
-rw-r--r--src/map/chrif.h8
-rw-r--r--src/map/clif.c92
-rw-r--r--src/map/clif.h12
-rw-r--r--src/map/date.c4
-rw-r--r--src/map/date.h2
-rw-r--r--src/map/duel.c10
-rw-r--r--src/map/duel.h2
-rw-r--r--src/map/elemental.c60
-rw-r--r--src/map/elemental.h6
-rw-r--r--src/map/guild.c50
-rw-r--r--src/map/guild.h8
-rw-r--r--src/map/homunculus.c62
-rw-r--r--src/map/homunculus.h8
-rw-r--r--src/map/instance.c36
-rw-r--r--src/map/instance.h6
-rw-r--r--src/map/intif.c48
-rw-r--r--src/map/intif.h2
-rw-r--r--src/map/irc-bot.c22
-rw-r--r--src/map/irc-bot.h2
-rw-r--r--src/map/itemdb.c30
-rw-r--r--src/map/itemdb.h12
-rw-r--r--src/map/log.c24
-rw-r--r--src/map/log.h4
-rw-r--r--src/map/mail.c18
-rw-r--r--src/map/mail.h2
-rw-r--r--src/map/map.c103
-rw-r--r--src/map/map.h18
-rw-r--r--src/map/mapreg.h6
-rw-r--r--src/map/mapreg_sql.c22
-rw-r--r--src/map/mercenary.c60
-rw-r--r--src/map/mercenary.h6
-rw-r--r--src/map/mob.c70
-rw-r--r--src/map/mob.h10
-rw-r--r--src/map/npc.c56
-rw-r--r--src/map/npc.h12
-rw-r--r--src/map/npc_chat.c22
-rw-r--r--src/map/packets_struct.h4
-rw-r--r--src/map/party.c48
-rw-r--r--src/map/party.h10
-rw-r--r--src/map/path.c20
-rw-r--r--src/map/path.h4
-rw-r--r--src/map/pc.c90
-rw-r--r--src/map/pc.h34
-rw-r--r--src/map/pc_groups.c22
-rw-r--r--src/map/pc_groups.h6
-rw-r--r--src/map/pet.c52
-rw-r--r--src/map/pet.h10
-rw-r--r--src/map/quest.c48
-rw-r--r--src/map/quest.h6
-rw-r--r--src/map/script.c93
-rw-r--r--src/map/script.h14
-rw-r--r--src/map/searchstore.c18
-rw-r--r--src/map/searchstore.h8
-rw-r--r--src/map/skill.c66
-rw-r--r--src/map/skill.h12
-rw-r--r--src/map/status.c60
-rw-r--r--src/map/status.h9
-rw-r--r--src/map/storage.c30
-rw-r--r--src/map/storage.h4
-rw-r--r--src/map/trade.c30
-rw-r--r--src/map/unit.c70
-rw-r--r--src/map/unit.h8
-rw-r--r--src/map/vending.c30
-rw-r--r--src/map/vending.h4
-rw-r--r--src/plugins/HPMHooking.c162
-rw-r--r--src/plugins/Makefile.in7
-rw-r--r--src/plugins/db2sql.c30
-rw-r--r--src/plugins/dbghelpplug.c9
-rw-r--r--src/plugins/sample.c22
-rw-r--r--src/test/Makefile.in12
-rw-r--r--src/test/test_spinlock.c13
-rw-r--r--src/tool/Makefile.in9
-rw-r--r--src/tool/mapcache.c21
179 files changed, 1827 insertions, 1818 deletions
diff --git a/src/char/HPMchar.c b/src/char/HPMchar.c
index 4b153b244..a159b0351 100644
--- a/src/char/HPMchar.c
+++ b/src/char/HPMchar.c
@@ -5,27 +5,27 @@
#include "HPMchar.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
+#include "common/des.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/mapindex.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+
+#include "common/HPMDataCheck.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/db.h"
-#include "../common/des.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/mapindex.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-
-#include "../common/HPMDataCheck.h"
-
bool HPM_char_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) {
/* record address */
switch( type ) {
diff --git a/src/char/HPMchar.h b/src/char/HPMchar.h
index aa266f1de..594bb7f00 100644
--- a/src/char/HPMchar.h
+++ b/src/char/HPMchar.h
@@ -8,8 +8,8 @@
#error You should never include HPMchar.h from a plugin.
#endif
-#include "../common/cbasetypes.h"
-#include "../common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/HPM.h"
struct hplugin;
diff --git a/src/char/Makefile.in b/src/char/Makefile.in
index 20d19966e..035dbf711 100644
--- a/src/char/Makefile.in
+++ b/src/char/Makefile.in
@@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
COMMON_H = $(wildcard $(COMMON_D)/*.h)
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
+COMMON_INCLUDE = -I..
-LIBCONFIG_D = ../../3rdparty/libconfig
+THIRDPARTY_D = ../../3rdparty
+THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D)
+
+LIBCONFIG_D = $(THIRDPARTY_D)/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
scanctx.h scanner.h strbuf.h wincompat.h)
-LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_D = $(THIRDPARTY_D)/mt19937ar
MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
CHAR_C = char.c HPMchar.c loginif.c mapif.c geoip.c inter.c int_auction.c int_elemental.c int_guild.c \
int_homun.c int_mail.c int_mercenary.c int_party.c int_pet.c \
@@ -98,7 +100,7 @@ char-server: ../../char-server@EXEEXT@
obj_sql/%.o: %.c $(CHAR_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/char/char.c b/src/char/char.c
index 2b8f70969..3435728f3 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -4,9 +4,41 @@
#define HERCULES_CORE
-#include "../config/core.h" // CONSOLE_INPUT
+#include "config/core.h" // CONSOLE_INPUT
#include "char.h"
+#include "char/HPMchar.h"
+#include "char/geoip.h"
+#include "char/int_auction.h"
+#include "char/int_elemental.h"
+#include "char/int_guild.h"
+#include "char/int_homun.h"
+#include "char/int_mail.h"
+#include "char/int_mercenary.h"
+#include "char/int_party.h"
+#include "char/int_pet.h"
+#include "char/int_quest.h"
+#include "char/int_storage.h"
+#include "char/inter.h"
+#include "char/loginif.h"
+#include "char/mapif.h"
+#include "char/pincode.h"
+
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/console.h"
+#include "common/core.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mapindex.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
@@ -14,40 +46,8 @@
#include <string.h>
#include <sys/types.h>
#include <time.h>
-
-#include "HPMchar.h"
-#include "geoip.h"
-#include "int_auction.h"
-#include "int_elemental.h"
-#include "int_guild.h"
-#include "int_homun.h"
-#include "int_mail.h"
-#include "int_mercenary.h"
-#include "int_party.h"
-#include "int_pet.h"
-#include "int_quest.h"
-#include "int_storage.h"
-#include "inter.h"
-#include "loginif.h"
-#include "mapif.h"
-#include "pincode.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/console.h"
-#include "../common/core.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mapindex.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
#ifndef WIN32
- #include <unistd.h>
+# include <unistd.h>
#endif
// private declarations
diff --git a/src/char/char.h b/src/char/char.h
index 516598fbe..be04dbe21 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -5,9 +5,9 @@
#ifndef COMMON_CHAR_H
#define COMMON_CHAR_H
-#include "../common/cbasetypes.h"
-#include "../common/core.h" // CORE_ST_LAST
-#include "../common/db.h"
+#include "common/cbasetypes.h"
+#include "common/core.h" // CORE_ST_LAST
+#include "common/db.h"
enum E_CHARSERVER_ST {
CHARSERVER_ST_RUNNING = CORE_ST_LAST,
diff --git a/src/char/geoip.c b/src/char/geoip.c
index 5d3324ab2..8c415b6bf 100644
--- a/src/char/geoip.c
+++ b/src/char/geoip.c
@@ -6,14 +6,14 @@
#include "geoip.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+
#include <errno.h>
#include <stdio.h>
#include <sys/stat.h> // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool]
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-
struct s_geoip geoip_data;
struct geoip_interface geoip_s;
diff --git a/src/char/geoip.h b/src/char/geoip.h
index a7ab6b9a4..cb980fdb7 100644
--- a/src/char/geoip.h
+++ b/src/char/geoip.h
@@ -5,7 +5,7 @@
#ifndef CHAR_GEOIP_H
#define CHAR_GEOIP_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/**
* GeoIP information
diff --git a/src/char/int_auction.c b/src/char/int_auction.c
index f2ec347cd..6b2a9fe73 100644
--- a/src/char/int_auction.c
+++ b/src/char/int_auction.c
@@ -6,24 +6,24 @@
#include "int_auction.h"
+#include "char/char.h"
+#include "char/int_mail.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "int_mail.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
struct inter_auction_interface inter_auction_s;
static int inter_auction_count(int char_id, bool buy)
diff --git a/src/char/int_auction.h b/src/char/int_auction.h
index c27ecd6c3..80e5fbc8a 100644
--- a/src/char/int_auction.h
+++ b/src/char/int_auction.h
@@ -4,7 +4,7 @@
#ifndef CHAR_INT_AUCTION_H
#define CHAR_INT_AUCTION_H
-#include "../common/mmo.h"
+#include "common/mmo.h"
#ifdef HERCULES_CORE
void inter_auction_defaults(void);
diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c
index 3a5022fe4..e894c866d 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -6,22 +6,22 @@
#include "int_elemental.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
struct inter_elemental_interface inter_elemental_s;
bool mapif_elemental_save(struct s_elemental* ele) {
diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h
index 7aa379ebb..7385fc496 100644
--- a/src/char/int_elemental.h
+++ b/src/char/int_elemental.h
@@ -4,7 +4,7 @@
#ifndef CHAR_INT_ELEMENTAL_H
#define CHAR_INT_ELEMENTAL_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
void inter_elemental_defaults(void);
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 2753964e8..b61b276f1 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -4,26 +4,26 @@
#define HERCULES_CORE
-#include "../config/core.h" // DBPATH
+#include "config/core.h" // DBPATH
#include "int_guild.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
#define GS_MEMBER_UNMODIFIED 0x00
#define GS_MEMBER_MODIFIED 0x01
#define GS_MEMBER_NEW 0x02
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index e7d089943..fe7d28ca4 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -4,7 +4,7 @@
#ifndef CHAR_INT_GUILD_H
#define CHAR_INT_GUILD_H
-#include "../common/mmo.h"
+#include "common/mmo.h"
enum {
GS_BASIC = 0x0001,
diff --git a/src/char/int_homun.c b/src/char/int_homun.c
index 9f91de252..aab585d4c 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -6,22 +6,22 @@
#include "int_homun.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
struct inter_homunculus_interface inter_homunculus_s;
int inter_homunculus_sql_init(void)
diff --git a/src/char/int_homun.h b/src/char/int_homun.h
index 0212da150..113c6d340 100644
--- a/src/char/int_homun.h
+++ b/src/char/int_homun.h
@@ -4,7 +4,7 @@
#ifndef CHAR_INT_HOMUN_H
#define CHAR_INT_HOMUN_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
struct s_homunculus;
diff --git a/src/char/int_mail.c b/src/char/int_mail.c
index cd2fa0deb..c7740d20a 100644
--- a/src/char/int_mail.c
+++ b/src/char/int_mail.c
@@ -6,22 +6,22 @@
#include "int_mail.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
struct inter_mail_interface inter_mail_s;
static int inter_mail_fromsql(int char_id, struct mail_data* md)
diff --git a/src/char/int_mail.h b/src/char/int_mail.h
index 02f640ae2..8e6acf846 100644
--- a/src/char/int_mail.h
+++ b/src/char/int_mail.h
@@ -4,7 +4,7 @@
#ifndef CHAR_INT_MAIL_H
#define CHAR_INT_MAIL_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
struct item;
struct mail_data;
diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c
index 3321627c0..6516c7325 100644
--- a/src/char/int_mercenary.c
+++ b/src/char/int_mercenary.c
@@ -6,22 +6,22 @@
#include "int_mercenary.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
struct inter_mercenary_interface inter_mercenary_s;
bool inter_mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status)
diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h
index 049429e1d..632a9ab37 100644
--- a/src/char/int_mercenary.h
+++ b/src/char/int_mercenary.h
@@ -4,7 +4,7 @@
#ifndef CHAR_INT_MERCENARY_H
#define CHAR_INT_MERCENARY_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
struct mmo_charstatus;
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 8d50c45fa..899ac86ef 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -6,24 +6,24 @@
#include "int_party.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mapindex.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mapindex.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-
struct inter_party_interface inter_party_s;
//Updates party's level range and unsets even share if broken.
diff --git a/src/char/int_party.h b/src/char/int_party.h
index 61d828bc0..df2289982 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -4,7 +4,7 @@
#ifndef CHAR_INT_PARTY_H
#define CHAR_INT_PARTY_H
-#include "../common/mmo.h"
+#include "common/mmo.h"
//Party Flags on what to save/delete.
enum {
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index b01777771..169bae407 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -6,22 +6,22 @@
#include "int_pet.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
struct inter_pet_interface inter_pet_s;
//---------------------------------------------------------
diff --git a/src/char/int_quest.c b/src/char/int_quest.c
index 036229edd..05655725a 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -6,23 +6,23 @@
#include "int_quest.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
struct inter_quest_interface inter_quest_s;
/**
diff --git a/src/char/int_storage.c b/src/char/int_storage.c
index 2584be0cf..cbe7cb5d1 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -4,24 +4,24 @@
#define HERCULES_CORE
-#include "../config/core.h" // GP_BOUND_ITEMS
+#include "config/core.h" // GP_BOUND_ITEMS
#include "int_storage.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h" // StringBuf
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "inter.h"
-#include "mapif.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h" // StringBuf
-
#define STORAGE_MEMINC 16
struct inter_storage_interface inter_storage_s;
diff --git a/src/char/inter.c b/src/char/inter.c
index 3571a3e2e..9707ea710 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -6,33 +6,33 @@
#include "inter.h"
+#include "char/char.h"
+#include "char/geoip.h"
+#include "char/int_auction.h"
+#include "char/int_elemental.h"
+#include "char/int_guild.h"
+#include "char/int_homun.h"
+#include "char/int_mail.h"
+#include "char/int_mercenary.h"
+#include "char/int_party.h"
+#include "char/int_pet.h"
+#include "char/int_quest.h"
+#include "char/int_storage.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "geoip.h"
-#include "int_auction.h"
-#include "int_elemental.h"
-#include "int_guild.h"
-#include "int_homun.h"
-#include "int_mail.h"
-#include "int_mercenary.h"
-#include "int_party.h"
-#include "int_pet.h"
-#include "int_quest.h"
-#include "int_storage.h"
-#include "mapif.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
#define WISDATA_TTL (60*1000) // Wis data Time To Live (60 seconds)
#define WISDELLIST_MAX 256 // Number of elements in the list Delete data Wis
diff --git a/src/char/inter.h b/src/char/inter.h
index a58d3b3a9..2bf8d0847 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -6,8 +6,9 @@
#define CHAR_INTER_H
#include "char.h"
-#include "../common/cbasetypes.h"
-#include "../common/sql.h"
+
+#include "common/cbasetypes.h"
+#include "common/sql.h"
struct accreg;
diff --git a/src/char/loginif.c b/src/char/loginif.c
index f53d9bb71..e90c471e2 100644
--- a/src/char/loginif.c
+++ b/src/char/loginif.c
@@ -6,19 +6,18 @@
#include "loginif.h"
+#include "char/char.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/timer.h"
+
#include <stdlib.h>
#include <string.h>
-#include "char.h"
-#include "mapif.h"
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-
struct loginif_interface loginif_s;
/// Resets all the data.
diff --git a/src/char/loginif.h b/src/char/loginif.h
index 634bd4b8b..66ca046eb 100644
--- a/src/char/loginif.h
+++ b/src/char/loginif.h
@@ -5,7 +5,7 @@
#ifndef CHAR_LOGINIF_H
#define CHAR_LOGINIF_H
-#include "char.h"
+#include "char/char.h"
/**
* loginif interface
diff --git a/src/char/mapif.c b/src/char/mapif.c
index 65f2984fd..92506cd49 100644
--- a/src/char/mapif.c
+++ b/src/char/mapif.c
@@ -6,18 +6,18 @@
#include "mapif.h"
-#include <stdlib.h>
+#include "char/char.h"
+#include "char/int_auction.h"
+#include "char/int_guild.h"
+#include "char/int_homun.h"
+#include "common/cbasetypes.h"
+#include "common/mmo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
-#include "char.h"
-#include "int_auction.h"
-#include "int_homun.h"
-#include "int_guild.h"
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
+#include <stdlib.h>
void mapif_ban(int id, unsigned int flag, int status);
void mapif_server_init(int id);
diff --git a/src/char/mapif.h b/src/char/mapif.h
index 528522d1e..8a95c8233 100644
--- a/src/char/mapif.h
+++ b/src/char/mapif.h
@@ -5,7 +5,7 @@
#ifndef CHAR_MAPIF_H
#define CHAR_MAPIF_H
-#include "char.h"
+#include "char/char.h"
struct s_elemental;
struct s_homunculus;
diff --git a/src/char/pincode.c b/src/char/pincode.c
index c3d2b2298..885a3d1a1 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -6,16 +6,16 @@
#include "pincode.h"
-#include <stdlib.h>
+#include "char/char.h"
+#include "common/cbasetypes.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
-#include "char.h"
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
+#include <stdlib.h>
struct pincode_interface pincode_s;
diff --git a/src/char/pincode.h b/src/char/pincode.h
index 178d7e427..678448964 100644
--- a/src/char/pincode.h
+++ b/src/char/pincode.h
@@ -5,7 +5,7 @@
#ifndef CHAR_PINCODE_H
#define CHAR_PINCODE_H
-#include "char.h"
+#include "char/char.h"
enum PincodeResponseCode {
PINCODE_OK = 0,
diff --git a/src/common/HPM.c b/src/common/HPM.c
index 346748cfe..2b508e233 100644
--- a/src/common/HPM.c
+++ b/src/common/HPM.c
@@ -3,28 +3,28 @@
#define HERCULES_CORE
-#include "../config/core.h" // CONSOLE_INPUT
+#include "config/core.h" // CONSOLE_INPUT
#include "HPM.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/console.h"
+#include "common/core.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/timer.h"
+#include "common/utils.h"
+#include "common/nullpo.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/console.h"
-#include "../common/core.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-#include "../common/nullpo.h"
-
#ifndef WIN32
# include <unistd.h>
#endif
diff --git a/src/common/HPM.h b/src/common/HPM.h
index e99b0f2ae..1358f19dc 100644
--- a/src/common/HPM.h
+++ b/src/common/HPM.h
@@ -8,8 +8,8 @@
#error You should never include HPM.h from a plugin.
#endif
-#include "../common/HPMi.h"
-#include "../common/cbasetypes.h"
+#include "common/HPMi.h"
+#include "common/cbasetypes.h"
#ifdef WIN32
#ifndef WIN32_LEAN_AND_MEAN
diff --git a/src/common/HPMi.h b/src/common/HPMi.h
index 10cf4fd9f..b700c1b73 100644
--- a/src/common/HPMi.h
+++ b/src/common/HPMi.h
@@ -4,10 +4,10 @@
#ifndef COMMON_HPMI_H
#define COMMON_HPMI_H
-#include "../common/cbasetypes.h"
-#include "../common/console.h"
-#include "../common/core.h"
-#include "../common/sql.h"
+#include "common/cbasetypes.h"
+#include "common/console.h"
+#include "common/core.h"
+#include "common/sql.h"
struct script_state;
struct AtCommandInfo;
@@ -21,7 +21,7 @@ struct map_session_data;
#endif
/* after */
-#include "../common/showmsg.h"
+#include "common/showmsg.h"
#define HPM_VERSION "1.0"
#define HPM_ADDCONF_LENGTH 40
diff --git a/src/common/Makefile.in b/src/common/Makefile.in
index 5dfdd35bd..f6f993165 100644
--- a/src/common/Makefile.in
+++ b/src/common/Makefile.in
@@ -6,17 +6,20 @@
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
-LIBCONFIG_D = ../../3rdparty/libconfig
+COMMON_INCLUDE = -I..
+
+THIRDPARTY_D = ../../3rdparty
+THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D)
+
+LIBCONFIG_D = $(THIRDPARTY_D)/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
scanctx.h scanner.h strbuf.h wincompat.h)
-LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_D = $(THIRDPARTY_D)/mt19937ar
MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
COMMON_SHARED_C = conf.c db.c des.c ers.c grfio.c HPM.c mapindex.c md5calc.c \
mutex.c nullpo.c random.c showmsg.c strlib.c sysinfo.c \
@@ -116,15 +119,15 @@ obj_all/sysinfo.o: sysinfo.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_
obj_all/%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
obj_all/mini%.o: %.c $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DMINICORE @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
obj_sql/%.o: %.c $(COMMON_H) $(COMMON_SQL_H) $(CONFIG_H) $(LIBCONFIG_H) | $(SYSINFO_INC) obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(MT19937AR_OBJ):
diff --git a/src/common/atomic.h b/src/common/atomic.h
index a42dfad1c..c1ea2aa48 100644
--- a/src/common/atomic.h
+++ b/src/common/atomic.h
@@ -14,10 +14,10 @@
//
// our Abstraction is fully API-Compatible to Microsoft's implementation @ NT5.0+
//
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#if defined(_MSC_VER)
-#include "../common/winapi.h"
+#include "common/winapi.h"
// This checks if C/C++ Compiler Version is 18.00
#if _MSC_VER < 1800
diff --git a/src/common/conf.c b/src/common/conf.c
index c974decf9..cb0194c3a 100644
--- a/src/common/conf.c
+++ b/src/common/conf.c
@@ -6,9 +6,9 @@
#include "conf.h"
-#include "../../3rdparty/libconfig/libconfig.h"
+#include "common/showmsg.h" // ShowError
-#include "../common/showmsg.h" // ShowError
+#include <libconfig/libconfig.h>
/* interface source */
struct libconfig_interface libconfig_s;
diff --git a/src/common/conf.h b/src/common/conf.h
index bd97d5c1e..771725cf4 100644
--- a/src/common/conf.h
+++ b/src/common/conf.h
@@ -5,9 +5,9 @@
#ifndef COMMON_CONF_H
#define COMMON_CONF_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
-#include "../../3rdparty/libconfig/libconfig.h"
+#include "libconfig/libconfig.h"
/**
* The libconfig interface -- specially for plugins, but we enforce it throughout the core to be consistent
diff --git a/src/common/console.c b/src/common/console.c
index 1eba48fa2..95d1e69fe 100644
--- a/src/common/console.c
+++ b/src/common/console.c
@@ -4,34 +4,33 @@
#define HERCULES_CORE
-#include "../config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT
+#include "config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT
#include "console.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/showmsg.h"
-#include "../common/sysinfo.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/showmsg.h"
+#include "common/sysinfo.h"
#ifndef MINICORE
-# include "../common/atomic.h"
-# include "../common/ers.h"
-# include "../common/malloc.h"
-# include "../common/mutex.h"
-# include "../common/spinlock.h"
-# include "../common/sql.h"
-# include "../common/strlib.h"
-# include "../common/thread.h"
-# include "../common/timer.h"
+# include "common/atomic.h"
+# include "common/ers.h"
+# include "common/malloc.h"
+# include "common/mutex.h"
+# include "common/spinlock.h"
+# include "common/sql.h"
+# include "common/strlib.h"
+# include "common/thread.h"
+# include "common/timer.h"
#endif
+#include <stdio.h>
+#include <stdlib.h>
#if !defined(WIN32)
# include <sys/time.h>
# include <unistd.h>
#else
-# include "../common/winapi.h" // Console close event handling
+# include "common/winapi.h" // Console close event handling
# ifdef CONSOLE_INPUT
# include <conio.h> /* _kbhit() */
# endif
diff --git a/src/common/console.h b/src/common/console.h
index 3d3c8e9dd..643edc3d9 100644
--- a/src/common/console.h
+++ b/src/common/console.h
@@ -4,13 +4,13 @@
#ifndef COMMON_CONSOLE_H
#define COMMON_CONSOLE_H
-#include "../config/core.h" // MAX_CONSOLE_INPUT
+#include "config/core.h" // MAX_CONSOLE_INPUT
-#include "../common/cbasetypes.h"
-#include "../common/mutex.h"
-#include "../common/spinlock.h"
-#include "../common/sql.h"
-#include "../common/thread.h"
+#include "common/cbasetypes.h"
+#include "common/mutex.h"
+#include "common/spinlock.h"
+#include "common/sql.h"
+#include "common/thread.h"
/**
* Queue Max
diff --git a/src/common/core.c b/src/common/core.c
index ea028002a..5a410add1 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -4,41 +4,40 @@
#define HERCULES_CORE
-#include "../config/core.h"
+#include "config/core.h"
#include "core.h"
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "../common/cbasetypes.h"
-#include "../common/console.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-#include "../common/nullpo.h"
+#include "common/cbasetypes.h"
+#include "common/console.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/nullpo.h"
#ifndef MINICORE
-# include "../common/HPM.h"
-# include "../common/conf.h"
-# include "../common/db.h"
-# include "../common/ers.h"
-# include "../common/socket.h"
-# include "../common/sql.h"
-# include "../common/thread.h"
-# include "../common/timer.h"
-# include "../common/utils.h"
+# include "common/HPM.h"
+# include "common/conf.h"
+# include "common/db.h"
+# include "common/ers.h"
+# include "common/socket.h"
+# include "common/sql.h"
+# include "common/thread.h"
+# include "common/timer.h"
+# include "common/utils.h"
#endif
#ifndef _WIN32
# include <unistd.h>
#else
-# include "../common/winapi.h" // Console close event handling
+# include "common/winapi.h" // Console close event handling
#endif
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
/// Called when a terminate signal is received.
void (*shutdown_callback)(void) = NULL;
diff --git a/src/common/core.h b/src/common/core.h
index 827d345ba..d96e8506a 100644
--- a/src/common/core.h
+++ b/src/common/core.h
@@ -5,9 +5,9 @@
#ifndef COMMON_CORE_H
#define COMMON_CORE_H
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/mmo.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/mmo.h"
/* so that developers with --enable-debug can raise signals from any section of the code they'd like */
#ifdef DEBUG
diff --git a/src/common/db.c b/src/common/db.c
index 69e2333a9..5063425e6 100644
--- a/src/common/db.c
+++ b/src/common/db.c
@@ -72,15 +72,15 @@
#include "db.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+
#include <stdio.h>
#include <stdlib.h>
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-
struct db_interface DB_s;
/*****************************************************************************\
diff --git a/src/common/db.h b/src/common/db.h
index 4883489d7..f75cbd8dc 100644
--- a/src/common/db.h
+++ b/src/common/db.h
@@ -42,9 +42,9 @@
#ifndef COMMON_DB_H
#define COMMON_DB_H
-#include <stdarg.h>
+#include "common/cbasetypes.h"
-#include "../common/cbasetypes.h"
+#include <stdarg.h>
/*****************************************************************************\
* (1) Section with public typedefs, enums, unions, structures and defines. *
diff --git a/src/common/des.c b/src/common/des.c
index 89a920bc9..0a702bfdf 100644
--- a/src/common/des.c
+++ b/src/common/des.c
@@ -5,7 +5,7 @@
#include "des.h"
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/// DES (Data Encryption Standard) algorithm, modified version.
/// @see http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=5099.
diff --git a/src/common/des.h b/src/common/des.h
index 9e6aec4fd..6f54b36f2 100644
--- a/src/common/des.h
+++ b/src/common/des.h
@@ -3,7 +3,7 @@
#ifndef COMMON_DES_H
#define COMMON_DES_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/// One 64-bit block.
typedef struct BIT64 { uint8_t b[8]; } BIT64;
diff --git a/src/common/ers.c b/src/common/ers.c
index 52cba0fe5..91fc6ccfb 100644
--- a/src/common/ers.c
+++ b/src/common/ers.c
@@ -44,14 +44,14 @@
#include "ers.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h" // CREATE, RECREATE, aMalloc, aFree
+#include "common/nullpo.h"
+#include "common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL
+
#include <stdlib.h>
#include <string.h>
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h" // CREATE, RECREATE, aMalloc, aFree
-#include "../common/nullpo.h"
-#include "../common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL
-
#ifndef DISABLE_ERS
#define ERS_BLOCK_ENTRIES 2048
diff --git a/src/common/ers.h b/src/common/ers.h
index 0117237d7..09290186e 100644
--- a/src/common/ers.h
+++ b/src/common/ers.h
@@ -40,7 +40,7 @@
#ifndef COMMON_ERS_H
#define COMMON_ERS_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/*****************************************************************************\
* (1) All public parts of the Entry Reusage System. *
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 41a888267..00d6ffc89 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -6,20 +6,20 @@
#include "grfio.h"
+#include "common/cbasetypes.h"
+#include "common/des.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#include <zlib.h>
-#include "../common/cbasetypes.h"
-#include "../common/des.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
//----------------------------
// file entry table struct
//----------------------------
diff --git a/src/common/malloc.c b/src/common/malloc.c
index c647dc18f..008fd0930 100644
--- a/src/common/malloc.c
+++ b/src/common/malloc.c
@@ -6,15 +6,15 @@
#include "malloc.h"
+#include "common/core.h"
+#include "common/showmsg.h"
+#include "common/sysinfo.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "../common/core.h"
-#include "../common/showmsg.h"
-#include "../common/sysinfo.h"
-
struct malloc_interface iMalloc_s;
////////////// Memory Libraries //////////////////
@@ -22,7 +22,7 @@ struct malloc_interface iMalloc_s;
#if defined(MEMWATCH)
# include <string.h>
-# include "memwatch.h"
+# include <memwatch.h>
# define MALLOC(n,file,line,func) mwMalloc((n),(file),(line))
# define CALLOC(m,n,file,line,func) mwCalloc((m),(n),(file),(line))
# define REALLOC(p,n,file,line,func) mwRealloc((p),(n),(file),(line))
@@ -36,7 +36,7 @@ struct malloc_interface iMalloc_s;
# include <string.h>
# include <stdlib.h>
-# include "dmalloc.h"
+# include <dmalloc.h>
# define MALLOC(n,file,line,func) dmalloc_malloc((file),(line),(n),DMALLOC_FUNC_MALLOC,0,0)
# define CALLOC(m,n,file,line,func) dmalloc_malloc((file),(line),(m)*(n),DMALLOC_FUNC_CALLOC,0,0)
# define REALLOC(p,n,file,line,func) dmalloc_realloc((file),(line),(p),(n),DMALLOC_FUNC_REALLOC,0)
@@ -48,7 +48,7 @@ struct malloc_interface iMalloc_s;
#elif defined(GCOLLECT)
-# include "gc.h"
+# include <gc.h>
# ifdef GC_ADD_CALLER
# define RETURN_ADDR 0,
# else
diff --git a/src/common/malloc.h b/src/common/malloc.h
index 7ed2fb19c..20260de84 100644
--- a/src/common/malloc.h
+++ b/src/common/malloc.h
@@ -4,7 +4,7 @@
#ifndef COMMON_MALLOC_H
#define COMMON_MALLOC_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#define ALC_MARK __FILE__, __LINE__, __func__
diff --git a/src/common/mapindex.c b/src/common/mapindex.c
index e07ccd679..42b46246d 100644
--- a/src/common/mapindex.c
+++ b/src/common/mapindex.c
@@ -6,16 +6,16 @@
#include "mapindex.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-
/* mapindex.c interface source */
struct mapindex_interface mapindex_s;
diff --git a/src/common/mapindex.h b/src/common/mapindex.h
index 87a275f57..408078ceb 100644
--- a/src/common/mapindex.h
+++ b/src/common/mapindex.h
@@ -5,8 +5,8 @@
#ifndef COMMON_MAPINDEX_H
#define COMMON_MAPINDEX_H
-#include "../common/db.h"
-#include "../common/mmo.h"
+#include "common/db.h"
+#include "common/mmo.h"
#define MAX_MAPINDEX 2000
diff --git a/src/common/md5calc.c b/src/common/md5calc.c
index 7b31a38d6..e27b64504 100644
--- a/src/common/md5calc.c
+++ b/src/common/md5calc.c
@@ -10,12 +10,12 @@
#include "md5calc.h"
+#include "common/random.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/random.h"
-
#ifndef UINT_MAX
#define UINT_MAX 4294967295U
#endif
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 766ccf182..94a4b06da 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -5,11 +5,11 @@
#ifndef COMMON_MMO_H
#define COMMON_MMO_H
-#include <time.h>
+#include "config/core.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
-#include "../config/core.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include <time.h>
// server->client protocol version
// 0 - pre-?
diff --git a/src/common/mutex.c b/src/common/mutex.c
index 7307f5f15..59c04d4f0 100644
--- a/src/common/mutex.c
+++ b/src/common/mutex.c
@@ -5,20 +5,19 @@
#include "mutex.h"
-#include "../common/cbasetypes.h" // for WIN32
+#include "common/cbasetypes.h" // for WIN32
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/timer.h"
#ifdef WIN32
-#include "../common/winapi.h"
+#include "common/winapi.h"
#else
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#endif
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/timer.h"
-
struct ramutex{
#ifdef WIN32
CRITICAL_SECTION hMutex;
diff --git a/src/common/mutex.h b/src/common/mutex.h
index fa8170c98..a70f0e8fd 100644
--- a/src/common/mutex.h
+++ b/src/common/mutex.h
@@ -4,7 +4,7 @@
#ifndef COMMON_MUTEX_H
#define COMMON_MUTEX_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
typedef struct ramutex ramutex; // Mutex
typedef struct racond racond; // Condition Var
diff --git a/src/common/nullpo.c b/src/common/nullpo.c
index d494822fa..a8980885f 100644
--- a/src/common/nullpo.c
+++ b/src/common/nullpo.c
@@ -6,6 +6,8 @@
#include "nullpo.h"
+#include "common/showmsg.h"
+
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -14,8 +16,6 @@
#include <execinfo.h>
#endif
-#include "../common/showmsg.h"
-
struct nullpo_interface nullpo_s;
/**
diff --git a/src/common/nullpo.h b/src/common/nullpo.h
index 573e351e0..a59c2ac2b 100644
--- a/src/common/nullpo.h
+++ b/src/common/nullpo.h
@@ -5,7 +5,7 @@
#ifndef COMMON_NULLPO_H
#define COMMON_NULLPO_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
// enabled by default on debug builds
#if defined(DEBUG) && !defined(NULLPO_CHECK)
diff --git a/src/common/random.c b/src/common/random.c
index 88d5748cf..70257fcb6 100644
--- a/src/common/random.c
+++ b/src/common/random.c
@@ -7,14 +7,14 @@
#include <time.h> // time
-#include <mt19937ar.h> // init_genrand, genrand_int32, genrand_res53
+#include "common/cbasetypes.h" // for WIN32
+#include "common/showmsg.h"
+#include "common/timer.h" // gettick
-#include "../common/cbasetypes.h" // for WIN32
-#include "../common/showmsg.h"
-#include "../common/timer.h" // gettick
+#include <mt19937ar/mt19937ar.h> // init_genrand, genrand_int32, genrand_res53
#if defined(WIN32)
-# include "../common/winapi.h"
+# include "common/winapi.h"
#elif defined(HAVE_GETPID) || defined(HAVE_GETTID)
# include <sys/types.h>
# include <unistd.h>
diff --git a/src/common/random.h b/src/common/random.h
index 0ca375d28..379e675b2 100644
--- a/src/common/random.h
+++ b/src/common/random.h
@@ -4,7 +4,7 @@
#ifndef COMMON_RANDOM_H
#define COMMON_RANDOM_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
void rnd_init(void);
diff --git a/src/common/showmsg.c b/src/common/showmsg.c
index 0dd645eeb..3eb7ba0af 100644
--- a/src/common/showmsg.c
+++ b/src/common/showmsg.c
@@ -6,20 +6,20 @@
#include "showmsg.h"
+#include "common/cbasetypes.h"
+#include "common/core.h" //[Ind] - For SERVER_TYPE
+#include "common/strlib.h" // StringBuf
+
+#include <libconfig/libconfig.h>
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h> // atexit
#include <string.h>
#include <time.h>
-#include "../../3rdparty/libconfig/libconfig.h"
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h" //[Ind] - For SERVER_TYPE
-#include "../common/strlib.h" // StringBuf
-
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
#else // not WIN32
# include <unistd.h>
#endif // WIN32
diff --git a/src/common/showmsg.h b/src/common/showmsg.h
index 0624f1786..63e42ab57 100644
--- a/src/common/showmsg.h
+++ b/src/common/showmsg.h
@@ -5,16 +5,16 @@
#ifndef COMMON_SHOWMSG_H
#define COMMON_SHOWMSG_H
-#include <stdarg.h>
-
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
-# include "../../3rdparty/libconfig/libconfig.h"
+# include <libconfig/libconfig.h>
#else
-# include "../common/HPMi.h"
+# include "common/HPMi.h"
#endif
+#include <stdarg.h>
+
// for help with the console colors look here:
// http://www.edoceo.com/liberum/?doc=printf-with-color
// some code explanation (used here):
diff --git a/src/common/socket.c b/src/common/socket.c
index 1b7f36f8b..aa575f1a6 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -4,26 +4,26 @@
#define HERCULES_CORE
-#include "../config/core.h" // SHOW_SERVER_STATS
+#include "config/core.h" // SHOW_SERVER_STATS
#define H_SOCKET_C
#include "socket.h"
#undef H_SOCKET_C
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
#else
# include <arpa/inet.h>
# include <errno.h>
diff --git a/src/common/socket.h b/src/common/socket.h
index 6323a6862..94f86759b 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -5,12 +5,12 @@
#ifndef COMMON_SOCKET_H
#define COMMON_SOCKET_H
-#include <time.h>
+#include "common/cbasetypes.h"
-#include "../common/cbasetypes.h"
+#include <time.h>
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
typedef long in_addr_t;
#else
# include <netinet/in.h>
diff --git a/src/common/spinlock.h b/src/common/spinlock.h
index 413067b68..811b239df 100644
--- a/src/common/spinlock.h
+++ b/src/common/spinlock.h
@@ -14,12 +14,12 @@
//
//
-#include "../common/atomic.h"
-#include "../common/cbasetypes.h"
-#include "../common/thread.h"
+#include "common/atomic.h"
+#include "common/cbasetypes.h"
+#include "common/thread.h"
#ifdef WIN32
-#include "../common/winapi.h"
+#include "common/winapi.h"
#endif
#ifdef WIN32
diff --git a/src/common/sql.c b/src/common/sql.c
index 4ca14d43b..9dc8144bf 100644
--- a/src/common/sql.c
+++ b/src/common/sql.c
@@ -6,19 +6,18 @@
#include "sql.h"
-#include <stdlib.h> // strtoul
-#include <string.h> // strlen/strnlen/memcpy/memset
-
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
#ifdef WIN32
-# include "../common/winapi.h" // Needed before mysql.h
+# include "common/winapi.h" // Needed before mysql.h
#endif
#include <mysql.h>
+#include <stdlib.h> // strtoul
+#include <string.h> // strlen/strnlen/memcpy/memset
void hercules_mysql_error_handler(unsigned int ecode);
diff --git a/src/common/sql.h b/src/common/sql.h
index c3598273e..d76b4f9d4 100644
--- a/src/common/sql.h
+++ b/src/common/sql.h
@@ -5,9 +5,9 @@
#ifndef COMMON_SQL_H
#define COMMON_SQL_H
-#include <stdarg.h>// va_list
+#include "common/cbasetypes.h"
-#include "../common/cbasetypes.h"
+#include <stdarg.h>// va_list
// Return codes
#define SQL_ERROR (-1)
diff --git a/src/common/strlib.c b/src/common/strlib.c
index b5fcff576..555f591e6 100644
--- a/src/common/strlib.c
+++ b/src/common/strlib.c
@@ -8,14 +8,14 @@
#include "strlib.h"
#undef H_STRLIB_C
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-
#define J_MAX_MALLOC_SIZE 65535
struct strlib_interface strlib_s;
diff --git a/src/common/strlib.h b/src/common/strlib.h
index c687d9e17..a768ebff5 100644
--- a/src/common/strlib.h
+++ b/src/common/strlib.h
@@ -5,11 +5,11 @@
#ifndef COMMON_STRLIB_H
#define COMMON_STRLIB_H
+#include "common/cbasetypes.h"
+
#include <stdarg.h>
#include <string.h>
-#include "../common/cbasetypes.h"
-
#ifdef WIN32
#define HAVE_STRTOK_R
#define strtok_r(s,delim,save_ptr) strtok_r_((s),(delim),(save_ptr))
diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c
index 7edc5c72e..33ffc43f3 100644
--- a/src/common/sysinfo.c
+++ b/src/common/sysinfo.c
@@ -8,14 +8,13 @@
#include "sysinfo.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/malloc.h"
+#include "common/strlib.h"
+
#include <stdio.h> // fopen
#include <stdlib.h> // atoi
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/malloc.h"
-#include "../common/strlib.h"
-
#ifdef WIN32
# include <string.h> // strlen
# include <windows.h>
diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h
index 8c8f6dbe6..3c0d01ca1 100644
--- a/src/common/sysinfo.h
+++ b/src/common/sysinfo.h
@@ -11,7 +11,7 @@
* cached at compile time)
*/
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
struct sysinfo_private;
diff --git a/src/common/thread.c b/src/common/thread.c
index 95212b4b0..9b9308d06 100644
--- a/src/common/thread.c
+++ b/src/common/thread.c
@@ -10,10 +10,13 @@
#include "thread.h"
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/sysinfo.h" // sysinfo->getpagesize()
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
# define __thread __declspec( thread )
#else
# include <pthread.h>
@@ -24,10 +27,6 @@
# include <unistd.h>
#endif
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/sysinfo.h" // sysinfo->getpagesize()
-
// When Compiling using MSC (on win32..) we know we have support in any case!
#ifdef _MSC_VER
#define HAS_TLS
diff --git a/src/common/thread.h b/src/common/thread.h
index f79eb77f9..36ea006b3 100644
--- a/src/common/thread.h
+++ b/src/common/thread.h
@@ -4,7 +4,7 @@
#ifndef COMMON_THREAD_H
#define COMMON_THREAD_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
typedef struct rAthread rAthread;
typedef void* (*rAthreadProc)(void*);
diff --git a/src/common/timer.c b/src/common/timer.c
index 45dbb9f50..42eb892ad 100644
--- a/src/common/timer.c
+++ b/src/common/timer.c
@@ -6,24 +6,24 @@
#include "timer.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/utils.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/utils.h"
#ifdef WIN32
-# include "../common/winapi.h" // GetTickCount()
+# include "common/winapi.h" // GetTickCount()
#else
# include <sys/time.h> // struct timeval, gettimeofday()
# include <unistd.h>
#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
struct timer_interface timer_s;
// If the server can't handle processing thousands of monsters
diff --git a/src/common/timer.h b/src/common/timer.h
index 6e8a72389..46a036ec7 100644
--- a/src/common/timer.h
+++ b/src/common/timer.h
@@ -5,7 +5,7 @@
#ifndef COMMON_TIMER_H
#define COMMON_TIMER_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#define DIFF_TICK(a,b) ((a)-(b))
#define DIFF_TICK32(a,b) ((int32)((a)-(b)))
diff --git a/src/common/utils.c b/src/common/utils.c
index ad68706ca..865b3575b 100644
--- a/src/common/utils.c
+++ b/src/common/utils.c
@@ -6,23 +6,16 @@
#include "utils.h"
-#include <math.h> // floor()
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h> // cache purposes [Ind/Hercules]
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
#ifdef WIN32
-# include "../common/winapi.h"
+# include "common/winapi.h"
# ifndef F_OK
# define F_OK 0x0
# endif /* F_OK */
@@ -32,6 +25,13 @@
# include <unistd.h>
#endif
+#include <math.h> // floor()
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h> // cache purposes [Ind/Hercules]
+
struct HCache_interface HCache_s;
/// Dumps given buffer into file pointed to by a handle.
diff --git a/src/common/utils.h b/src/common/utils.h
index e6102f184..57113aea0 100644
--- a/src/common/utils.h
+++ b/src/common/utils.h
@@ -5,11 +5,11 @@
#ifndef COMMON_UTILS_H
#define COMMON_UTILS_H
+#include "common/cbasetypes.h"
+
#include <stdio.h> // FILE*
#include <time.h>
-#include "../common/cbasetypes.h"
-
/* [HCache] 1-byte key to ensure our method is the latest, we can modify to ensure the method matches */
#define HCACHE_KEY 'k'
diff --git a/src/login/HPMlogin.c b/src/login/HPMlogin.c
index 6b223d249..c9e0e094c 100644
--- a/src/login/HPMlogin.c
+++ b/src/login/HPMlogin.c
@@ -5,27 +5,27 @@
#include "HPMlogin.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
+#include "common/des.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/mapindex.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+
+#include "common/HPMDataCheck.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/db.h"
-#include "../common/des.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/mapindex.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-
-#include "../common/HPMDataCheck.h"
-
bool HPM_login_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) {
/* record address */
switch( type ) {
diff --git a/src/login/HPMlogin.h b/src/login/HPMlogin.h
index 6e01eae01..2a4d5c538 100644
--- a/src/login/HPMlogin.h
+++ b/src/login/HPMlogin.h
@@ -8,8 +8,8 @@
#error You should never include HPMlogin.h from a plugin.
#endif
-#include "../common/cbasetypes.h"
-#include "../common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/HPM.h"
struct hplugin;
diff --git a/src/login/Makefile.in b/src/login/Makefile.in
index 9b1db69c2..60382dc87 100644
--- a/src/login/Makefile.in
+++ b/src/login/Makefile.in
@@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
COMMON_H = $(wildcard $(COMMON_D)/*.h)
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
+COMMON_INCLUDE = -I..
-LIBCONFIG_D = ../../3rdparty/libconfig
+THIRDPARTY_D = ../../3rdparty
+THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D)
+
+LIBCONFIG_D = $(THIRDPARTY_D)/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
scanctx.h scanner.h strbuf.h wincompat.h)
-LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_D = $(THIRDPARTY_D)/mt19937ar
MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
LOGIN_C = account_sql.c HPMlogin.c ipban_sql.c login.c loginlog_sql.c
LOGIN_OBJ = $(addprefix obj_sql/, $(patsubst %.c,%.o,$(LOGIN_C)))
@@ -94,7 +96,7 @@ login-server: ../../login-server@EXEEXT@
obj_sql/%.o: %.c $(LOGIN_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/login/account.h b/src/login/account.h
index 82ae28bbb..1e95c19de 100644
--- a/src/login/account.h
+++ b/src/login/account.h
@@ -5,9 +5,9 @@
#ifndef LOGIN_ACCOUNT_H
#define LOGIN_ACCOUNT_H
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h" // ACCOUNT_REG2_NUM
-#include "../common/sql.h" // Sql
+#include "common/cbasetypes.h"
+#include "common/mmo.h" // ACCOUNT_REG2_NUM
+#include "common/sql.h" // Sql
typedef struct AccountDB AccountDB;
typedef struct AccountDBIterator AccountDBIterator;
diff --git a/src/login/account_sql.c b/src/login/account_sql.c
index 8975250b8..8696666e3 100644
--- a/src/login/account_sql.c
+++ b/src/login/account_sql.c
@@ -4,22 +4,22 @@
#define HERCULES_CORE
-#include "../config/core.h" // CONSOLE_INPUT
+#include "config/core.h" // CONSOLE_INPUT
#include "account.h"
+#include "common/console.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdlib.h>
#include <string.h>
-#include "../common/console.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
/// global defines
#define ACCOUNT_SQL_DB_VERSION 20110114
diff --git a/src/login/ipban.h b/src/login/ipban.h
index c6535ec10..8f3cac16c 100644
--- a/src/login/ipban.h
+++ b/src/login/ipban.h
@@ -4,7 +4,7 @@
#ifndef LOGIN_IPBAN_H
#define LOGIN_IPBAN_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
// TODO: Interface
diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c
index f995450ce..533ee3c4c 100644
--- a/src/login/ipban_sql.c
+++ b/src/login/ipban_sql.c
@@ -6,20 +6,20 @@
#include "ipban.h"
+#include "login/login.h"
+#include "login/loginlog.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/sql.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdlib.h>
#include <string.h>
-#include "login.h"
-#include "loginlog.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/sql.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
// global sql settings
static char global_db_hostname[32] = "127.0.0.1";
static uint16 global_db_port = 3306;
diff --git a/src/login/login.c b/src/login/login.c
index 9c01c3956..9175bed56 100644
--- a/src/login/login.c
+++ b/src/login/login.c
@@ -6,27 +6,27 @@
#include "login.h"
+#include "login/HPMlogin.h"
+#include "login/account.h"
+#include "login/ipban.h"
+#include "login/loginlog.h"
+#include "common/HPM.h"
+#include "common/core.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/md5calc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "HPMlogin.h"
-#include "account.h"
-#include "ipban.h"
-#include "loginlog.h"
-#include "../common/HPM.h"
-#include "../common/core.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/md5calc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct login_interface login_s;
struct Login_Config login_config;
struct mmo_char_server server[MAX_SERVERS]; // char server data
diff --git a/src/login/login.h b/src/login/login.h
index 22bae50e0..5343b31a0 100644
--- a/src/login/login.h
+++ b/src/login/login.h
@@ -5,8 +5,8 @@
#ifndef LOGIN_LOGIN_H
#define LOGIN_LOGIN_H
-#include "../common/core.h" // CORE_ST_LAST
-#include "../common/mmo.h" // NAME_LENGTH,SEX_*
+#include "common/core.h" // CORE_ST_LAST
+#include "common/mmo.h" // NAME_LENGTH,SEX_*
struct mmo_account;
struct AccountDB;
diff --git a/src/login/loginlog.h b/src/login/loginlog.h
index 2104ff277..f4327764a 100644
--- a/src/login/loginlog.h
+++ b/src/login/loginlog.h
@@ -4,7 +4,7 @@
#ifndef LOGIN_LOGINLOG_H
#define LOGIN_LOGINLOG_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
// TODO: Interface
diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c
index 2c6f76e38..da9beda4f 100644
--- a/src/login/loginlog_sql.c
+++ b/src/login/loginlog_sql.c
@@ -6,16 +6,16 @@
#include "loginlog.h"
+#include "common/cbasetypes.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/socket.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+
#include <string.h>
#include <stdlib.h> // exit
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/socket.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-
// global sql settings (in ipban_sql.c)
static char global_db_hostname[32] = "127.0.0.1";
static uint16 global_db_port = 3306;
diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c
index d6a1bd8ef..4b8c735fc 100644
--- a/src/map/HPMmap.c
+++ b/src/map/HPMmap.c
@@ -10,58 +10,58 @@
#include <string.h>
#include <time.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "battleground.h"
-#include "channel.h"
-#include "chat.h"
-#include "chrif.h"
-#include "clif.h"
-#include "date.h"
-#include "duel.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "intif.h"
-#include "irc-bot.h"
-#include "itemdb.h"
-#include "log.h"
-#include "mail.h"
-#include "map.h"
-#include "mapreg.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "path.h"
-#include "pc.h"
-#include "pc_groups.h"
-#include "pet.h"
-#include "quest.h"
-#include "script.h"
-#include "searchstore.h"
-#include "skill.h"
-#include "status.h"
-#include "storage.h"
-#include "trade.h"
-#include "unit.h"
-#include "vending.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/db.h"
-#include "../common/des.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/mapindex.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/battleground.h"
+#include "map/channel.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/date.h"
+#include "map/duel.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/irc-bot.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/map.h"
+#include "map/mapreg.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pc_groups.h"
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/script.h"
+#include "map/searchstore.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "map/trade.h"
+#include "map/unit.h"
+#include "map/vending.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
+#include "common/des.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/mapindex.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
-#include "../common/HPMDataCheck.h"
+#include "common/HPMDataCheck.h"
struct HPM_atcommand_list {
//tracking currently not enabled
diff --git a/src/map/HPMmap.h b/src/map/HPMmap.h
index 0c727d017..00a8f43c3 100644
--- a/src/map/HPMmap.h
+++ b/src/map/HPMmap.h
@@ -8,9 +8,9 @@
#error You should never include HPMmap.h from a plugin.
#endif
-#include "../common/cbasetypes.h"
-#include "../map/atcommand.h"
-#include "../common/HPM.h"
+#include "map/atcommand.h"
+#include "common/cbasetypes.h"
+#include "common/HPM.h"
struct hplugin;
struct map_session_data;
diff --git a/src/map/Makefile.in b/src/map/Makefile.in
index 90bb55694..ac1b4d837 100644
--- a/src/map/Makefile.in
+++ b/src/map/Makefile.in
@@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
COMMON_H = $(wildcard $(COMMON_D)/*.h)
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
+COMMON_INCLUDE = -I..
-LIBCONFIG_D = ../../3rdparty/libconfig
+THIRDPARTY_D = ../../3rdparty
+THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D)
+
+LIBCONFIG_D = $(THIRDPARTY_D)/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
scanctx.h scanner.h strbuf.h wincompat.h)
-LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_D = $(THIRDPARTY_D)/mt19937ar
MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
MAP_C = atcommand.c battle.c battleground.c buyingstore.c channel.c chat.c \
chrif.c clif.c date.c duel.c elemental.c guild.c homunculus.c HPMmap.c \
@@ -111,7 +113,7 @@ map-server: ../../map-server@EXEEXT@
obj_sql/%.o: %.c $(MAP_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj_sql
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) $(PCRE_CFLAGS) @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index f3ee84197..1e915de3d 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -4,59 +4,59 @@
#define HERCULES_CORE
-#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP
+#include "config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP
#include "atcommand.h"
+#include "map/HPMmap.h"
+#include "map/battle.h"
+#include "map/channel.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/duel.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/map.h"
+#include "map/mapreg.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/pc_groups.h" // groupid2name
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/script.h"
+#include "map/searchstore.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "map/trade.h"
+#include "map/unit.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/core.h"
+#include "common/malloc.h"
+#include "common/mmo.h" // MAX_CARTS
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "HPMmap.h"
-#include "battle.h"
-#include "channel.h"
-#include "chat.h"
-#include "chrif.h"
-#include "clif.h"
-#include "duel.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "mail.h"
-#include "map.h"
-#include "mapreg.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "pc_groups.h" // groupid2name
-#include "pet.h"
-#include "quest.h"
-#include "script.h"
-#include "searchstore.h"
-#include "skill.h"
-#include "status.h"
-#include "storage.h"
-#include "trade.h"
-#include "unit.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/core.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h" // MAX_CARTS
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct atcommand_interface atcommand_s;
static char atcmd_output[CHAT_SIZE_MAX];
diff --git a/src/map/atcommand.h b/src/map/atcommand.h
index c1f451ad3..c9c70badb 100644
--- a/src/map/atcommand.h
+++ b/src/map/atcommand.h
@@ -5,9 +5,9 @@
#ifndef MAP_ATCOMMAND_H
#define MAP_ATCOMMAND_H
-#include "pc_groups.h"
-#include "../common/conf.h"
-#include "../common/db.h"
+#include "map/pc_groups.h"
+#include "common/conf.h"
+#include "common/db.h"
/**
* Declarations
diff --git a/src/map/battle.c b/src/map/battle.c
index b7ee23d09..8a834574b 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -4,43 +4,43 @@
#define HERCULES_CORE
-#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, HMAP_ZONE_DAMAGE_CAP_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, RE_LVL_DMOD(), RE_LVL_MDMOD(), RE_LVL_TMDMOD(), RE_SKILL_REDUCTION(), SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, STATS_OPT_OUT
+#include "config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, HMAP_ZONE_DAMAGE_CAP_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, RE_LVL_DMOD(), RE_LVL_MDMOD(), RE_LVL_TMDMOD(), RE_SKILL_REDUCTION(), SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, STATS_OPT_OUT
#include "battle.h"
+#include "map/battleground.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/itemdb.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "battleground.h"
-#include "chrif.h"
-#include "clif.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "itemdb.h"
-#include "map.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "party.h"
-#include "path.h"
-#include "pc.h"
-#include "pet.h"
-#include "skill.h"
-#include "status.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct Battle_Config battle_config;
struct battle_interface battle_s;
diff --git a/src/map/battle.h b/src/map/battle.h
index 58490e869..6bc2659b9 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -5,8 +5,8 @@
#ifndef MAP_BATTLE_H
#define MAP_BATTLE_H
-#include "map.h" //ELE_MAX
-#include "../common/cbasetypes.h"
+#include "map/map.h" //ELE_MAX
+#include "common/cbasetypes.h"
/**
* Declarations
diff --git a/src/map/battleground.c b/src/map/battleground.c
index 3c7c1db43..44f3664a4 100644
--- a/src/map/battleground.c
+++ b/src/map/battleground.c
@@ -6,30 +6,30 @@
#include "battleground.h"
+#include "map/battle.h"
+#include "map/clif.h"
+#include "map/homunculus.h"
+#include "map/map.h"
+#include "map/mapreg.h"
+#include "map/mercenary.h"
+#include "map/mob.h" // struct mob_data
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/HPM.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <string.h>
-#include "battle.h"
-#include "clif.h"
-#include "homunculus.h"
-#include "map.h"
-#include "mapreg.h"
-#include "mercenary.h"
-#include "mob.h" // struct mob_data
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "pet.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/HPM.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
struct battleground_interface bg_s;
/// Search a BG Team using bg_id
diff --git a/src/map/battleground.h b/src/map/battleground.h
index 87d56516a..aaa76b5d2 100644
--- a/src/map/battleground.h
+++ b/src/map/battleground.h
@@ -5,9 +5,9 @@
#ifndef MAP_BATTLEGROUND_H
#define MAP_BATTLEGROUND_H
-#include "clif.h"
-#include "guild.h"
-#include "../common/mmo.h" // struct party
+#include "map/clif.h"
+#include "map/guild.h"
+#include "common/mmo.h" // struct party
/**
* Defines
diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c
index 531a55e71..d1ce4ba0d 100644
--- a/src/map/buyingstore.c
+++ b/src/map/buyingstore.c
@@ -4,19 +4,19 @@
#define HERCULES_CORE
-#include "buyingstore.h" // struct s_buyingstore
-
-#include "atcommand.h" // msg_txt
-#include "battle.h" // battle_config.*
-#include "chrif.h"
-#include "clif.h" // clif->buyingstore_*
-#include "log.h" // log_pick_pc, log_zeny
-#include "pc.h" // struct map_session_data
-#include "../common/cbasetypes.h"
-#include "../common/db.h" // ARR_FIND
-#include "../common/showmsg.h" // ShowWarning
-#include "../common/socket.h" // RBUF*
-#include "../common/strlib.h" // safestrncpy
+#include "buyingstore.h" // struct s_buyingstore
+
+#include "map/atcommand.h" // msg_txt
+#include "map/battle.h" // battle_config.*
+#include "map/chrif.h"
+#include "map/clif.h" // clif-"buyingstore_*
+#include "map/log.h" // log_pick_pc, log_zeny
+#include "map/pc.h" // struct map_session_data
+#include "common/cbasetypes.h"
+#include "common/db.h" // ARR_FIND
+#include "common/showmsg.h" // ShowWarning
+#include "common/socket.h" // RBUF*
+#include "common/strlib.h" // safestrncpy
struct buyingstore_interface buyingstore_s;
diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h
index 7b8e369d2..f23790459 100644
--- a/src/map/buyingstore.h
+++ b/src/map/buyingstore.h
@@ -5,8 +5,8 @@
#ifndef MAP_BUYINGSTORE_H
#define MAP_BUYINGSTORE_H
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h" // MAX_SLOTS
+#include "common/cbasetypes.h"
+#include "common/mmo.h" // MAX_SLOTS
struct map_session_data;
diff --git a/src/map/channel.c b/src/map/channel.c
index f7ab978a6..69f7ab872 100644
--- a/src/map/channel.c
+++ b/src/map/channel.c
@@ -5,28 +5,28 @@
#include "channel.h"
+#include "map/atcommand.h"
+#include "map/guild.h"
+#include "map/instance.h"
+#include "map/irc-bot.h"
+#include "map/map.h"
+#include "map/pc.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h"
-#include "guild.h"
-#include "instance.h"
-#include "irc-bot.h"
-#include "map.h"
-#include "pc.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct channel_interface channel_s;
static struct Channel_Config channel_config;
diff --git a/src/map/channel.h b/src/map/channel.h
index 8fbf08d42..dbf9ba94f 100644
--- a/src/map/channel.h
+++ b/src/map/channel.h
@@ -4,11 +4,11 @@
#ifndef MAP_CHANNEL_H
#define MAP_CHANNEL_H
-#include <stdarg.h>
+#include "map/map.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
-#include "map.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include <stdarg.h>
/**
* Declarations
diff --git a/src/map/chat.c b/src/map/chat.c
index e296fddec..08c904290 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -6,23 +6,23 @@
#include "chat.h"
+#include "map/atcommand.h" // msg_sd(sd,)
+#include "map/battle.h" // struct battle_config
+#include "map/clif.h"
+#include "map/map.h"
+#include "map/npc.h" // npc_event_do()
+#include "map/pc.h"
+#include "map/skill.h" // ext_skill_unit_onplace()
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+
#include <stdio.h>
#include <string.h>
-#include "atcommand.h" // msg_sd(sd,)
-#include "battle.h" // struct battle_config
-#include "clif.h"
-#include "map.h"
-#include "npc.h" // npc_event_do()
-#include "pc.h"
-#include "skill.h" // ext_skill_unit_onplace()
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-
struct chat_interface chat_s;
/// Initializes a chatroom object (common functionality for both pc and npc chatrooms).
diff --git a/src/map/chat.h b/src/map/chat.h
index ced216b41..31048d5dd 100644
--- a/src/map/chat.h
+++ b/src/map/chat.h
@@ -5,9 +5,9 @@
#ifndef MAP_CHAT_H
#define MAP_CHAT_H
-#include "map.h" // struct block_list, CHATROOM_TITLE_SIZE
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include "map/map.h" // struct block_list, CHATROOM_TITLE_SIZE
+#include "common/cbasetypes.h"
+#include "common/db.h"
struct chat_data;
struct map_session_data;
diff --git a/src/map/chrif.c b/src/map/chrif.c
index d3d0aa10c..cc1f5db4b 100644
--- a/src/map/chrif.c
+++ b/src/map/chrif.c
@@ -4,40 +4,40 @@
#define HERCULES_CORE
-#include "../config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT
+#include "config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT
#include "chrif.h"
+#include "map/map.h"
+#include "map/battle.h"
+#include "map/clif.h"
+#include "map/intif.h"
+#include "map/npc.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/mercenary.h"
+#include "map/elemental.h"
+#include "map/quest.h"
+#include "map/storage.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <time.h>
-#include "map.h"
-#include "battle.h"
-#include "clif.h"
-#include "intif.h"
-#include "npc.h"
-#include "pc.h"
-#include "pet.h"
-#include "skill.h"
-#include "status.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "mercenary.h"
-#include "elemental.h"
-#include "quest.h"
-#include "storage.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
struct chrif_interface chrif_s;
//Used Packets:
diff --git a/src/map/chrif.h b/src/map/chrif.h
index c90d00ef5..022e4d957 100644
--- a/src/map/chrif.h
+++ b/src/map/chrif.h
@@ -5,11 +5,11 @@
#ifndef MAP_CHRIF_H
#define MAP_CHRIF_H
-#include <time.h>
+#include "map/map.h" //TBL_stuff
+#include "common/cbasetypes.h"
+#include "common/db.h"
-#include "map.h" //TBL_stuff
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include <time.h>
struct status_change_entry;
diff --git a/src/map/clif.c b/src/map/clif.c
index a8fa2e6e7..d9b20e570 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4,60 +4,60 @@
#define HERCULES_CORE
-#include "../config/core.h" // ANTI_MAYAP_CHEAT, RENEWAL, SECURE_NPCTIMEOUT
+#include "config/core.h" // ANTI_MAYAP_CHEAT, RENEWAL, SECURE_NPCTIMEOUT
#include "clif.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/battleground.h"
+#include "map/channel.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/irc-bot.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "map/trade.h"
+#include "map/unit.h"
+#include "map/vending.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/ers.h"
+#include "common/grfio.h"
+#include "common/malloc.h"
+#include "common/mmo.h" // NEW_CARTS
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <time.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "battleground.h"
-#include "channel.h"
-#include "chat.h"
-#include "chrif.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "intif.h"
-#include "irc-bot.h"
-#include "itemdb.h"
-#include "log.h"
-#include "mail.h"
-#include "map.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "pet.h"
-#include "quest.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "storage.h"
-#include "trade.h"
-#include "unit.h"
-#include "vending.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/ers.h"
-#include "../common/grfio.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h" // NEW_CARTS
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct clif_interface clif_s;
/* re-usable */
diff --git a/src/map/clif.h b/src/map/clif.h
index f4402bdf7..2ba881a31 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -5,13 +5,13 @@
#ifndef MAP_CLIF_H
#define MAP_CLIF_H
-#include <stdarg.h>
+#include "map/map.h"
+#include "map/packets_struct.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/mmo.h"
-#include "map.h"
-#include "packets_struct.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/mmo.h"
+#include <stdarg.h>
/**
* Declarations
diff --git a/src/map/date.c b/src/map/date.c
index 975a00c50..e2ad2b179 100644
--- a/src/map/date.c
+++ b/src/map/date.c
@@ -5,9 +5,9 @@
#include "date.h"
-#include <time.h>
+#include "common/cbasetypes.h"
-#include "../common/cbasetypes.h"
+#include <time.h>
int date_get_year(void)
{
diff --git a/src/map/date.h b/src/map/date.h
index a57d8132c..e7d06f29d 100644
--- a/src/map/date.h
+++ b/src/map/date.h
@@ -4,7 +4,7 @@
#ifndef MAP_DATE_H
#define MAP_DATE_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#ifdef HERCULES_CORE
// TODO: Interface
diff --git a/src/map/duel.c b/src/map/duel.c
index 2dae0ae0e..4cd2e276f 100644
--- a/src/map/duel.c
+++ b/src/map/duel.c
@@ -6,16 +6,16 @@
#include "duel.h"
+#include "map/atcommand.h" // msg_txt
+#include "map/clif.h"
+#include "map/pc.h"
+#include "common/cbasetypes.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "atcommand.h" // msg_txt
-#include "clif.h"
-#include "pc.h"
-#include "../common/cbasetypes.h"
-
struct duel_interface duel_s;
/*==========================================
diff --git a/src/map/duel.h b/src/map/duel.h
index fa12a4032..0c55c1266 100644
--- a/src/map/duel.h
+++ b/src/map/duel.h
@@ -5,7 +5,7 @@
#ifndef MAP_DUEL_H
#define MAP_DUEL_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
struct map_session_data;
diff --git a/src/map/elemental.c b/src/map/elemental.c
index 92915d168..bf0d42ce9 100644
--- a/src/map/elemental.c
+++ b/src/map/elemental.c
@@ -6,41 +6,41 @@
#include "elemental.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/guild.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/trade.h"
+#include "map/unit.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "guild.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "pet.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "trade.h"
-#include "unit.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct elemental_interface elemental_s;
int elemental_search_index(int class_) {
diff --git a/src/map/elemental.h b/src/map/elemental.h
index 8015f84c0..67b1e3f3a 100644
--- a/src/map/elemental.h
+++ b/src/map/elemental.h
@@ -5,9 +5,9 @@
#ifndef MAP_ELEMENTAL_H
#define MAP_ELEMENTAL_H
-#include "status.h" // struct status_data, struct status_change
-#include "unit.h" // struct unit_data
-#include "../common/mmo.h" // NAME_LENGTH
+#include "map/status.h" // struct status_data, struct status_change
+#include "map/unit.h" // struct unit_data
+#include "common/mmo.h" // NAME_LENGTH
/**
* Defines
diff --git a/src/map/guild.c b/src/map/guild.c
index b9c0c8267..5f6ce83c6 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -4,37 +4,37 @@
#define HERCULES_CORE
-#include "../config/core.h" // GP_BOUND_ITEMS
+#include "config/core.h" // GP_BOUND_ITEMS
#include "guild.h"
+#include "map/battle.h"
+#include "map/channel.h"
+#include "map/clif.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/pc.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/mapindex.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "battle.h"
-#include "channel.h"
-#include "clif.h"
-#include "instance.h"
-#include "intif.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "npc.h"
-#include "pc.h"
-#include "skill.h"
-#include "status.h"
-#include "storage.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/mapindex.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct guild_interface guild_s;
/*==========================================
diff --git a/src/map/guild.h b/src/map/guild.h
index a75b8a7a5..18a25af58 100644
--- a/src/map/guild.h
+++ b/src/map/guild.h
@@ -5,10 +5,10 @@
#ifndef MAP_GUILD_H
#define MAP_GUILD_H
-#include "map.h" // EVENT_NAME_LENGTH, TBL_PC
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/mmo.h"
+#include "map/map.h" // EVENT_NAME_LENGTH, TBL_PC
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/mmo.h"
/**
* Defines
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index ee88bf3dc..dd158fc5d 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -4,44 +4,44 @@
#define HERCULES_CORE
-#include "../config/core.h" // DBPATH
+#include "config/core.h" // DBPATH
#include "homunculus.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/guild.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/trade.h"
+#include "map/unit.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "guild.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "pet.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "trade.h"
-#include "unit.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct homunculus_interface homunculus_s;
//Returns the viewdata for homunculus
diff --git a/src/map/homunculus.h b/src/map/homunculus.h
index 18f8728d3..387efbf29 100644
--- a/src/map/homunculus.h
+++ b/src/map/homunculus.h
@@ -5,10 +5,10 @@
#ifndef MAP_HOMUNCULUS_H
#define MAP_HOMUNCULUS_H
-#include "pc.h"
-#include "status.h" // struct status_data, struct status_change
-#include "unit.h" // struct unit_data
-#include "../common/mmo.h"
+#include "map/pc.h"
+#include "map/status.h" // struct status_data, struct status_change
+#include "map/unit.h" // struct unit_data
+#include "common/mmo.h"
#define MAX_HOM_SKILL_REQUIRE 5
#define homdb_checkid(id) ((id) >= HM_CLASS_BASE && (id) <= HM_CLASS_MAX)
diff --git a/src/map/instance.c b/src/map/instance.c
index dd5709452..255722f58 100644
--- a/src/map/instance.c
+++ b/src/map/instance.c
@@ -4,32 +4,32 @@
#define HERCULES_CORE
+#include "config/core.h" // CELL_NOSTACK
#include "instance.h"
+#include "map/channel.h"
+#include "map/clif.h"
+#include "map/map.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "../config/core.h" // CELL_NOSTACK
-#include "channel.h"
-#include "clif.h"
-#include "map.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct instance_interface instance_s;
/// Checks whether given instance id is valid or not.
diff --git a/src/map/instance.h b/src/map/instance.h
index 80bd1f012..88e586ab1 100644
--- a/src/map/instance.h
+++ b/src/map/instance.h
@@ -5,9 +5,9 @@
#ifndef MAP_INSTANCE_H
#define MAP_INSTANCE_H
-#include "script.h" // struct reg_db
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h" // struct point
+#include "map/script.h" // struct reg_db
+#include "common/cbasetypes.h"
+#include "common/mmo.h" // struct point
struct block_list;
struct map_session_data;
diff --git a/src/map/intif.c b/src/map/intif.c
index 7a860049a..6c40d5109 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -3,9 +3,32 @@
#define HERCULES_CORE
-#include "../config/core.h" // GP_BOUND_ITEMS
+#include "config/core.h" // GP_BOUND_ITEMS
#include "intif.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/storage.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
@@ -13,29 +36,6 @@
#include <string.h>
#include <sys/types.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "log.h"
-#include "mail.h"
-#include "map.h"
-#include "mercenary.h"
-#include "party.h"
-#include "pc.h"
-#include "pet.h"
-#include "quest.h"
-#include "storage.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
struct intif_interface intif_s;
#define inter_fd (chrif->fd) // alias
diff --git a/src/map/intif.h b/src/map/intif.h
index 52aa32259..3303feb6e 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -5,7 +5,7 @@
#ifndef MAP_INTIF_H
#define MAP_INTIF_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
/**
* Declarations
diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c
index f7e693191..b0f687c0d 100644
--- a/src/map/irc-bot.c
+++ b/src/map/irc-bot.c
@@ -6,21 +6,21 @@
#include "irc-bot.h"
+#include "map/channel.h"
+#include "map/map.h"
+#include "map/pc.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "channel.h"
-#include "map.h"
-#include "pc.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
//#define IRCBOT_DEBUG
struct irc_bot_interface irc_bot_s;
diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h
index acd014e71..b0bfd72f8 100644
--- a/src/map/irc-bot.h
+++ b/src/map/irc-bot.h
@@ -6,7 +6,7 @@
#ifndef MAP_IRC_BOT_H
#define MAP_IRC_BOT_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
#define IRC_NICK_LENGTH 40
#define IRC_IDENT_LENGTH 40
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index fb6bcc730..b02da1e0d 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -4,27 +4,27 @@
#define HERCULES_CORE
-#include "../config/core.h" // DBPATH, RENEWAL
+#include "config/core.h" // DBPATH, RENEWAL
#include "itemdb.h"
+#include "map/battle.h" // struct battle_config
+#include "map/map.h"
+#include "map/mob.h" // MAX_MOB_DB
+#include "map/pc.h" // W_MUSICAL, W_WHIP
+#include "map/script.h" // item script processing
+#include "common/HPM.h"
+#include "common/conf.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "battle.h" // struct battle_config
-#include "map.h"
-#include "mob.h" // MAX_MOB_DB
-#include "pc.h" // W_MUSICAL, W_WHIP
-#include "script.h" // item script processing
-#include "../common/HPM.h"
-#include "../common/conf.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
struct itemdb_interface itemdb_s;
/**
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 1d811e3cb..8d220d58f 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -5,12 +5,12 @@
#ifndef MAP_ITEMDB_H
#define MAP_ITEMDB_H
-#include "map.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/db.h"
-#include "../common/mmo.h" // ITEM_NAME_LENGTH
-#include "../common/sql.h"
+#include "map/map.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
+#include "common/mmo.h" // ITEM_NAME_LENGTH
+#include "common/sql.h"
/**
* Declarations
diff --git a/src/map/log.c b/src/map/log.c
index f18efbfb7..0a9b16418 100644
--- a/src/map/log.c
+++ b/src/map/log.c
@@ -6,22 +6,22 @@
#include "log.h"
+#include "map/battle.h"
+#include "map/itemdb.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/pc.h"
+#include "common/cbasetypes.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/sql.h" // SQL_INNODB
+#include "common/strlib.h"
+#include "common/HPM.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "battle.h"
-#include "itemdb.h"
-#include "map.h"
-#include "mob.h"
-#include "pc.h"
-#include "../common/cbasetypes.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/sql.h" // SQL_INNODB
-#include "../common/strlib.h"
-#include "../common/HPM.h"
-
struct log_interface log_s;
/// obtain log type character for item/zeny logs
diff --git a/src/map/log.h b/src/map/log.h
index b4b8b84f4..ef654149c 100644
--- a/src/map/log.h
+++ b/src/map/log.h
@@ -5,8 +5,8 @@
#ifndef MAP_LOG_H
#define MAP_LOG_H
-#include "../common/cbasetypes.h"
-#include "../common/sql.h"
+#include "common/cbasetypes.h"
+#include "common/sql.h"
/**
* Declarations
diff --git a/src/map/mail.c b/src/map/mail.c
index d7ce9c830..184e2be8d 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -6,18 +6,18 @@
#include "mail.h"
+#include "map/atcommand.h"
+#include "map/clif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/pc.h"
+#include "map/storage.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+
#include <time.h>
#include <string.h>
-#include "atcommand.h"
-#include "clif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "pc.h"
-#include "storage.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-
struct mail_interface mail_s;
void mail_clear(struct map_session_data *sd)
diff --git a/src/map/mail.h b/src/map/mail.h
index db49ca39e..4f325067d 100644
--- a/src/map/mail.h
+++ b/src/map/mail.h
@@ -5,7 +5,7 @@
#ifndef MAP_MAIL_H
#define MAP_MAIL_H
-#include "../common/cbasetypes.h"
+#include "common/cbasetypes.h"
struct item;
struct mail_message;
diff --git a/src/map/map.c b/src/map/map.c
index f8c9e7c01..dc935079a 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -4,65 +4,64 @@
#define HERCULES_CORE
-#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL
+#include "config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL
#include "map.h"
+#include "map/HPMmap.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/battleground.h"
+#include "map/channel.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/duel.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/irc-bot.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/mapreg.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/npc.h" // npc_setcells(), npc_unsetcells()
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "map/trade.h"
+#include "map/unit.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/console.h"
+#include "common/core.h"
+#include "common/ers.h"
+#include "common/grfio.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h" // WFIFO*()
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#include "HPMmap.h"
-#include "atcommand.h"
-#include "battle.h"
-#include "battleground.h"
-#include "channel.h"
-#include "chat.h"
-#include "chrif.h"
-#include "clif.h"
-#include "duel.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "intif.h"
-#include "irc-bot.h"
-#include "itemdb.h"
-#include "log.h"
-#include "mail.h"
-#include "mapreg.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "npc.h" // npc_setcells(), npc_unsetcells()
-#include "party.h"
-#include "path.h"
-#include "pc.h"
-#include "pet.h"
-#include "quest.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "storage.h"
-#include "trade.h"
-#include "unit.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/console.h"
-#include "../common/core.h"
-#include "../common/ers.h"
-#include "../common/grfio.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h" // WFIFO*()
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
#ifndef _WIN32
#include <unistd.h>
#endif
diff --git a/src/map/map.h b/src/map/map.h
index ab2274d78..81a9a0940 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -5,17 +5,17 @@
#ifndef MAP_MAP_H
#define MAP_MAP_H
-#include "../config/core.h"
+#include "config/core.h"
-#include <stdarg.h>
+#include "map/atcommand.h"
+#include "common/cbasetypes.h"
+#include "common/core.h" // CORE_ST_LAST
+#include "common/db.h"
+#include "common/mapindex.h"
+#include "common/mmo.h"
+#include "common/sql.h"
-#include "atcommand.h"
-#include "../common/cbasetypes.h"
-#include "../common/core.h" // CORE_ST_LAST
-#include "../common/db.h"
-#include "../common/mapindex.h"
-#include "../common/mmo.h"
-#include "../common/sql.h"
+#include <stdarg.h>
struct mob_data;
struct npc_data;
diff --git a/src/map/mapreg.h b/src/map/mapreg.h
index 9c9a1acee..d38edaff5 100644
--- a/src/map/mapreg.h
+++ b/src/map/mapreg.h
@@ -5,9 +5,9 @@
#ifndef MAP_MAPREG_H
#define MAP_MAPREG_H
-#include "script.h" // struct reg_db
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include "map/script.h" // struct reg_db
+#include "common/cbasetypes.h"
+#include "common/db.h"
/** Container for a mapreg value */
struct mapreg_save {
diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c
index 0092a6c61..bed40e295 100644
--- a/src/map/mapreg_sql.c
+++ b/src/map/mapreg_sql.c
@@ -6,20 +6,20 @@
#include "mapreg.h"
+#include "map/map.h" // map-"mysql_handle
+#include "map/script.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/showmsg.h"
+#include "common/sql.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
#include <stdlib.h>
#include <string.h>
-#include "map.h" // map->mysql_handle
-#include "script.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/showmsg.h"
-#include "../common/sql.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
struct mapreg_interface mapreg_s;
#define MAPREG_AUTOSAVE_INTERVAL (300*1000)
diff --git a/src/map/mercenary.c b/src/map/mercenary.c
index 84f6a3c41..ffcb26629 100644
--- a/src/map/mercenary.c
+++ b/src/map/mercenary.c
@@ -6,41 +6,41 @@
#include "mercenary.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/guild.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/trade.h"
+#include "map/unit.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "guild.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "pet.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "trade.h"
-#include "unit.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct mercenary_interface mercenary_s;
int merc_search_index(int class_)
diff --git a/src/map/mercenary.h b/src/map/mercenary.h
index fbf3603f6..873d77659 100644
--- a/src/map/mercenary.h
+++ b/src/map/mercenary.h
@@ -4,9 +4,9 @@
#ifndef MAP_MERCENARY_H
#define MAP_MERCENARY_H
-#include "status.h" // struct status_data, struct status_change
-#include "unit.h" // struct unit_data
-#include "../common/cbasetypes.h"
+#include "map/status.h" // struct status_data, struct status_change
+#include "map/unit.h" // struct unit_data
+#include "common/cbasetypes.h"
// number of cells that a mercenary can walk to from it's master before being warped
#define MAX_MER_DISTANCE 15
diff --git a/src/map/mob.c b/src/map/mob.c
index d3aec6e46..493e30049 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -4,49 +4,49 @@
#define HERCULES_CORE
-#include "../config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP
+#include "config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP
#include "mob.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/clif.h"
+#include "map/date.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "clif.h"
-#include "date.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mercenary.h"
-#include "npc.h"
-#include "party.h"
-#include "path.h"
-#include "pc.h"
-#include "pet.h"
-#include "quest.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct mob_interface mob_s;
#define ACTIVE_AI_RANGE 2 //Distance added on top of 'AREA_SIZE' at which mobs enter active AI mode.
diff --git a/src/map/mob.h b/src/map/mob.h
index 0a5844f39..d3fdb7185 100644
--- a/src/map/mob.h
+++ b/src/map/mob.h
@@ -5,11 +5,11 @@
#ifndef MAP_MOB_H
#define MAP_MOB_H
-#include "map.h" // struct status_data, struct view_data, struct mob_skill
-#include "status.h" // struct status_data, struct status_change
-#include "unit.h" // struct unit_data
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h" // struct item
+#include "map/map.h" // struct status_data, struct view_data, struct mob_skill
+#include "map/status.h" // struct status_data, struct status_change
+#include "map/unit.h" // struct unit_data
+#include "common/cbasetypes.h"
+#include "common/mmo.h" // struct item
#define MAX_RANDOMMONSTER 5
diff --git a/src/map/npc.c b/src/map/npc.c
index ef56c7872..7bc5be383 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -4,9 +4,36 @@
#define HERCULES_CORE
-#include "../config/core.h" // NPC_SECURE_TIMEOUT_INPUT, NPC_SECURE_TIMEOUT_MENU, NPC_SECURE_TIMEOUT_NEXT, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL
+#include "config/core.h" // NPC_SECURE_TIMEOUT_INPUT, NPC_SECURE_TIMEOUT_MENU, NPC_SECURE_TIMEOUT_NEXT, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL
#include "npc.h"
+#include "map/battle.h"
+#include "map/chat.h"
+#include "map/clif.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/unit.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <errno.h>
#include <math.h>
#include <stdio.h>
@@ -14,33 +41,6 @@
#include <string.h>
#include <time.h>
-#include "battle.h"
-#include "chat.h"
-#include "clif.h"
-#include "instance.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "pc.h"
-#include "pet.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "unit.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct npc_interface npc_s;
static int npc_id=START_NPC_NUM;
diff --git a/src/map/npc.h b/src/map/npc.h
index e57abc519..bc779b56b 100644
--- a/src/map/npc.h
+++ b/src/map/npc.h
@@ -5,11 +5,11 @@
#ifndef MAP_NPC_H
#define MAP_NPC_H
-#include "map.h" // struct block_list
-#include "status.h" // struct status_change
-#include "unit.h" // struct unit_data
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include "map/map.h" // struct block_list
+#include "map/status.h" // struct status_change
+#include "map/unit.h" // struct unit_data
+#include "common/cbasetypes.h"
+#include "common/db.h"
struct HPluginData;
struct view_data;
@@ -288,7 +288,7 @@ void npc_defaults(void);
/* comes from npc_chat.c */
#ifdef PCRE_SUPPORT
-#include "../../3rdparty/pcre/include/pcre.h"
+#include <pcre/include/pcre.h>
/* Structure containing all info associated with a single pattern block */
struct pcrematch_entry {
struct pcrematch_entry* next;
diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c
index 8bc246819..3fe379f36 100644
--- a/src/map/npc_chat.c
+++ b/src/map/npc_chat.c
@@ -8,22 +8,22 @@
#include "npc.h" // struct npc_data
+#include "map/mob.h" // struct mob_data
+#include "map/pc.h" // struct map_session_data
+#include "map/script.h" // set_var()
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+
+#include <pcre/include/pcre.h>
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../../3rdparty/pcre/include/pcre.h"
-
-#include "mob.h" // struct mob_data
-#include "pc.h" // struct map_session_data
-#include "script.h" // set_var()
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-
/**
* interface sources
**/
diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h
index 47e566662..875eed075 100644
--- a/src/map/packets_struct.h
+++ b/src/map/packets_struct.h
@@ -6,8 +6,8 @@
#ifndef MAP_PACKETS_STRUCT_H
#define MAP_PACKETS_STRUCT_H
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h"
+#include "common/cbasetypes.h"
+#include "common/mmo.h"
/**
*
diff --git a/src/map/party.c b/src/map/party.c
index ccb522809..6b35debe5 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -4,36 +4,36 @@
#define HERCULES_CORE
-#include "../config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP
+#include "config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP
#include "party.h"
+#include "map/atcommand.h" //msg_txt()
+#include "map/battle.h"
+#include "map/clif.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h" // struct mob_data
+#include "map/pc.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h" // last_tick
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h" //msg_txt()
-#include "battle.h"
-#include "clif.h"
-#include "instance.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h" // struct mob_data
-#include "pc.h"
-#include "skill.h"
-#include "status.h"
-#include "../common/HPM.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h" // last_tick
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct party_interface party_s;
/*==========================================
diff --git a/src/map/party.h b/src/map/party.h
index a541d03cb..95faa2213 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -5,12 +5,12 @@
#ifndef MAP_PARTY_H
#define MAP_PARTY_H
-#include <stdarg.h>
+#include "map/map.h" // TBL_PC
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/mmo.h" // struct party
-#include "map.h" // TBL_PC
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/mmo.h" // struct party
+#include <stdarg.h>
#define PARTY_BOOKING_JOBS 6
#define PARTY_BOOKING_RESULTS 10
diff --git a/src/map/path.c b/src/map/path.c
index 600dfc082..3ded5423e 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -4,21 +4,21 @@
#define HERCULES_CORE
-#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA
+#include "config/core.h" // CELL_NOSTACK, CIRCULAR_AREA
#include "path.h"
+#include "map/map.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+
+#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <math.h>
-
-#include "map.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
#define SET_OPEN 0
#define SET_CLOSED 1
diff --git a/src/map/path.h b/src/map/path.h
index eb42df6d0..bbd81b8c6 100644
--- a/src/map/path.h
+++ b/src/map/path.h
@@ -5,8 +5,8 @@
#ifndef MAP_PATH_H
#define MAP_PATH_H
-#include "map.h" // enum cell_chk
-#include "../common/cbasetypes.h"
+#include "map/map.h" // enum cell_chk
+#include "common/cbasetypes.h"
#define MOVE_COST 10
#define MOVE_DIAGONAL_COST 14
diff --git a/src/map/pc.c b/src/map/pc.c
index ce4f31f25..9e9f993d0 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4,58 +4,58 @@
#define HERCULES_CORE
-#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_SPIRITBALL, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT
+#include "config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_SPIRITBALL, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT
#include "pc.h"
+#include "map/atcommand.h" // get_atcommand_level()
+#include "map/battle.h" // battle_config
+#include "map/battleground.h"
+#include "map/channel.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/date.h" // is_day_of_*()
+#include "map/duel.h"
+#include "map/elemental.h"
+#include "map/guild.h" // guild-"search(), guild_request_info()
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/mob.h" // struct mob_data
+#include "map/npc.h" // fake_nd
+#include "map/party.h" // party-"search()
+#include "map/path.h"
+#include "map/pc_groups.h"
+#include "map/pet.h" // pet_unlocktarget()
+#include "map/quest.h"
+#include "map/script.h" // script_config
+#include "map/skill.h"
+#include "map/status.h" // struct status_data
+#include "map/storage.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/core.h" // get_svn_revision()
+#include "common/malloc.h"
+#include "common/mmo.h" // NAME_LENGTH, MAX_CARTS, NEW_CARTS
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h" // session[]
+#include "common/strlib.h" // safestrncpy()
+#include "common/sysinfo.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "atcommand.h" // get_atcommand_level()
-#include "battle.h" // battle_config
-#include "battleground.h"
-#include "channel.h"
-#include "chat.h"
-#include "chrif.h"
-#include "clif.h"
-#include "date.h" // is_day_of_*()
-#include "duel.h"
-#include "elemental.h"
-#include "guild.h" // guild->search(), guild_request_info()
-#include "homunculus.h"
-#include "instance.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "mail.h"
-#include "map.h"
-#include "mercenary.h"
-#include "mob.h" // struct mob_data
-#include "npc.h" // fake_nd
-#include "party.h" // party->search()
-#include "path.h"
-#include "pc_groups.h"
-#include "pet.h" // pet_unlocktarget()
-#include "quest.h"
-#include "script.h" // script_config
-#include "skill.h"
-#include "status.h" // struct status_data
-#include "storage.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/core.h" // get_svn_revision()
-#include "../common/malloc.h"
-#include "../common/mmo.h" // NAME_LENGTH, MAX_CARTS, NEW_CARTS
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h" // session[]
-#include "../common/strlib.h" // safestrncpy()
-#include "../common/sysinfo.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct pc_interface pc_s;
//Converts a class to its array index for CLASS_COUNT defined arrays.
diff --git a/src/map/pc.h b/src/map/pc.h
index 8a110a6d1..4dea27693 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -5,23 +5,23 @@
#ifndef MAP_PC_H
#define MAP_PC_H
-#include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT
-
-#include "battle.h" // battle
-#include "battleground.h" // enum bg_queue_types
-#include "buyingstore.h" // struct s_buyingstore
-#include "itemdb.h" // MAX_ITEMDELAYS
-#include "log.h" // struct e_log_pick_type
-#include "map.h" // RC_MAX, ELE_MAX
-#include "pc_groups.h" // GroupSettings
-#include "script.h" // struct reg_db
-#include "searchstore.h" // struct s_search_store_info
-#include "status.h" // enum sc_type, OPTION_*
-#include "unit.h" // struct unit_data, struct view_data
-#include "vending.h" // struct s_vending
-#include "../common/cbasetypes.h"
-#include "../common/ers.h" // struct eri
-#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus, NEW_CARTS
+#include "config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT
+
+#include "map/battle.h" // battle
+#include "map/battleground.h" // enum bg_queue_types
+#include "map/buyingstore.h" // struct s_buyingstore
+#include "map/itemdb.h" // MAX_ITEMDELAYS
+#include "map/log.h" // struct e_log_pick_type
+#include "map/map.h" // RC_MAX, ELE_MAX
+#include "map/pc_groups.h" // GroupSettings
+#include "map/script.h" // struct reg_db
+#include "map/searchstore.h" // struct s_search_store_info
+#include "map/status.h" // enum sc_type, OPTION_*
+#include "map/unit.h" // struct unit_data, struct view_data
+#include "map/vending.h" // struct s_vending
+#include "common/cbasetypes.h"
+#include "common/ers.h" // struct eri
+#include "common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus, NEW_CARTS
/**
* Defines
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index 9cd478b3f..f9a442d97 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -6,17 +6,17 @@
#include "pc_groups.h"
-#include "atcommand.h" // atcommand->exists(), atcommand->load_groups()
-#include "clif.h" // clif->GM_kick()
-#include "map.h" // mapiterator
-#include "pc.h" // pc->set_group()
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h" // strcmp
+#include "map/atcommand.h" // atcommand-"exists(), atcommand-"load_groups()
+#include "map/clif.h" // clif-"GM_kick()
+#include "map/map.h" // mapiterator
+#include "map/pc.h" // pc-"set_group()
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h" // strcmp
static GroupSettings dummy_group; ///< dummy group used in dummy map sessions @see pc_get_dummy_sd()
diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h
index 8dd95a177..4fee312a4 100644
--- a/src/map/pc_groups.h
+++ b/src/map/pc_groups.h
@@ -5,9 +5,9 @@
#ifndef MAP_PC_GROUPS_H
#define MAP_PC_GROUPS_H
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/db.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/db.h"
/// PC permissions
enum e_pc_permission {
diff --git a/src/map/pet.c b/src/map/pet.c
index 8160f88b0..2379ec984 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -6,36 +6,36 @@
#include "pet.h"
+#include "map/atcommand.h" // msg_txt()
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/unit.h"
+#include "common/db.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h" // msg_txt()
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "npc.h"
-#include "path.h"
-#include "pc.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "unit.h"
-#include "../common/db.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct pet_interface pet_s;
#define MIN_PETTHINKTIME 100
diff --git a/src/map/pet.h b/src/map/pet.h
index 0b51bcb16..06302c9b2 100644
--- a/src/map/pet.h
+++ b/src/map/pet.h
@@ -5,11 +5,11 @@
#ifndef MAP_PET_H
#define MAP_PET_H
-#include "map.h" // struct block_list
-#include "status.h" // enum sc_type
-#include "unit.h" // struct unit_data
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h" // NAME_LENGTH, struct s_pet
+#include "map/map.h" // struct block_list
+#include "map/status.h" // enum sc_type
+#include "map/unit.h" // struct unit_data
+#include "common/cbasetypes.h"
+#include "common/mmo.h" // NAME_LENGTH, struct s_pet
#define MAX_PET_DB 300
#define MAX_PETLOOT_SIZE 30
diff --git a/src/map/quest.c b/src/map/quest.c
index 93ec1b04c..da5f73caa 100644
--- a/src/map/quest.c
+++ b/src/map/quest.c
@@ -6,36 +6,36 @@
#include "quest.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/pc.h"
+#include "map/script.h"
+#include "map/unit.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "pc.h"
-#include "script.h"
-#include "unit.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct quest_interface quest_s;
/**
diff --git a/src/map/quest.h b/src/map/quest.h
index 36ac69a53..014f82527 100644
--- a/src/map/quest.h
+++ b/src/map/quest.h
@@ -5,9 +5,9 @@
#ifndef MAP_QUEST_H
#define MAP_QUEST_H
-#include "map.h" // TBL_PC
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
+#include "map/map.h" // TBL_PC
+#include "common/cbasetypes.h"
+#include "common/conf.h"
#define MAX_QUEST_DB (60355+1) // Highest quest ID + 1
diff --git a/src/map/script.c b/src/map/script.c
index 724b3b135..87762f44e 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -4,60 +4,59 @@
#define HERCULES_CORE
-#include "../config/core.h" // RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL
+#include "config/core.h" // RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EDP, RENEWAL_EXP, RENEWAL_LVDMG, SCRIPT_CALLFUNC_CHECK, SECURE_NPCTIMEOUT, SECURE_NPCTIMEOUT_INTERVAL
#include "script.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/battleground.h"
+#include "map/channel.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/map.h"
+#include "map/mapreg.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "map/unit.h"
+#include "common/cbasetypes.h"
+#include "common/malloc.h"
+#include "common/md5calc.h"
+#include "common/mmo.h" // NEW_CARTS
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h" // usage: getcharip
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/timer.h"
+#include "common/utils.h"
+#include "common/HPM.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-
-#include "atcommand.h"
-#include "battle.h"
-#include "battleground.h"
-#include "channel.h"
-#include "chat.h"
-#include "chrif.h"
-#include "clif.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "mail.h"
-#include "map.h"
-#include "mapreg.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "path.h"
-#include "pc.h"
-#include "pet.h"
-#include "pet.h"
-#include "quest.h"
-#include "skill.h"
-#include "status.h"
-#include "status.h"
-#include "storage.h"
-#include "unit.h"
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h"
-#include "../common/md5calc.h"
-#include "../common/mmo.h" // NEW_CARTS
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h" // usage: getcharip
-#include "../common/strlib.h"
-#include "../common/sysinfo.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-#include "../common/HPM.h"
-
#ifndef WIN32
#include <sys/time.h>
#endif
diff --git a/src/map/script.h b/src/map/script.h
index 25c4283ca..93d60f416 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -5,16 +5,16 @@
#ifndef MAP_SCRIPT_H
#define MAP_SCRIPT_H
+#include "map/map.h" //EVENT_NAME_LENGTH
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/mmo.h" // struct item
+#include "common/sql.h" // Sql
+#include "common/strlib.h" //StringBuf
+
#include <errno.h>
#include <setjmp.h>
-#include "map.h" //EVENT_NAME_LENGTH
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/mmo.h" // struct item
-#include "../common/sql.h" // Sql
-#include "../common/strlib.h" //StringBuf
-
/**
* Declarations
**/
diff --git a/src/map/searchstore.c b/src/map/searchstore.c
index 782c14987..b9e23ae82 100644
--- a/src/map/searchstore.c
+++ b/src/map/searchstore.c
@@ -4,15 +4,15 @@
#define HERCULES_CORE
-#include "searchstore.h" // struct s_search_store_info
-
-#include "battle.h" // battle_config.*
-#include "clif.h" // clif->open_search_store_info, clif->search_store_info_*
-#include "pc.h" // struct map_session_data
-#include "../common/cbasetypes.h"
-#include "../common/malloc.h" // aMalloc, aRealloc, aFree
-#include "../common/showmsg.h" // ShowError, ShowWarning
-#include "../common/strlib.h" // safestrncpy
+#include "searchstore.h" // struct s_search_store_info
+
+#include "map/battle.h" // battle_config.*
+#include "map/clif.h" // clif-"open_search_store_info, clif-"search_store_info_*
+#include "map/pc.h" // struct map_session_data
+#include "common/cbasetypes.h"
+#include "common/malloc.h" // aMalloc, aRealloc, aFree
+#include "common/showmsg.h" // ShowError, ShowWarning
+#include "common/strlib.h" // safestrncpy
struct searchstore_interface searchstore_s;
diff --git a/src/map/searchstore.h b/src/map/searchstore.h
index 6664eddfa..2778740a5 100644
--- a/src/map/searchstore.h
+++ b/src/map/searchstore.h
@@ -5,11 +5,11 @@
#ifndef MAP_SEARCHSTORE_H
#define MAP_SEARCHSTORE_H
-#include <time.h>
+#include "map/map.h" // MESSAGE_SIZE
+#include "common/cbasetypes.h"
+#include "common/mmo.h" // MAX_SLOTS
-#include "map.h" // MESSAGE_SIZE
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h" // MAX_SLOTS
+#include <time.h>
/**
* Defines
diff --git a/src/map/skill.c b/src/map/skill.c
index b39ea380f..c6233c31d 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -4,47 +4,47 @@
#define HERCULES_CORE
-#include "../config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION()
+#include "config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION()
#include "skill.h"
+#include "map/battle.h"
+#include "map/battleground.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/date.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/script.h"
+#include "map/status.h"
+#include "map/unit.h"
+#include "common/cbasetypes.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
-#include "battle.h"
-#include "battleground.h"
-#include "chrif.h"
-#include "clif.h"
-#include "date.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "path.h"
-#include "pc.h"
-#include "pet.h"
-#include "script.h"
-#include "status.h"
-#include "unit.h"
-#include "../common/cbasetypes.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
#define SKILLUNITTIMER_INTERVAL 100
// ranges reserved for mapping skill ids to skilldb offsets
diff --git a/src/map/skill.h b/src/map/skill.h
index bbf5b5458..6e56e276b 100644
--- a/src/map/skill.h
+++ b/src/map/skill.h
@@ -5,13 +5,13 @@
#ifndef MAP_SKILL_H
#define MAP_SKILL_H
-#include "../config/core.h" // RENEWAL_CAST
+#include "config/core.h" // RENEWAL_CAST
-#include "map.h" // struct block_list
-#include "status.h" // enum sc_type
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/mmo.h" // MAX_SKILL, struct square
+#include "map/map.h" // struct block_list
+#include "map/status.h" // enum sc_type
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/mmo.h" // MAX_SKILL, struct square
/**
* Declarations
diff --git a/src/map/status.c b/src/map/status.c
index ffc534de9..62d4f27fe 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -4,9 +4,38 @@
#define HERCULES_CORE
-#include "../config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP
+#include "config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP
#include "status.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/itemdb.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/skill.h"
+#include "map/unit.h"
+#include "map/vending.h"
+#include "common/cbasetypes.h"
+#include "common/ers.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <math.h>
#include <memory.h>
#include <stdio.h>
@@ -14,35 +43,6 @@
#include <string.h>
#include <time.h>
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "itemdb.h"
-#include "map.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "path.h"
-#include "pc.h"
-#include "pet.h"
-#include "script.h"
-#include "skill.h"
-#include "skill.h"
-#include "unit.h"
-#include "vending.h"
-#include "../common/cbasetypes.h"
-#include "../common/ers.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../common/utils.h"
-
struct status_interface status_s;
/**
diff --git a/src/map/status.h b/src/map/status.h
index af11683a0..4bda57fa9 100644
--- a/src/map/status.h
+++ b/src/map/status.h
@@ -5,10 +5,11 @@
#ifndef MAP_STATUS_H
#define MAP_STATUS_H
-#include "../config/core.h" // defType, RENEWAL, RENEWAL_ASPD
-#include "../common/conf.h"
-#include "../common/cbasetypes.h"
-#include "../common/mmo.h" // NEW_CARTS
+#include "config/core.h" // defType, RENEWAL, RENEWAL_ASPD
+
+#include "common/conf.h"
+#include "common/cbasetypes.h"
+#include "common/mmo.h" // NEW_CARTS
struct block_list;
struct elemental_data;
diff --git a/src/map/storage.c b/src/map/storage.c
index 2706b3683..0a22b9ec6 100644
--- a/src/map/storage.c
+++ b/src/map/storage.c
@@ -6,25 +6,25 @@
#include "storage.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/guild.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h" // struct map_session_data
+#include "map/pc.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "guild.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h" // struct map_session_data
-#include "pc.h"
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-
struct storage_interface storage_s;
struct guild_storage_interface gstorage_s;
diff --git a/src/map/storage.h b/src/map/storage.h
index 6a9e7a2ac..5f2c69f56 100644
--- a/src/map/storage.h
+++ b/src/map/storage.h
@@ -5,8 +5,8 @@
#ifndef MAP_STORAGE_H
#define MAP_STORAGE_H
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
struct guild_storage;
struct item;
diff --git a/src/map/trade.c b/src/map/trade.c
index a17938779..4dd6ffafa 100644
--- a/src/map/trade.c
+++ b/src/map/trade.c
@@ -6,24 +6,24 @@
#include "trade.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/intif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/npc.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/storage.h"
+#include "common/nullpo.h"
+#include "common/socket.h"
+
#include <stdio.h>
#include <string.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "intif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "npc.h"
-#include "path.h"
-#include "pc.h"
-#include "storage.h"
-#include "../common/nullpo.h"
-#include "../common/socket.h"
-
struct trade_interface trade_s;
/*==========================================
diff --git a/src/map/unit.c b/src/map/unit.c
index 5ead7527e..60911b85a 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -4,47 +4,47 @@
#define HERCULES_CORE
-#include "../config/core.h" // RENEWAL_CAST
+#include "config/core.h" // RENEWAL_CAST
#include "unit.h"
+#include "map/battle.h"
+#include "map/battleground.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/duel.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/map.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "map/trade.h"
+#include "map/vending.h"
+#include "common/HPM.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/nullpo.h"
+#include "common/random.h"
+#include "common/showmsg.h"
+#include "common/socket.h"
+#include "common/timer.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "battle.h"
-#include "battleground.h"
-#include "chat.h"
-#include "chrif.h"
-#include "clif.h"
-#include "duel.h"
-#include "elemental.h"
-#include "guild.h"
-#include "homunculus.h"
-#include "instance.h"
-#include "intif.h"
-#include "map.h"
-#include "mercenary.h"
-#include "mob.h"
-#include "npc.h"
-#include "party.h"
-#include "path.h"
-#include "pc.h"
-#include "pet.h"
-#include "script.h"
-#include "skill.h"
-#include "status.h"
-#include "storage.h"
-#include "trade.h"
-#include "vending.h"
-#include "../common/HPM.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/nullpo.h"
-#include "../common/random.h"
-#include "../common/showmsg.h"
-#include "../common/socket.h"
-#include "../common/timer.h"
-
const short dirx[8]={0,-1,-1,-1,0,1,1,1};
const short diry[8]={1,1,0,-1,-1,-1,0,1};
diff --git a/src/map/unit.h b/src/map/unit.h
index d434d52e4..00fff5981 100644
--- a/src/map/unit.h
+++ b/src/map/unit.h
@@ -5,10 +5,10 @@
#ifndef MAP_UNIT_H
#define MAP_UNIT_H
-#include "clif.h" // clr_type
-#include "path.h" // struct walkpath_data
-#include "skill.h" // 'MAX_SKILLTIMERSKILL, struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset
-#include "../common/cbasetypes.h"
+#include "map/clif.h" // clr_type
+#include "map/path.h" // struct walkpath_data
+#include "map/skill.h" // 'MAX_SKILLTIMERSKILL, struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset
+#include "common/cbasetypes.h"
struct map_session_data;
struct block_list;
diff --git a/src/map/vending.c b/src/map/vending.c
index b32c3e43e..d0f0dee00 100644
--- a/src/map/vending.c
+++ b/src/map/vending.c
@@ -6,24 +6,24 @@
#include "vending.h"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/map.h"
+#include "map/npc.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/skill.h"
+#include "common/nullpo.h"
+#include "common/strlib.h"
+#include "common/utils.h"
+
#include <stdio.h>
#include <string.h>
-#include "atcommand.h"
-#include "battle.h"
-#include "chrif.h"
-#include "clif.h"
-#include "itemdb.h"
-#include "log.h"
-#include "map.h"
-#include "npc.h"
-#include "path.h"
-#include "pc.h"
-#include "skill.h"
-#include "../common/nullpo.h"
-#include "../common/strlib.h"
-#include "../common/utils.h"
-
struct vending_interface vending_s;
/// Returns an unique vending shop id.
diff --git a/src/map/vending.h b/src/map/vending.h
index 00d3eefff..189189227 100644
--- a/src/map/vending.h
+++ b/src/map/vending.h
@@ -5,8 +5,8 @@
#ifndef MAP_VENDING_H
#define MAP_VENDING_H
-#include "../common/cbasetypes.h"
-#include "../common/db.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
struct map_session_data;
struct s_search_store_search;
diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c
index c6fb6462d..4c15b06af 100644
--- a/src/plugins/HPMHooking.c
+++ b/src/plugins/HPMHooking.c
@@ -2,99 +2,99 @@
// See the LICENSE file
// Sample Hercules Plugin
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "../common/HPMi.h"
-#include "../common/db.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/socket.h"
+#include "common/HPMi.h"
+#include "common/db.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/socket.h"
#if defined (HPMHOOKING_LOGIN)
#define HPM_SERVER_TYPE SERVER_TYPE_LOGIN
-#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking_login.HPMHooksCore.inc"
-#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking_login.GetSymbol.inc"
-#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking_login.Hooks.inc"
-#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking_login.HookingPoints.inc"
-#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking_login.sources.inc"
-#include "../login/login.h"
+#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking_login.HPMHooksCore.inc"
+#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking_login.GetSymbol.inc"
+#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking_login.Hooks.inc"
+#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking_login.HookingPoints.inc"
+#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking_login.sources.inc"
+#include "login/login.h"
#elif defined (HPMHOOKING_CHAR)
#define HPM_SERVER_TYPE SERVER_TYPE_CHAR
-#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking_char.HPMHooksCore.inc"
-#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking_char.GetSymbol.inc"
-#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking_char.Hooks.inc"
-#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking_char.HookingPoints.inc"
-#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking_char.sources.inc"
-#include "../char/char.h"
-#include "../char/geoip.h"
-#include "../char/int_auction.h"
-#include "../char/int_elemental.h"
-#include "../char/int_guild.h"
-#include "../char/int_homun.h"
-#include "../char/int_mail.h"
-#include "../char/int_mercenary.h"
-#include "../char/int_party.h"
-#include "../char/int_pet.h"
-#include "../char/int_quest.h"
-#include "../char/int_storage.h"
-#include "../char/inter.h"
-#include "../char/loginif.h"
-#include "../char/mapif.h"
-#include "../char/pincode.h"
+#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking_char.HPMHooksCore.inc"
+#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking_char.GetSymbol.inc"
+#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking_char.Hooks.inc"
+#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking_char.HookingPoints.inc"
+#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking_char.sources.inc"
+#include "char/char.h"
+#include "char/geoip.h"
+#include "char/int_auction.h"
+#include "char/int_elemental.h"
+#include "char/int_guild.h"
+#include "char/int_homun.h"
+#include "char/int_mail.h"
+#include "char/int_mercenary.h"
+#include "char/int_party.h"
+#include "char/int_pet.h"
+#include "char/int_quest.h"
+#include "char/int_storage.h"
+#include "char/inter.h"
+#include "char/loginif.h"
+#include "char/mapif.h"
+#include "char/pincode.h"
#elif defined (HPMHOOKING_MAP)
#define HPM_SERVER_TYPE SERVER_TYPE_MAP
-#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking_map.HPMHooksCore.inc"
-#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking_map.GetSymbol.inc"
-#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking_map.Hooks.inc"
-#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking_map.HookingPoints.inc"
-#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking_map.sources.inc"
-#include "../map/atcommand.h"
-#include "../map/battle.h"
-#include "../map/battleground.h"
-#include "../map/channel.h"
-#include "../map/chat.h"
-#include "../map/chrif.h"
-#include "../map/clif.h"
-#include "../map/duel.h"
-#include "../map/elemental.h"
-#include "../map/guild.h"
-#include "../map/homunculus.h"
-#include "../map/instance.h"
-#include "../map/intif.h"
-#include "../map/irc-bot.h"
-#include "../map/itemdb.h"
-#include "../map/log.h"
-#include "../map/mail.h"
-#include "../map/map.h"
-#include "../map/mapreg.h"
-#include "../map/mercenary.h"
-#include "../map/mob.h"
-#include "../map/npc.h"
-#include "../map/npc.h"
-#include "../map/party.h"
-#include "../map/path.h"
-#include "../map/pc.h"
-#include "../map/pet.h"
-#include "../map/quest.h"
-#include "../map/script.h"
-#include "../map/skill.h"
-#include "../map/status.h"
-#include "../map/storage.h"
-#include "../map/trade.h"
-#include "../map/unit.h"
+#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking_map.HPMHooksCore.inc"
+#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking_map.GetSymbol.inc"
+#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking_map.Hooks.inc"
+#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking_map.HookingPoints.inc"
+#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking_map.sources.inc"
+#include "map/atcommand.h"
+#include "map/battle.h"
+#include "map/battleground.h"
+#include "map/channel.h"
+#include "map/chat.h"
+#include "map/chrif.h"
+#include "map/clif.h"
+#include "map/duel.h"
+#include "map/elemental.h"
+#include "map/guild.h"
+#include "map/homunculus.h"
+#include "map/instance.h"
+#include "map/intif.h"
+#include "map/irc-bot.h"
+#include "map/itemdb.h"
+#include "map/log.h"
+#include "map/mail.h"
+#include "map/map.h"
+#include "map/mapreg.h"
+#include "map/mercenary.h"
+#include "map/mob.h"
+#include "map/npc.h"
+#include "map/npc.h"
+#include "map/party.h"
+#include "map/path.h"
+#include "map/pc.h"
+#include "map/pet.h"
+#include "map/quest.h"
+#include "map/script.h"
+#include "map/skill.h"
+#include "map/status.h"
+#include "map/storage.h"
+#include "map/trade.h"
+#include "map/unit.h"
#else
#define HPM_SERVER_TYPE SERVER_TYPE_UNKNOWN
-#define HPM_CORE_INCLUDE "../plugins/HPMHooking/HPMHooking.HPMHooksCore.inc"
-#define HPM_SYMBOL_INCLUDE "../plugins/HPMHooking/HPMHooking.GetSymbol.inc"
-#define HPM_HOOKS_INCLUDE "../plugins/HPMHooking/HPMHooking.Hooks.inc"
-#define HPM_POINTS_INCLUDE "../plugins/HPMHooking/HPMHooking.HookingPoints.inc"
-#define HPM_SOURCES_INCLUDE "../plugins/HPMHooking/HPMHooking.sources.inc"
+#define HPM_CORE_INCLUDE "HPMHooking/HPMHooking.HPMHooksCore.inc"
+#define HPM_SYMBOL_INCLUDE "HPMHooking/HPMHooking.GetSymbol.inc"
+#define HPM_HOOKS_INCLUDE "HPMHooking/HPMHooking.Hooks.inc"
+#define HPM_POINTS_INCLUDE "HPMHooking/HPMHooking.HookingPoints.inc"
+#define HPM_SOURCES_INCLUDE "HPMHooking/HPMHooking.sources.inc"
#error HPMHooking plugin needs to be compiled for a specific server type. Please make sure your Makefiles are up to date.
#endif
-#include "../common/HPMDataCheck.h"
+#include "common/HPMDataCheck.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
HPExport struct hplugin_info pinfo = {
"HPMHooking", // Plugin name
diff --git a/src/plugins/Makefile.in b/src/plugins/Makefile.in
index 802d1015a..3184353d1 100644
--- a/src/plugins/Makefile.in
+++ b/src/plugins/Makefile.in
@@ -32,6 +32,9 @@ PLUGINS = sample db2sql HPMHooking_char HPMHooking_login HPMHooking_map $(MYPLUG
COMMON_D = ../common
COMMON_H = $(wildcard $(COMMON_D)/*.h)
+COMMON_INCLUDE = -I..
+
+THIRDPARTY_INCLUDE = -I../../3rdparty
CONFIG_D = ../config
CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
@@ -84,7 +87,7 @@ Makefile: Makefile.in
../../plugins/%@DLLEXT@: %.c $(ALL_H) $$(shell ls %/* 2>/dev/null)
@echo " CC $<"
- @$(CC) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
+ @$(CC) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
../../plugins/HPMHooking_login@DLLEXT@: HPMHOOKINGTYPE = LOGIN
../../plugins/HPMHooking_char@DLLEXT@: HPMHOOKINGTYPE = CHAR
@@ -92,4 +95,4 @@ Makefile: Makefile.in
../../plugins/HPMHooking_%@DLLEXT@: HPMHooking.c $(ALL_H) $$(shell ls HPMHooking/*_%* HPMHooking/*_common* 2>/dev/null)
@echo " CC $< ($(HPMHOOKINGTYPE))"
- @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
+ @$(CC) -DHPMHOOKING_$(HPMHOOKINGTYPE) $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @PLUGINSTATIC@ @DEFS@ @CFLAGS@ @CPPFLAGS@ @LDFLAGS@ @SOFLAGS@ -o $@ $<
diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c
index 1e27058c0..7cef173d2 100644
--- a/src/plugins/db2sql.c
+++ b/src/plugins/db2sql.c
@@ -1,25 +1,25 @@
// Copyright (c) Hercules Dev Team, licensed under GNU GPL.
// See the LICENSE file
-#include "../config/core.h"
+#include "config/core.h"
+
+#include "common/HPMi.h"
+#include "common/cbasetypes.h"
+#include "common/conf.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/strlib.h"
+#include "common/timer.h"
+#include "map/clif.h"
+#include "map/itemdb.h"
+#include "map/map.h"
+#include "map/pc.h"
+
+#include "common/HPMDataCheck.h"
#include <stdio.h>
#include <stdlib.h>
-#include "../common/HPMi.h"
-#include "../common/cbasetypes.h"
-#include "../common/conf.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/strlib.h"
-#include "../common/timer.h"
-#include "../map/clif.h"
-#include "../map/itemdb.h"
-#include "../map/map.h"
-#include "../map/pc.h"
-
-#include "../common/HPMDataCheck.h"
-
HPExport struct hplugin_info pinfo = {
"DB2SQL", // Plugin name
SERVER_TYPE_MAP, // Which server types this plugin works with?
diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c
index ac72b8eb2..6ed16d7a6 100644
--- a/src/plugins/dbghelpplug.c
+++ b/src/plugins/dbghelpplug.c
@@ -5,12 +5,13 @@
// Ported from eAthena Dev Team's version @ http://eathena-project.googlecode.com/svn/trunk/src/plugins/dbghelpplug.c
// Currently supported dbghelp 5.1
+#include "common/sysinfo.h"
+#include "common/HPMi.h"
+
+#include "common/HPMDataCheck.h"
+
#include <stdio.h>
#include <string.h>
-#include "../common/sysinfo.h"
-#include "../common/HPMi.h"
-
-#include "../common/HPMDataCheck.h"
/**
* Plugin basic information
diff --git a/src/plugins/sample.c b/src/plugins/sample.c
index 82cb198bd..b034775b0 100644
--- a/src/plugins/sample.c
+++ b/src/plugins/sample.c
@@ -2,21 +2,21 @@
// See the LICENSE file
// Sample Hercules Plugin
+#include "common/HPMi.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "map/clif.h"
+#include "map/pc.h"
+#include "map/script.h"
+
+#include "common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/HPMi.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/socket.h"
-#include "../common/strlib.h"
-#include "../map/clif.h"
-#include "../map/pc.h"
-#include "../map/script.h"
-
-#include "../common/HPMDataCheck.h" /* should always be the last file included! (if you don't make it last, it'll intentionally break compile time) */
-
HPExport struct hplugin_info pinfo = {
"Sample", // Plugin name
SERVER_TYPE_CHAR|SERVER_TYPE_LOGIN|SERVER_TYPE_MAP,// Which server types this plugin works with?
diff --git a/src/test/Makefile.in b/src/test/Makefile.in
index dea126e46..8f999fb37 100644
--- a/src/test/Makefile.in
+++ b/src/test/Makefile.in
@@ -9,18 +9,20 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
COMMON_H = $(wildcard $(COMMON_D)/*.h)
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
+COMMON_INCLUDE = -I..
-LIBCONFIG_D = ../../3rdparty/libconfig
+THIRDPARTY_D = ../../3rdparty
+THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D)
+
+LIBCONFIG_D = $(THIRDPARTY_D)/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
scanctx.h scanner.h strbuf.h wincompat.h)
-LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
-MT19937AR_D = ../../3rdparty/mt19937ar
+MT19937AR_D = $(THIRDPARTY_D)/mt19937ar
MT19937AR_OBJ = $(MT19937AR_D)/mt19937ar.o
MT19937AR_H = $(MT19937AR_D)/mt19937ar.h
-MT19937AR_INCLUDE = -I$(MT19937AR_D)
TEST_SPINLOCK_OBJ = obj/test_spinlock.o
TEST_SPINLOCK_C = test_spinlock.c
@@ -70,7 +72,7 @@ test_spinlock: $(TEST_SPINLOCK_DEPENDS) Makefile
obj/%.o: %.c $(TEST_SPINLOCK_H) $(COMMON_H) $(CONFIG_H) $(MT19937AR_H) $(LIBCONFIG_H) | obj
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(MT19937AR_INCLUDE) $(LIBCONFIG_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) -DWITH_SQL @MYSQL_CFLAGS@ @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing object files
$(COMMON_D)/obj_all/common.a:
diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c
index 19ae9aee7..ace894e9b 100644
--- a/src/test/test_spinlock.c
+++ b/src/test/test_spinlock.c
@@ -1,9 +1,10 @@
+#define HERCULES_CORE
-#include "../common/core.h"
-#include "../common/atomic.h"
-#include "../common/thread.h"
-#include "../common/spinlock.h"
-#include "../common/showmsg.h"
+#include "common/core.h"
+#include "common/atomic.h"
+#include "common/thread.h"
+#include "common/spinlock.h"
+#include "common/showmsg.h"
#include <stdio.h>
#include <stdlib.h>
@@ -12,8 +13,6 @@
// Simple test for the spinlock implementation to see if it works properly..
//
-
-
#define THRC 32 //thread Count
#define PERINC 100000
#define LOOPS 47
diff --git a/src/tool/Makefile.in b/src/tool/Makefile.in
index 2d7699db0..b0c07b2fb 100644
--- a/src/tool/Makefile.in
+++ b/src/tool/Makefile.in
@@ -9,13 +9,16 @@ CONFIG_H = $(wildcard $(CONFIG_D)/*.h) $(wildcard $(CONFIG_D)/*/*.h)
COMMON_D = ../common
COMMON_H = $(wildcard $(COMMON_D)/*.h)
SYSINFO_INC = $(COMMON_D)/sysinfo.inc
+COMMON_INCLUDE = -I..
-LIBCONFIG_D = ../../3rdparty/libconfig
+THIRDPARTY_D = ../../3rdparty
+THIRDPARTY_INCLUDE = -I$(THIRDPARTY_D)
+
+LIBCONFIG_D = $(THIRDPARTY_D)/libconfig
LIBCONFIG_OBJ = $(addprefix $(LIBCONFIG_D)/, libconfig.o grammar.o scanctx.o \
scanner.o strbuf.o)
LIBCONFIG_H = $(addprefix $(LIBCONFIG_D)/, libconfig.h grammar.h parsectx.h \
scanctx.h scanner.h strbuf.h wincompat.h)
-LIBCONFIG_INCLUDE = -I$(LIBCONFIG_D)
MAPCACHE_OBJ = obj_all/mapcache.o
MAPCACHE_C = mapcache.c
@@ -70,7 +73,7 @@ obj_all:
obj_all/%.o: %.c $(MAPCACHE_H) $(COMMON_H) $(CONFIG_H) $(LIBCONFIG_H) | obj_all
@echo " CC $<"
- @$(CC) @CFLAGS@ @DEFS@ $(LIBCONFIG_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
+ @$(CC) @CFLAGS@ @DEFS@ $(COMMON_INCLUDE) $(THIRDPARTY_INCLUDE) @CPPFLAGS@ -c $(OUTPUT_OPTION) $<
# missing common object files
$(COMMON_D)/obj_all/common_mini.a:
diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c
index 5cdaf6c94..6aa9bf273 100644
--- a/src/tool/mapcache.c
+++ b/src/tool/mapcache.c
@@ -3,21 +3,20 @@
#define HERCULES_CORE
-#include "../config/core.h" // RENEWAL
+#include "config/core.h" // RENEWAL
+
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/grfio.h"
+#include "common/malloc.h"
+#include "common/mmo.h"
+#include "common/showmsg.h"
+#include "common/strlib.h"
+#include "common/utils.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-
-#include "../common/cbasetypes.h"
-#include "../common/core.h"
-#include "../common/grfio.h"
-#include "../common/malloc.h"
-#include "../common/mmo.h"
-#include "../common/showmsg.h"
-#include "../common/utils.h"
-#include "../common/strlib.h"
-
#ifndef _WIN32
#include <unistd.h>
#endif