summaryrefslogtreecommitdiff
path: root/src/char
diff options
context:
space:
mode:
Diffstat (limited to 'src/char')
-rw-r--r--src/char/HPMchar.c51
-rw-r--r--src/char/HPMchar.h4
-rw-r--r--src/char/Makefile.in12
-rw-r--r--src/char/char.c71
-rw-r--r--src/char/char.h7
-rw-r--r--src/char/geoip.c8
-rw-r--r--src/char/geoip.h3
-rw-r--r--src/char/int_auction.c30
-rw-r--r--src/char/int_auction.h3
-rw-r--r--src/char/int_elemental.c25
-rw-r--r--src/char/int_elemental.h2
-rw-r--r--src/char/int_guild.c29
-rw-r--r--src/char/int_guild.h3
-rw-r--r--src/char/int_homun.c25
-rw-r--r--src/char/int_homun.h2
-rw-r--r--src/char/int_mail.c25
-rw-r--r--src/char/int_mail.h2
-rw-r--r--src/char/int_mercenary.c26
-rw-r--r--src/char/int_mercenary.h2
-rw-r--r--src/char/int_party.c29
-rw-r--r--src/char/int_party.h3
-rw-r--r--src/char/int_pet.c25
-rw-r--r--src/char/int_quest.c26
-rw-r--r--src/char/int_storage.c25
-rw-r--r--src/char/inter.c47
-rw-r--r--src/char/inter.h8
-rw-r--r--src/char/loginif.c20
-rw-r--r--src/char/loginif.h4
-rw-r--r--src/char/mapif.c22
-rw-r--r--src/char/mapif.h11
-rw-r--r--src/char/pincode.c19
-rw-r--r--src/char/pincode.h4
32 files changed, 290 insertions, 283 deletions
diff --git a/src/char/HPMchar.c b/src/char/HPMchar.c
index 4b153b244..05429fbb8 100644
--- a/src/char/HPMchar.c
+++ b/src/char/HPMchar.c
@@ -5,26 +5,37 @@
#include "HPMchar.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"
+#include "common/HPM.h"
+#include "common/cbasetypes.h"
+
+#if 0 // TODO (HPMDataCheck is disabled for the time being)
+#include "char/char.h"
+#include "char/geoip.h"
+#include "char/inter.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/loginif.h"
+#include "char/mapif.h"
+#include "char/pincode.h"
+#include "common/conf.h"
+#include "common/db.h"
+#include "common/des.h"
+#include "common/ers.h"
+#include "common/mapindex.h"
+#include "common/mmo.h"
+#include "common/socket.h"
+#include "common/strlib.h"
+#include "common/sysinfo.h"
+#include "common/HPMDataCheck.h"
+#endif
bool HPM_char_grabHPData(struct HPDataOperationStorage *ret, enum HPluginDataTypes type, void *ptr) {
/* record address */
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..5e3c34684 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -4,50 +4,49 @@
#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/sql.h"
+#include "common/timer.h"
+#include "common/utils.h"
+
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#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..0f351ca8c 100644
--- a/src/char/char.h
+++ b/src/char/char.h
@@ -5,9 +5,10 @@
#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"
+#include "common/mmo.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..4d39011aa 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
@@ -15,6 +15,7 @@ struct s_geoip {
bool active;
};
+
/**
* geoip interface
**/
diff --git a/src/char/int_auction.c b/src/char/int_auction.c
index f2ec347cd..8d51777fb 100644
--- a/src/char/int_auction.c
+++ b/src/char/int_auction.c
@@ -6,23 +6,23 @@
#include "int_auction.h"
+#include "char/char.h"
+#include "char/int_mail.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/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;
diff --git a/src/char/int_auction.h b/src/char/int_auction.h
index c27ecd6c3..610042b9a 100644
--- a/src/char/int_auction.h
+++ b/src/char/int_auction.h
@@ -4,7 +4,8 @@
#ifndef CHAR_INT_AUCTION_H
#define CHAR_INT_AUCTION_H
-#include "../common/mmo.h"
+#include "common/db.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..eff84c57d 100644
--- a/src/char/int_elemental.c
+++ b/src/char/int_elemental.c
@@ -6,21 +6,20 @@
#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;
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..96a78203f 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.c
@@ -4,25 +4,24 @@
#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
diff --git a/src/char/int_guild.h b/src/char/int_guild.h
index e7d089943..eb4c930fc 100644
--- a/src/char/int_guild.h
+++ b/src/char/int_guild.h
@@ -4,7 +4,8 @@
#ifndef CHAR_INT_GUILD_H
#define CHAR_INT_GUILD_H
-#include "../common/mmo.h"
+#include "common/db.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..2ec589eaf 100644
--- a/src/char/int_homun.c
+++ b/src/char/int_homun.c
@@ -6,21 +6,20 @@
#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;
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..0d46339e0 100644
--- a/src/char/int_mail.c
+++ b/src/char/int_mail.c
@@ -6,21 +6,20 @@
#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;
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..02082aa13 100644
--- a/src/char/int_mercenary.c
+++ b/src/char/int_mercenary.c
@@ -6,21 +6,21 @@
#include "int_mercenary.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.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;
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..71f2817b4 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -6,23 +6,22 @@
#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;
diff --git a/src/char/int_party.h b/src/char/int_party.h
index 61d828bc0..99ee5b13e 100644
--- a/src/char/int_party.h
+++ b/src/char/int_party.h
@@ -4,7 +4,8 @@
#ifndef CHAR_INT_PARTY_H
#define CHAR_INT_PARTY_H
-#include "../common/mmo.h"
+#include "common/db.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..22fe2dcc2 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.c
@@ -6,21 +6,20 @@
#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..cf9b9c172 100644
--- a/src/char/int_quest.c
+++ b/src/char/int_quest.c
@@ -6,22 +6,20 @@
#include "int_quest.h"
+#include "char/char.h"
+#include "char/inter.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.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 <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..a12d9fe17 100644
--- a/src/char/int_storage.c
+++ b/src/char/int_storage.c
@@ -4,23 +4,22 @@
#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
diff --git a/src/char/inter.c b/src/char/inter.c
index 3571a3e2e..ca041d581 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -6,32 +6,31 @@
#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..2e89a685b 100644
--- a/src/char/inter.h
+++ b/src/char/inter.h
@@ -5,9 +5,11 @@
#ifndef CHAR_INTER_H
#define CHAR_INTER_H
-#include "char.h"
-#include "../common/cbasetypes.h"
-#include "../common/sql.h"
+#include "common/cbasetypes.h"
+#include "common/db.h"
+#include "common/sql.h"
+
+#include <stdarg.h>
struct accreg;
diff --git a/src/char/loginif.c b/src/char/loginif.c
index f53d9bb71..881c8f2ac 100644
--- a/src/char/loginif.c
+++ b/src/char/loginif.c
@@ -6,19 +6,19 @@
#include "loginif.h"
+#include "char/char.h"
+#include "char/mapif.h"
+#include "common/cbasetypes.h"
+#include "common/core.h"
+#include "common/db.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..548eaff02 100644
--- a/src/char/loginif.h
+++ b/src/char/loginif.h
@@ -5,7 +5,9 @@
#ifndef CHAR_LOGINIF_H
#define CHAR_LOGINIF_H
-#include "char.h"
+#include "common/cbasetypes.h"
+
+struct char_session_data;
/**
* 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..6b015d155 100644
--- a/src/char/mapif.h
+++ b/src/char/mapif.h
@@ -5,16 +5,9 @@
#ifndef CHAR_MAPIF_H
#define CHAR_MAPIF_H
-#include "char.h"
+#include "common/cbasetypes.h"
+#include "common/mmo.h"
-struct s_elemental;
-struct s_homunculus;
-struct s_mercenary;
-struct s_pet;
-struct guild_storage;
-struct storage_data;
-struct quest;
-struct mail_message;
struct WisData;
/**
diff --git a/src/char/pincode.c b/src/char/pincode.c
index c3d2b2298..43958af8a 100644
--- a/src/char/pincode.c
+++ b/src/char/pincode.c
@@ -6,16 +6,17 @@
#include "pincode.h"
-#include <stdlib.h>
+#include "char/char.h"
+#include "common/cbasetypes.h"
+#include "common/db.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..01f6c7bf9 100644
--- a/src/char/pincode.h
+++ b/src/char/pincode.h
@@ -5,7 +5,9 @@
#ifndef CHAR_PINCODE_H
#define CHAR_PINCODE_H
-#include "char.h"
+#include "common/cbasetypes.h"
+
+struct char_session_data;
enum PincodeResponseCode {
PINCODE_OK = 0,