From a2722019a379f83ee5a1b35a1a100400e3e7170e Mon Sep 17 00:00:00 2001 From: Haru Date: Wed, 18 Sep 2013 16:30:52 +0200 Subject: Fixed a race condition leading to a crash on server shutdown on linux Fixes bugreport:7699, thanks to bgamez23 (bugreport), Ind (testing, brainstorming) http://hercules.ws/board/tracker/issue-7699-map-crashed-on-the-latest-version/ Signed-off-by: Haru --- src/common/thread.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/common/thread.c b/src/common/thread.c index 315b310b2..4d110f2dd 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -96,15 +96,11 @@ void rathread_final(){ // gets called whenever a thread terminated .. -static void rat_thread_terminated( rAthread handle ){ - - int id_backup = handle->myID; - - // Simply set all members to 0 (except the id) - memset(handle, 0x00, sizeof(struct rAthread)); - - handle->myID = id_backup; // done ;) - +static void rat_thread_terminated(rAthread handle) { + // Preserve handle->myID and handle->hThread, set everything else to its default value + handle->param = NULL; + handle->proc = NULL; + handle->prio = RAT_PRIO_NORMAL; }//end: rat_thread_terminated() #ifdef WIN32 -- cgit v1.2.3-70-g09d2 From b6b3f58795288701d0e162d43fa6f0a47af913b3 Mon Sep 17 00:00:00 2001 From: Haru Date: Sun, 4 May 2014 06:13:56 +0200 Subject: Fixed order of includes in all source files - Changed order according to the (upcoming) code style guidelines. - Fixes several issues caused by missing headers when their include order is changed or in plugins. Signed-off-by: Haru --- src/char/char.c | 44 +++++----- src/char/char.h | 1 - src/char/int_auction.c | 25 +++--- src/char/int_elemental.c | 22 +++-- src/char/int_elemental.h | 2 +- src/char/int_guild.c | 24 ++--- src/char/int_guild.h | 3 - src/char/int_homun.c | 21 +++-- src/char/int_homun.h | 2 + src/char/int_mail.c | 20 +++-- src/char/int_mail.h | 3 + src/char/int_mercenary.c | 22 +++-- src/char/int_mercenary.h | 4 +- src/char/int_party.c | 25 +++--- src/char/int_party.h | 2 - src/char/int_pet.c | 22 +++-- src/char/int_quest.c | 22 ++--- src/char/int_storage.c | 22 +++-- src/char/inter.c | 43 ++++----- src/char/inter.h | 5 +- src/char/pincode.c | 11 ++- src/common/HPM.c | 31 ++++--- src/common/HPM.h | 6 +- src/common/HPMi.h | 16 +--- src/common/cbasetypes.h | 6 ++ src/common/conf.c | 3 + src/common/conf.h | 1 + src/common/console.c | 223 ++++++++++++++++++++++++----------------------- src/common/console.h | 21 +++-- src/common/core.c | 38 ++++---- src/common/core.h | 3 +- src/common/db.c | 10 ++- src/common/db.h | 3 +- src/common/des.c | 7 +- src/common/ers.c | 8 +- src/common/grfio.c | 17 ++-- src/common/malloc.c | 11 ++- src/common/mapindex.c | 15 ++-- src/common/md5calc.c | 8 +- src/common/mmo.h | 6 +- src/common/mutex.c | 5 +- src/common/mutex.h | 1 + src/common/nullpo.c | 6 +- src/common/random.c | 18 ++-- src/common/showmsg.c | 17 ++-- src/common/showmsg.h | 23 +++-- src/common/socket.c | 64 +++++++------- src/common/socket.h | 12 +-- src/common/spinlock.h | 9 +- src/common/sql.c | 12 ++- src/common/sql.h | 3 +- src/common/strlib.c | 13 +-- src/common/strlib.h | 15 ++-- src/common/sysinfo.c | 32 +++++-- src/common/sysinfo.h | 16 ---- src/common/thread.c | 31 ++++--- src/common/thread.h | 1 - src/common/timer.c | 19 ++-- src/common/utils.c | 36 ++++---- src/common/utils.h | 3 +- src/config/const.h | 7 -- src/config/renewal.h | 1 + src/login/account.h | 1 + src/login/account_sql.c | 17 ++-- src/login/ipban_sql.c | 14 +-- src/login/login.c | 21 +++-- src/login/login.h | 2 +- src/login/loginlog.h | 2 +- src/login/loginlog_sql.c | 9 +- src/map/HPMmap.c | 42 ++++----- src/map/atcommand.c | 67 +++++++------- src/map/atcommand.h | 2 +- src/map/battle.c | 61 +++++++------ src/map/battle.h | 2 +- src/map/battleground.c | 33 +++---- src/map/battleground.h | 2 +- src/map/buyingstore.c | 17 ++-- src/map/buyingstore.h | 5 ++ src/map/chat.c | 23 ++--- src/map/chat.h | 5 +- src/map/chrif.c | 35 ++++---- src/map/chrif.h | 4 +- src/map/clif.c | 83 +++++++++--------- src/map/clif.h | 9 +- src/map/date.c | 6 +- src/map/date.h | 2 + src/map/duel.c | 10 ++- src/map/duel.h | 4 + src/map/elemental.c | 54 ++++++------ src/map/elemental.h | 1 + src/map/guild.c | 47 +++++----- src/map/guild.h | 16 +--- src/map/homunculus.c | 56 ++++++------ src/map/homunculus.h | 3 +- src/map/instance.c | 34 ++++---- src/map/instance.h | 3 + src/map/intif.c | 51 ++++++----- src/map/intif.h | 13 +-- src/map/irc-bot.c | 22 ++--- src/map/irc-bot.h | 2 + src/map/itemdb.c | 27 +++--- src/map/itemdb.h | 5 +- src/map/log.c | 23 ++--- src/map/log.h | 5 +- src/map/mail.c | 16 ++-- src/map/mail.h | 6 +- src/map/map.c | 96 ++++++++++---------- src/map/map.h | 9 +- src/map/mapreg_sql.c | 14 +-- src/map/mercenary.c | 54 ++++++------ src/map/mercenary.h | 1 + src/map/mob.c | 69 ++++++++------- src/map/mob.h | 9 +- src/map/npc.c | 57 ++++++------ src/map/npc.h | 4 +- src/map/npc_chat.c | 26 +++--- src/map/party.c | 43 ++++----- src/map/party.h | 7 +- src/map/path.c | 17 ++-- src/map/path.h | 1 + src/map/pc.c | 59 +++++++------ src/map/pc.h | 29 +++--- src/map/pc_groups.c | 14 +-- src/map/pc_groups.h | 4 + src/map/pet.c | 48 +++++----- src/map/pet.h | 10 ++- src/map/quest.c | 45 +++++----- src/map/quest.h | 4 + src/map/script.c | 79 +++++++++-------- src/map/script.h | 12 +-- src/map/searchstore.c | 11 ++- src/map/searchstore.h | 6 ++ src/map/skill.c | 64 +++++++------- src/map/skill.h | 14 +-- src/map/status.c | 59 +++++++------ src/map/status.h | 16 ++-- src/map/storage.c | 32 +++---- src/map/storage.h | 5 +- src/map/trade.c | 24 ++--- src/map/unit.c | 63 ++++++------- src/map/unit.h | 12 ++- src/map/vending.c | 27 +++--- src/map/vending.h | 1 + src/tool/mapcache.c | 14 +-- 144 files changed, 1676 insertions(+), 1367 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/char/char.c b/src/char/char.c index 77e393c0d..6c0902644 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2,7 +2,30 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT +#include "char.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "int_elemental.h" +#include "int_guild.h" +#include "int_homun.h" +#include "int_mercenary.h" +#include "int_party.h" +#include "int_storage.h" +#include "inter.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" @@ -13,25 +36,6 @@ #include "../common/strlib.h" #include "../common/timer.h" #include "../common/utils.h" -#include "../common/console.h" -#include "../common/HPM.h" -#include "int_guild.h" -#include "int_homun.h" -#include "int_mercenary.h" -#include "int_elemental.h" -#include "int_party.h" -#include "int_storage.h" -#include "char.h" -#include "inter.h" -#include "pincode.h" - -#include -#include -#include -#include -#include -#include -#include // private declarations #define CHAR_CONF_NAME "conf/char-server.conf" @@ -5497,7 +5501,7 @@ int do_init(int argc, char **argv) { Sql_HerculesUpdateCheck(sql_handle); #ifdef CONSOLE_INPUT - console->setSQL(sql_handle); + console->input->setSQL(sql_handle); #endif ShowStatus("The char-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", char_port); diff --git a/src/char/char.h b/src/char/char.h index 2928929de..09a78f6b9 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -5,7 +5,6 @@ #ifndef _COMMON_CHAR_H_ #define _COMMON_CHAR_H_ -#include "../config/core.h" #include "../common/core.h" // CORE_ST_LAST #include "../common/db.h" diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 924930867..886b5be26 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -2,22 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" +#define HERCULES_CORE + +#include "int_auction.h" + +#include +#include +#include + +#include "char.h" +#include "int_mail.h" +#include "inter.h" #include "../common/db.h" +#include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" -#include "int_mail.h" -#include "int_auction.h" - -#include -#include -#include static DBMap* auction_db_ = NULL; // int auction_id -> struct auction_data* diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c index ed0c2a9ed..3a36e75a2 100644 --- a/src/char/int_elemental.c +++ b/src/char/int_elemental.c @@ -2,20 +2,24 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_elemental.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" + bool mapif_elemental_save(struct s_elemental* ele) { bool flag = true; diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h index c90891fc4..c869e6fc2 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_ -struct s_elemental; +#include "../common/cbasetypes.h" void inter_elemental_sql_init(void); void inter_elemental_sql_final(void); diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 895cbbb94..ffbe48e10 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -2,21 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // DBPATH +#include "int_guild.h" + +#include +#include +#include + +#include "char.h" +#include "inter.h" #include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/socket.h" #include "../common/db.h" +#include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" +#include "../common/socket.h" #include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" -#include "int_guild.h" - -#include -#include -#include #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 4eb7d310b..5e657ff06 100644 --- a/src/char/int_guild.h +++ b/src/char/int_guild.h @@ -20,9 +20,6 @@ enum { GS_REMOVE = 0x8000, }; -struct guild; -struct guild_castle; - int inter_guild_parse_frommap(int fd); int inter_guild_sql_init(void); void inter_guild_sql_final(void); diff --git a/src/char/int_homun.c b/src/char/int_homun.c index 143277f05..795a6b927 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -2,20 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_homun.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" int inter_homunculus_sql_init(void) { diff --git a/src/char/int_homun.h b/src/char/int_homun.h index 561dc848f..9477f4f03 100644 --- a/src/char/int_homun.h +++ b/src/char/int_homun.h @@ -4,6 +4,8 @@ #ifndef _CHAR_INT_HOMUN_H_ #define _CHAR_INT_HOMUN_H_ +#include "../common/cbasetypes.h" + struct s_homunculus; int inter_homunculus_sql_init(void); diff --git a/src/char/int_mail.c b/src/char/int_mail.c index 826771676..86a36d59f 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -2,19 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" +#define HERCULES_CORE + +#include "int_mail.h" + +#include +#include +#include + +#include "char.h" +#include "inter.h" #include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" - -#include -#include -#include static int mail_fromsql(int char_id, struct mail_data* md) { diff --git a/src/char/int_mail.h b/src/char/int_mail.h index 7c06cdc1f..824ba48a3 100644 --- a/src/char/int_mail.h +++ b/src/char/int_mail.h @@ -4,6 +4,9 @@ #ifndef _CHAR_INT_MAIL_H_ #define _CHAR_INT_MAIL_H_ +struct item; +struct mail_message; + int inter_mail_parse_frommap(int fd); void mail_sendmail(int send_id, const char* send_name, int dest_id, const char* dest_name, const char* title, const char* body, int zeny, struct item *item); diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c index aecb3844a..1dffb656c 100644 --- a/src/char/int_mercenary.c +++ b/src/char/int_mercenary.c @@ -2,20 +2,24 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_mercenary.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" + bool mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status) { char* data; diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h index b614b8cf7..195a83b34 100644 --- a/src/char/int_mercenary.h +++ b/src/char/int_mercenary.h @@ -4,7 +4,9 @@ #ifndef _CHAR_INT_MERCENARY_H_ #define _CHAR_INT_MERCENARY_H_ -struct s_mercenary; +#include "../common/cbasetypes.h" + +struct mmo_charstatus; int inter_mercenary_sql_init(void); void inter_mercenary_sql_final(void); diff --git a/src/char/int_party.c b/src/char/int_party.c index 7c328c452..3e4a743d6 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -2,23 +2,26 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/socket.h" -#include "../common/showmsg.h" -#include "../common/mapindex.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + #include "int_party.h" #include #include #include +#include "char.h" +#include "inter.h" +#include "../common/cbasetypes.h" +#include "../common/db.h" +#include "../common/malloc.h" +#include "../common/mapindex.h" +#include "../common/mmo.h" +#include "../common/showmsg.h" +#include "../common/socket.h" +#include "../common/sql.h" +#include "../common/strlib.h" + struct party_data { struct party party; unsigned int min_lv, max_lv; diff --git a/src/char/int_party.h b/src/char/int_party.h index 84f00635a..098c1e9a9 100644 --- a/src/char/int_party.h +++ b/src/char/int_party.h @@ -14,8 +14,6 @@ enum { PS_BREAK = 0x20, //Specify that this party must be deleted. }; -struct party; - int inter_party_parse_frommap(int fd); int inter_party_sql_init(void); void inter_party_sql_final(void); diff --git a/src/char/int_pet.c b/src/char/int_pet.c index 25f00e6f0..29c40eff9 100644 --- a/src/char/int_pet.c +++ b/src/char/int_pet.c @@ -2,20 +2,24 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_pet.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" + struct s_pet *pet_pt; //--------------------------------------------------------- diff --git a/src/char/int_quest.c b/src/char/int_quest.c index 061dd89d9..61b43c57d 100644 --- a/src/char/int_quest.c +++ b/src/char/int_quest.c @@ -2,23 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" +#define HERCULES_CORE + +#include "int_quest.h" + +#include +#include +#include + +#include "char.h" +#include "inter.h" #include "../common/db.h" #include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" -#include "int_quest.h" - -#include -#include -#include - /** * Loads the entire questlog for a character. * diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 966e61bb3..bf7b76da0 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -2,19 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" // StringBuf -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "../config/core.h" // GP_BOUND_ITEMS +#include "int_storage.h" #include -#include #include +#include +#include "char.h" +#include "inter.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" // StringBuf #define STORAGE_MEMINC 16 diff --git a/src/char/inter.c b/src/char/inter.c index c48b26fdd..8b6368e9d 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -2,33 +2,34 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "char.h" +#define HERCULES_CORE + #include "inter.h" -#include "int_party.h" -#include "int_guild.h" -#include "int_storage.h" -#include "int_pet.h" -#include "int_homun.h" -#include "int_mercenary.h" -#include "int_mail.h" -#include "int_auction.h" -#include "int_quest.h" -#include "int_elemental.h" +#include #include -#include #include -#include - +#include #include // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool] +#include "char.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 "../common/db.h" +#include "../common/malloc.h" +#include "../common/mmo.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 25b0c2a96..5e655237e 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -5,9 +5,10 @@ #ifndef _CHAR_INTER_H_ #define _CHAR_INTER_H_ -struct accreg; -#include "../common/sql.h" #include "char.h" +#include "../common/sql.h" + +struct accreg; int inter_init_sql(const char *file); void inter_final(void); diff --git a/src/char/pincode.c b/src/char/pincode.c index d51953448..59182f12d 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "pincode.h" + +#include + +#include "char.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 "pincode.h" - -#include int enabled = PINCODE_OK; int changetime = 0; diff --git a/src/common/HPM.c b/src/common/HPM.c index 9ffce87de..00b92dc60 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -1,26 +1,31 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT +#include "HPM.h" + +#include +#include +#include + #include "../common/cbasetypes.h" -#include "../common/mmo.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/timer.h" -#include "../common/conf.h" -#include "../common/utils.h" -#include "../common/console.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/sysinfo.h" -#include "HPM.h" +#include "../common/timer.h" +#include "../common/utils.h" -#include -#include -#include #ifndef WIN32 -#include +# include #endif struct malloc_interface iMalloc_HPM; @@ -686,7 +691,7 @@ bool hplugins_parse_conf(const char *w1, const char *w2, enum HPluginConfType po void hplugins_share_defaults(void) { /* console */ #ifdef CONSOLE_INPUT - HPM->share(console->addCommand,"addCPCommand"); + HPM->share(console->input->addCommand,"addCPCommand"); #endif /* our own */ HPM->share(hplugins_addpacket,"addPacket"); @@ -755,7 +760,7 @@ void hpm_init(void) { HPM->symbol_defaults(); #ifdef CONSOLE_INPUT - console->addCommand("plugins",CPCMD_A(plugins)); + console->input->addCommand("plugins",CPCMD_A(plugins)); #endif return; } diff --git a/src/common/HPM.h b/src/common/HPM.h index 0f0df4cda..9c176cfd6 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -4,8 +4,12 @@ #ifndef _COMMON_HPM_H_ #define _COMMON_HPM_H_ -#include "../common/cbasetypes.h" +#ifndef HERCULES_CORE +#error You should never include HPM.h from a plugin. +#endif + #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 19206aeca..b98e87d90 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -5,8 +5,8 @@ #define _COMMON_HPMI_H_ #include "../common/cbasetypes.h" -#include "../common/core.h" #include "../common/console.h" +#include "../common/core.h" #include "../common/sql.h" struct script_state; @@ -20,18 +20,6 @@ struct map_session_data; #define HPExport #endif -#ifndef _COMMON_SHOWMSG_H_ - HPExport void (*ShowMessage) (const char *, ...); - HPExport void (*ShowStatus) (const char *, ...); - HPExport void (*ShowSQL) (const char *, ...); - HPExport void (*ShowInfo) (const char *, ...); - HPExport void (*ShowNotice) (const char *, ...); - HPExport void (*ShowWarning) (const char *, ...); - HPExport void (*ShowDebug) (const char *, ...); - HPExport void (*ShowError) (const char *, ...); - HPExport void (*ShowFatalError) (const char *, ...); -#endif - /* after */ #include "../common/showmsg.h" @@ -192,7 +180,7 @@ HPExport struct HPMi_interface { /* pc group permission */ void (*addPCGPermission) (unsigned int pluginID, char *name, unsigned int *mask); } HPMi_s; -#ifndef _COMMON_HPM_H_ +#ifndef HERCULES_CORE HPExport struct HPMi_interface *HPMi; #endif diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index f44e80413..da0d6b307 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -442,5 +442,11 @@ void SET_FUNCPOINTER(T1& var, T2 p) #define SET_FUNCPOINTER(var,p) ((var) = (p)) #endif +/* pointer size fix which fixes several gcc warnings */ +#ifdef __64BIT__ + #define __64BPTRSIZE(y) ((intptr)(y)) +#else + #define __64BPTRSIZE(y) (y) +#endif #endif /* _COMMON_CBASETYPES_H_ */ diff --git a/src/common/conf.c b/src/common/conf.c index b816b2f7f..46a034497 100644 --- a/src/common/conf.c +++ b/src/common/conf.c @@ -2,7 +2,10 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + #include "conf.h" + #include "../../3rdparty/libconfig/libconfig.h" #include "../common/showmsg.h" // ShowError diff --git a/src/common/conf.h b/src/common/conf.h index 9aff3df47..e5b637e47 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -6,6 +6,7 @@ #define _COMMON_CONF_H_ #include "../common/cbasetypes.h" + #include "../../3rdparty/libconfig/libconfig.h" /** diff --git a/src/common/console.c b/src/common/console.c index d8f352c8a..6a82db555 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -2,42 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT +#include "console.h" + +#include +#include + #include "../common/cbasetypes.h" -#include "../common/showmsg.h" #include "../common/core.h" +#include "../common/showmsg.h" #include "../common/sysinfo.h" -#include "../config/core.h" -#include "console.h" #ifndef MINICORE - #include "../common/ers.h" - #include "../common/malloc.h" - #include "../common/atomic.h" - #include "../common/spinlock.h" - #include "../common/thread.h" - #include "../common/mutex.h" - #include "../common/timer.h" - #include "../common/strlib.h" - #include "../common/sql.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 -#include #if !defined(WIN32) - #include - #include +# include +# include #else - #include "../common/winapi.h" // Console close event handling +# include "../common/winapi.h" // Console close event handling +# ifdef CONSOLE_INPUT +# include /* _kbhit() */ +# endif #endif +struct console_interface console_s; #ifdef CONSOLE_INPUT - #if defined(WIN32) - #include /* _kbhit() */ - #endif +struct console_input_interface console_input_s; #endif -struct console_interface console_s; - /*====================================== * CORE : Display title *--------------------------------------*/ @@ -116,12 +120,12 @@ CPCMD_C(mem_report,server) { **/ CPCMD(help) { unsigned int i = 0; - for ( i = 0; i < console->cmd_list_count; i++ ) { - if( console->cmd_list[i]->next_count ) { - ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",console->cmd_list[i]->cmd); - console->parse_list_subs(console->cmd_list[i],2); + for ( i = 0; i < console->input->cmd_list_count; i++ ) { + if( console->input->cmd_list[i]->next_count ) { + ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",console->input->cmd_list[i]->cmd); + console->input->parse_list_subs(console->input->cmd_list[i],2); } else { - ShowInfo("- '"CL_WHITE"%s"CL_RESET"'\n",console->cmd_list[i]->cmd); + ShowInfo("- '"CL_WHITE"%s"CL_RESET"'\n",console->input->cmd_list[i]->cmd); } } } @@ -144,7 +148,7 @@ CPCMD_C(skip,update) { ShowDebug("usage example: sql update skip 2013-02-14--16-15.sql\n"); return; } - Sql_HerculesUpdateSkip(console->SQL, line); + Sql_HerculesUpdateSkip(console->input->SQL, line); } /** @@ -206,7 +210,7 @@ void console_load_defaults(void) { unsigned int i, len = ARRAYLENGTH(default_list); struct CParseEntry *cmd; - RECREATE(console->cmds,struct CParseEntry *, len); + RECREATE(console->input->cmds,struct CParseEntry *, len); for(i = 0; i < len; i++) { CREATE(cmd, struct CParseEntry, 1); @@ -220,12 +224,12 @@ void console_load_defaults(void) { cmd->next_count = 0; - console->cmd_count++; - console->cmds[i] = cmd; + console->input->cmd_count++; + console->input->cmds[i] = cmd; default_list[i].self = cmd; if( !default_list[i].connect ) { - RECREATE(console->cmd_list,struct CParseEntry *, ++console->cmd_list_count); - console->cmd_list[console->cmd_list_count - 1] = cmd; + RECREATE(console->input->cmd_list,struct CParseEntry *, ++console->input->cmd_list_count); + console->input->cmd_list[console->input->cmd_list_count - 1] = cmd; } } @@ -233,11 +237,11 @@ void console_load_defaults(void) { unsigned int k; if( !default_list[i].connect ) continue; - for(k = 0; k < console->cmd_count; k++) { - if( strcmpi(default_list[i].connect,console->cmds[k]->cmd) == 0 ) { + for(k = 0; k < console->input->cmd_count; k++) { + if( strcmpi(default_list[i].connect,console->input->cmds[k]->cmd) == 0 ) { cmd = default_list[i].self; - RECREATE(console->cmds[k]->u.next, struct CParseEntry *, ++console->cmds[k]->next_count); - console->cmds[k]->u.next[console->cmds[k]->next_count - 1] = cmd; + RECREATE(console->input->cmds[k]->u.next, struct CParseEntry *, ++console->input->cmds[k]->next_count); + console->input->cmds[k]->u.next[console->input->cmds[k]->next_count - 1] = cmd; break; } } @@ -256,23 +260,23 @@ void console_parse_create(char *name, CParseFunc func) { safestrncpy(sublist, name, CP_CMD_LENGTH * 5); tok = strtok(sublist,":"); - for ( i = 0; i < console->cmd_list_count; i++ ) { - if( strcmpi(tok,console->cmd_list[i]->cmd) == 0 ) + for ( i = 0; i < console->input->cmd_list_count; i++ ) { + if( strcmpi(tok,console->input->cmd_list[i]->cmd) == 0 ) break; } - if( i == console->cmd_list_count ) { - RECREATE(console->cmds,struct CParseEntry *, ++console->cmd_count); + if( i == console->input->cmd_list_count ) { + RECREATE(console->input->cmds,struct CParseEntry *, ++console->input->cmd_count); CREATE(cmd, struct CParseEntry, 1); safestrncpy(cmd->cmd, tok, CP_CMD_LENGTH); cmd->next_count = 0; - console->cmds[console->cmd_count - 1] = cmd; - RECREATE(console->cmd_list,struct CParseEntry *, ++console->cmd_list_count); - console->cmd_list[console->cmd_list_count - 1] = cmd; - i = console->cmd_list_count - 1; + console->input->cmds[console->input->cmd_count - 1] = cmd; + RECREATE(console->input->cmd_list,struct CParseEntry *, ++console->input->cmd_list_count); + console->input->cmd_list[console->input->cmd_list_count - 1] = cmd; + i = console->input->cmd_list_count - 1; } - cmd = console->cmd_list[i]; + cmd = console->input->cmd_list[i]; while( ( tok = strtok(NULL, ":") ) != NULL ) { for(i = 0; i < cmd->next_count; i++) { @@ -281,13 +285,13 @@ void console_parse_create(char *name, CParseFunc func) { } if ( i == cmd->next_count ) { - RECREATE(console->cmds,struct CParseEntry *, ++console->cmd_count); - CREATE(console->cmds[console->cmd_count-1], struct CParseEntry, 1); - safestrncpy(console->cmds[console->cmd_count-1]->cmd, tok, CP_CMD_LENGTH); - console->cmds[console->cmd_count-1]->next_count = 0; + RECREATE(console->input->cmds,struct CParseEntry *, ++console->input->cmd_count); + CREATE(console->input->cmds[console->input->cmd_count-1], struct CParseEntry, 1); + safestrncpy(console->input->cmds[console->input->cmd_count-1]->cmd, tok, CP_CMD_LENGTH); + console->input->cmds[console->input->cmd_count-1]->next_count = 0; RECREATE(cmd->u.next, struct CParseEntry *, ++cmd->next_count); - cmd->u.next[cmd->next_count - 1] = console->cmds[console->cmd_count-1]; - cmd = console->cmds[console->cmd_count-1]; + cmd->u.next[cmd->next_count - 1] = console->input->cmds[console->input->cmd_count-1]; + cmd = console->input->cmds[console->input->cmd_count-1]; continue; } @@ -302,7 +306,7 @@ void console_parse_list_subs(struct CParseEntry *cmd, unsigned char depth) { memset(msg, '-', depth); snprintf(msg + depth,CP_CMD_LENGTH * 2, " '"CL_WHITE"%s"CL_RESET"'",cmd->u.next[i]->cmd); ShowInfo("%s subs\n",msg); - console->parse_list_subs(cmd->u.next[i],depth + 1); + console->input->parse_list_subs(cmd->u.next[i],depth + 1); } else { memset(msg, '-', depth); snprintf(msg + depth,CP_CMD_LENGTH * 2, " %s",cmd->u.next[i]->cmd); @@ -320,21 +324,21 @@ void console_parse_sub(char *line) { memcpy(bline, line, 200); tok = strtok(line, " "); - for ( i = 0; i < console->cmd_list_count; i++ ) { - if( strcmpi(tok,console->cmd_list[i]->cmd) == 0 ) + for ( i = 0; i < console->input->cmd_list_count; i++ ) { + if( strcmpi(tok,console->input->cmd_list[i]->cmd) == 0 ) break; } - if( i == console->cmd_list_count ) { + if( i == console->input->cmd_list_count ) { ShowError("'"CL_WHITE"%s"CL_RESET"' is not a known command, type '"CL_WHITE"help"CL_RESET"' to list all commands\n",line); return; } - cmd = console->cmd_list[i]; + cmd = console->input->cmd_list[i]; len += snprintf(sublist,CP_CMD_LENGTH * 5,"%s", cmd->cmd) + 1; - if( cmd->next_count == 0 && console->cmd_list[i]->u.func ) { + if( cmd->next_count == 0 && console->input->cmd_list[i]->u.func ) { char *r = NULL; if( (tok = strtok(NULL, " ")) ) { r = bline; @@ -351,7 +355,7 @@ void console_parse_sub(char *line) { if( strcmpi("help",tok) == 0 ) { if( cmd->next_count ) { ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",sublist); - console->parse_list_subs(cmd,2); + console->input->parse_list_subs(cmd,2); } else { ShowError("'"CL_WHITE"%s"CL_RESET"' doesn't possess any subcommands\n",sublist); } @@ -392,95 +396,95 @@ void console_parse(char* line) { } void *cThread_main(void *x) { - while( console->ptstate ) {/* loopx */ - if( console->key_pressed() ) { + while( console->input->ptstate ) {/* loopx */ + if( console->input->key_pressed() ) { char input[MAX_CONSOLE_INPUT]; - console->parse(input); + console->input->parse(input); if( input[0] != '\0' ) {/* did we get something? */ - EnterSpinLock(&console->ptlock); + EnterSpinLock(&console->input->ptlock); if( cinput.count == CONSOLE_PARSE_SIZE ) { - LeaveSpinLock(&console->ptlock); + LeaveSpinLock(&console->input->ptlock); continue;/* drop */ } safestrncpy(cinput.queue[cinput.count++],input,MAX_CONSOLE_INPUT); - LeaveSpinLock(&console->ptlock); + LeaveSpinLock(&console->input->ptlock); } } - ramutex_lock( console->ptmutex ); - racond_wait( console->ptcond, console->ptmutex, -1 ); - ramutex_unlock( console->ptmutex ); + ramutex_lock( console->input->ptmutex ); + racond_wait( console->input->ptcond, console->input->ptmutex, -1 ); + ramutex_unlock( console->input->ptmutex ); } return NULL; } int console_parse_timer(int tid, int64 tick, int id, intptr_t data) { int i; - EnterSpinLock(&console->ptlock); + EnterSpinLock(&console->input->ptlock); for(i = 0; i < cinput.count; i++) { - console->parse_sub(cinput.queue[i]); + console->input->parse_sub(cinput.queue[i]); } cinput.count = 0; - LeaveSpinLock(&console->ptlock); - racond_signal(console->ptcond); + LeaveSpinLock(&console->input->ptlock); + racond_signal(console->input->ptcond); return 0; } void console_parse_final(void) { - if( console->ptstate ) { - InterlockedDecrement(&console->ptstate); - racond_signal(console->ptcond); + if( console->input->ptstate ) { + InterlockedDecrement(&console->input->ptstate); + racond_signal(console->input->ptcond); /* wait for thread to close */ - rathread_wait(console->pthread, NULL); + rathread_wait(console->input->pthread, NULL); - racond_destroy(console->ptcond); - ramutex_destroy(console->ptmutex); + racond_destroy(console->input->ptcond); + ramutex_destroy(console->input->ptmutex); } } void console_parse_init(void) { cinput.count = 0; - console->ptstate = 1; + console->input->ptstate = 1; - InitializeSpinLock(&console->ptlock); + InitializeSpinLock(&console->input->ptlock); - console->ptmutex = ramutex_create(); - console->ptcond = racond_create(); + console->input->ptmutex = ramutex_create(); + console->input->ptcond = racond_create(); - if( (console->pthread = rathread_create(console->pthread_main, NULL)) == NULL ){ + if( (console->input->pthread = rathread_create(console->input->pthread_main, NULL)) == NULL ){ ShowFatalError("console_parse_init: failed to spawn console_parse thread.\n"); exit(EXIT_FAILURE); } - timer->add_func_list(console->parse_timer, "console_parse_timer"); - timer->add_interval(timer->gettick() + 1000, console->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ + timer->add_func_list(console->input->parse_timer, "console_parse_timer"); + timer->add_interval(timer->gettick() + 1000, console->input->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ } void console_setSQL(Sql *SQL_handle) { - console->SQL = SQL_handle; + console->input->SQL = SQL_handle; } #endif /* CONSOLE_INPUT */ void console_init (void) { #ifdef CONSOLE_INPUT - console->cmd_count = console->cmd_list_count = 0; - console->load_defaults(); - console->parse_init(); + console->input->cmd_count = console->input->cmd_list_count = 0; + console->input->load_defaults(); + console->input->parse_init(); #endif } void console_final(void) { #ifdef CONSOLE_INPUT unsigned int i; - console->parse_final(); - for( i = 0; i < console->cmd_count; i++ ) { - if( console->cmds[i]->next_count ) - aFree(console->cmds[i]->u.next); - aFree(console->cmds[i]); + console->input->parse_final(); + for( i = 0; i < console->input->cmd_count; i++ ) { + if( console->input->cmds[i]->next_count ) + aFree(console->input->cmds[i]->u.next); + aFree(console->input->cmds[i]); } - aFree(console->cmds); - aFree(console->cmd_list); + aFree(console->input->cmds); + aFree(console->input->cmd_list); #endif } void console_defaults(void) { @@ -489,17 +493,20 @@ void console_defaults(void) { console->final = console_final; console->display_title = display_title; #ifdef CONSOLE_INPUT - console->parse_init = console_parse_init; - console->parse_final = console_parse_final; - console->parse_timer = console_parse_timer; - console->pthread_main = cThread_main; - console->parse = console_parse; - console->parse_sub = console_parse_sub; - console->key_pressed = console_parse_key_pressed; - console->load_defaults = console_load_defaults; - console->parse_list_subs = console_parse_list_subs; - console->addCommand = console_parse_create; - console->setSQL = console_setSQL; - console->SQL = NULL; + console->input = &console_input_s; + console->input->parse_init = console_parse_init; + console->input->parse_final = console_parse_final; + console->input->parse_timer = console_parse_timer; + console->input->pthread_main = cThread_main; + console->input->parse = console_parse; + console->input->parse_sub = console_parse_sub; + console->input->key_pressed = console_parse_key_pressed; + console->input->load_defaults = console_load_defaults; + console->input->parse_list_subs = console_parse_list_subs; + console->input->addCommand = console_parse_create; + console->input->setSQL = console_setSQL; + console->input->SQL = NULL; +#else + console->input = NULL; #endif } diff --git a/src/common/console.h b/src/common/console.h index 3d19ddc9d..d2c58f978 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -4,11 +4,13 @@ #ifndef _COMMON_CONSOLE_H_ #define _COMMON_CONSOLE_H_ -#include "../common/thread.h" +#include "../config/core.h" // MAX_CONSOLE_INPUT + +#include "../common/cbasetypes.h" #include "../common/mutex.h" #include "../common/spinlock.h" #include "../common/sql.h" -#include "../config/core.h" +#include "../common/thread.h" /** * Queue Max @@ -47,11 +49,8 @@ struct { unsigned short count; } cinput; -struct console_interface { - void (*init) (void); - void (*final) (void); - void (*display_title) (void); #ifdef CONSOLE_INPUT +struct console_input_interface { /* vars */ SPIN_LOCK ptlock;/* parse thread lock */ rAthread pthread;/* parse thread */ @@ -77,7 +76,17 @@ struct console_interface { void (*parse_list_subs) (struct CParseEntry *cmd, unsigned char depth); void (*addCommand) (char *name, CParseFunc func); void (*setSQL) (Sql *SQL_handle); +}; +#else +struct console_input_interface; #endif + +struct console_interface { + void (*init) (void); + void (*final) (void); + void (*display_title) (void); + + struct console_input_interface *input; }; struct console_interface *console; diff --git a/src/common/core.c b/src/common/core.c index 49b272488..85f824866 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -2,36 +2,40 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/strlib.h" +#define HERCULES_CORE + +#include "../config/core.h" #include "core.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" #ifndef MINICORE - #include "../common/db.h" - #include "../common/socket.h" - #include "../common/timer.h" - #include "../common/thread.h" - #include "../common/sql.h" - #include "../config/core.h" - #include "../common/HPM.h" - #include "../common/utils.h" - #include "../common/conf.h" - #include "../common/ers.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 +#include #include #include -#include #include #ifndef _WIN32 -#include +# include #else -#include "../common/winapi.h" // Console close event handling +# include "../common/winapi.h" // Console close event handling #endif /// Called when a terminate signal is received. diff --git a/src/common/core.h b/src/common/core.h index e9f7c5961..ba75e6b01 100644 --- a/src/common/core.h +++ b/src/common/core.h @@ -7,11 +7,10 @@ #include "../common/db.h" #include "../common/mmo.h" -#include "../config/core.h" /* so that developers with --enable-debug can raise signals from any section of the code they'd like */ #ifdef DEBUG - #include +# include #endif extern int arg_c; diff --git a/src/common/db.c b/src/common/db.c index 8d6b08815..1781aa96f 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -67,14 +67,18 @@ * @encoding US-ASCII * @see #db.h \*****************************************************************************/ + +#define HERCULES_CORE + +#include "db.h" + #include #include -#include "db.h" -#include "../common/mmo.h" +#include "../common/ers.h" #include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" -#include "../common/ers.h" #include "../common/strlib.h" /*****************************************************************************\ diff --git a/src/common/db.h b/src/common/db.h index 67abe6f19..0d2548806 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -42,9 +42,10 @@ #ifndef _COMMON_DB_H_ #define _COMMON_DB_H_ -#include "../common/cbasetypes.h" #include +#include "../common/cbasetypes.h" + /*****************************************************************************\ * (1) Section with public typedefs, enums, unions, structures and defines. * * DBRelease - Enumeration of release options. * diff --git a/src/common/des.c b/src/common/des.c index ed6d098dc..7f952be76 100644 --- a/src/common/des.c +++ b/src/common/des.c @@ -1,8 +1,11 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include "../common/cbasetypes.h" -#include "../common/des.h" +#define HERCULES_CORE + +#include "des.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/ers.c b/src/common/ers.c index 5a3d7314a..d9895e4f2 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -39,14 +39,18 @@ * @encoding US-ASCII * * @see common#ers.h * \*****************************************************************************/ + +#define HERCULES_CORE + +#include "ers.h" + #include #include #include "../common/cbasetypes.h" #include "../common/malloc.h" // CREATE, RECREATE, aMalloc, aFree -#include "../common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL #include "../common/nullpo.h" -#include "ers.h" +#include "../common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL #ifndef DISABLE_ERS diff --git a/src/common/grfio.c b/src/common/grfio.c index bde0ed720..1111fb3f3 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -2,13 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/des.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/nullpo.h" +#define HERCULES_CORE + #include "grfio.h" #include @@ -17,6 +12,14 @@ #include #include +#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 5b39cbab6..13cf0b5ce 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/malloc.h" -#include "../common/core.h" -#include "../common/showmsg.h" -#include "../common/sysinfo.h" +#define HERCULES_CORE + +#include "malloc.h" #include #include #include #include +#include "../common/core.h" +#include "../common/showmsg.h" +#include "../common/sysinfo.h" + struct malloc_interface iMalloc_s; ////////////// Memory Libraries ////////////////// diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 3128a3cb0..5c69c7063 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/db.h" +#define HERCULES_CORE + #include "mapindex.h" -#include #include #include +#include + +#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/md5calc.c b/src/common/md5calc.c index 05fde42cc..e7b506e27 100644 --- a/src/common/md5calc.c +++ b/src/common/md5calc.c @@ -6,11 +6,15 @@ * ***********************************************************/ -#include "../common/random.h" +#define HERCULES_CORE + #include "md5calc.h" -#include + #include #include +#include + +#include "../common/random.h" #ifndef UINT_MAX #define UINT_MAX 4294967295U diff --git a/src/common/mmo.h b/src/common/mmo.h index d535d2874..1d826463e 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -5,10 +5,11 @@ #ifndef _COMMON_MMO_H_ #define _COMMON_MMO_H_ -#include "cbasetypes.h" -#include "../common/db.h" #include +#include "../common/cbasetypes.h" +#include "../common/db.h" + // server->client protocol version // 0 - pre-? // 1 - ? - 0x196 @@ -96,6 +97,7 @@ //Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default ) #define MAX_BANK_ZENY 2100000000 +#define MAX_LEVEL 175 #define MAX_FAME 1000000000 #define MAX_CART 100 #define MAX_SKILL 1478 diff --git a/src/common/mutex.c b/src/common/mutex.c index 0668dbc41..12524c3b7 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -1,6 +1,10 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "mutex.h" + #ifdef WIN32 #include "../common/winapi.h" #else @@ -13,7 +17,6 @@ #include "../common/malloc.h" #include "../common/showmsg.h" #include "../common/timer.h" -#include "../common/mutex.h" struct ramutex{ #ifdef WIN32 diff --git a/src/common/mutex.h b/src/common/mutex.h index eeb24e6ff..3b83b66d6 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -4,6 +4,7 @@ #ifndef _COMMON_MUTEX_H_ #define _COMMON_MUTEX_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 1cb471aff..1891835f1 100644 --- a/src/common/nullpo.c +++ b/src/common/nullpo.c @@ -2,10 +2,14 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "nullpo.h" + #include #include #include -#include "../common/nullpo.h" + #include "../common/showmsg.h" /** diff --git a/src/common/random.c b/src/common/random.c index e46c52cad..7019a31f3 100644 --- a/src/common/random.c +++ b/src/common/random.c @@ -1,17 +1,23 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "random.h" + +#include // time + +#include // init_genrand, genrand_int32, genrand_res53 + #include "../common/showmsg.h" #include "../common/timer.h" // gettick -#include "random.h" + #if defined(WIN32) - #include "../common/winapi.h" +# include "../common/winapi.h" #elif defined(HAVE_GETPID) || defined(HAVE_GETTID) - #include - #include +# include +# include #endif -#include // time -#include // init_genrand, genrand_int32, genrand_res53 /// Initializes the random number generator with an appropriate seed. diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 14342fe5e..1dbcba282 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -2,23 +2,26 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/strlib.h" // StringBuf +#define HERCULES_CORE + #include "showmsg.h" -#include "core.h" //[Ind] - For SERVER_TYPE +#include #include +#include // atexit #include -#include #include -#include // atexit #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 +# include #endif // WIN32 #if defined(DEBUGLOGMAP) diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 49fbc34fb..5b32f39ae 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -5,12 +5,14 @@ #ifndef _COMMON_SHOWMSG_H_ #define _COMMON_SHOWMSG_H_ -#ifndef _COMMON_HPMI_H_ - #include "../../3rdparty/libconfig/libconfig.h" -#endif - #include +#ifdef HERCULES_CORE +# include "../../3rdparty/libconfig/libconfig.h" +#else +# include "../common/HPMi.h" +#endif + // for help with the console colors look here: // http://www.edoceo.com/liberum/?doc=printf-with-color // some code explanation (used here): @@ -90,7 +92,7 @@ enum msg_type { }; extern void ClearScreen(void); -#ifndef _COMMON_HPMI_H_ +#ifdef HERCULES_CORE extern void ShowMessage(const char *, ...); extern void ShowStatus(const char *, ...); extern void ShowSQL(const char *, ...); @@ -101,7 +103,18 @@ extern void ClearScreen(void); extern void ShowError(const char *, ...); extern void ShowFatalError(const char *, ...); extern void ShowConfigWarning(config_setting_t *config, const char *string, ...); +#else + HPExport void (*ShowMessage) (const char *, ...); + HPExport void (*ShowStatus) (const char *, ...); + HPExport void (*ShowSQL) (const char *, ...); + HPExport void (*ShowInfo) (const char *, ...); + HPExport void (*ShowNotice) (const char *, ...); + HPExport void (*ShowWarning) (const char *, ...); + HPExport void (*ShowDebug) (const char *, ...); + HPExport void (*ShowError) (const char *, ...); + HPExport void (*ShowFatalError) (const char *, ...); #endif + extern int _vShowMessage(enum msg_type flag, const char *string, va_list ap); #endif /* _COMMON_SHOWMSG_H_ */ diff --git a/src/common/socket.c b/src/common/socket.c index 35d350e95..3738f2c2a 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -2,48 +2,50 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../config/core.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // SHOW_SERVER_STATS #define _H_SOCKET_C_ - #include "socket.h" +#undef _H_SOCKET_C_ #include #include #include #include +#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 - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #ifndef SIOCGIFCONF - #include // SIOCGIFCONF on Solaris, maybe others? [Shinomori] - #endif - #ifndef FIONBIO - #include // FIONBIO on Solaris [FlavioJS] - #endif - - #ifdef HAVE_SETRLIMIT - #include - #endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef SIOCGIFCONF +# include // SIOCGIFCONF on Solaris, maybe others? [Shinomori] +# endif +# ifndef FIONBIO +# include // FIONBIO on Solaris [FlavioJS] +# endif + +# ifdef HAVE_SETRLIMIT +# include +# endif #endif /** diff --git a/src/common/socket.h b/src/common/socket.h index 75adde4cf..804b9284f 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -5,19 +5,19 @@ #ifndef _COMMON_SOCKET_H_ #define _COMMON_SOCKET_H_ +#include + #include "../common/cbasetypes.h" #ifdef WIN32 - #include "../common/winapi.h" +# include "../common/winapi.h" typedef long in_addr_t; #else - #include - #include - #include +# include +# include +# include #endif -#include - struct HPluginData; #define FIFOSIZE_SERVERLINK 256*1024 diff --git a/src/common/spinlock.h b/src/common/spinlock.h index 29fbb355b..0058e1d83 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -1,4 +1,3 @@ -#pragma once #ifndef _COMMON_SPINLOCK_H_ #define _COMMON_SPINLOCK_H_ @@ -15,14 +14,14 @@ // // +#include "../common/atomic.h" +#include "../common/cbasetypes.h" +#include "../common/thread.h" + #ifdef WIN32 #include "../common/winapi.h" #endif -#include "../common/cbasetypes.h" -#include "../common/atomic.h" -#include "../common/thread.h" - #ifdef WIN32 typedef struct __declspec( align(64) ) SPIN_LOCK{ diff --git a/src/common/sql.c b/src/common/sql.c index 79ccc8e92..aeb56bff0 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -2,19 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "sql.h" + +#include // strtoul +#include // 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 "sql.h" #ifdef WIN32 -#include "../common/winapi.h" +# include "../common/winapi.h" // Needed before mysql.h #endif #include -#include // strlen/strnlen/memcpy/memset -#include // strtoul void hercules_mysql_error_handler(unsigned int ecode); diff --git a/src/common/sql.h b/src/common/sql.h index 1fb436853..807e0843c 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -5,10 +5,9 @@ #ifndef _COMMON_SQL_H_ #define _COMMON_SQL_H_ -#include "../common/cbasetypes.h" #include // va_list - +#include "../common/cbasetypes.h" // Return codes #define SQL_ERROR (-1) diff --git a/src/common/strlib.c b/src/common/strlib.c index 361595b07..e2e802915 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#define STRLIB_C +#define HERCULES_CORE + +#define _H_STRLIB_C_ #include "strlib.h" +#undef _H_STRLIB_C_ +#include #include #include -#include +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" #define J_MAX_MALLOC_SIZE 65535 diff --git a/src/common/strlib.h b/src/common/strlib.h index 10844d257..decf661a6 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -5,15 +5,16 @@ #ifndef _COMMON_STRLIB_H_ #define _COMMON_STRLIB_H_ -#include "../common/cbasetypes.h" #include +#include "../common/cbasetypes.h" + #ifndef __USE_GNU - #define __USE_GNU // required to enable strnlen on some platforms - #include - #undef __USE_GNU +# define __USE_GNU // required to enable strnlen on some platforms +# include +# undef __USE_GNU #else - #include +# include #endif #ifdef WIN32 @@ -165,7 +166,7 @@ struct sv_interface *sv; void strlib_defaults(void); /* the purpose of these macros is simply to not make calling them be an annoyance */ -#ifndef STRLIB_C +#ifndef _H_STRLIB_C_ #define jstrescape(pt) (strlib->jstrescape(pt)) #define jstrescapecpy(pt,spt) (strlib->jstrescapecpy((pt),(spt))) #define jmemescapecpy(pt,spt,size) (strlib->jmemescapecpy((pt),(spt),(size))) @@ -189,6 +190,6 @@ void strlib_defaults(void); #define safesnprintf(buf,sz,fmt,...) (strlib->safesnprintf((buf),(sz),(fmt),##__VA_ARGS__)) #define strline(str,pos) (strlib->strline((str),(pos))) #define bin2hex(output,input,count) (strlib->bin2hex((output),(input),(count))) -#endif /* STRLIB_C */ +#endif /* _H_STRLIB_C_ */ #endif /* _COMMON_STRLIB_H_ */ diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index a56896458..3fdfadb41 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -4,23 +4,39 @@ /// See sysinfo.h for a description of this file -#define _COMMON_SYSINFO_P_ +#define HERCULES_CORE + #include "sysinfo.h" -#undef _COMMON_SYSINFO_P_ + +#include // fopen +#include // atoi #include "../common/cbasetypes.h" #include "../common/core.h" -#include "../common/strlib.h" #include "../common/malloc.h" +#include "../common/strlib.h" #ifdef WIN32 -#include -#include // strlen +# include // strlen +# include #else -#include +# include #endif -#include // fopen -#include // atoi + +/// Private interface fields +struct sysinfo_private { + char *platform; + char *osversion; + char *cpu; + int cpucores; + char *arch; + char *compiler; + char *cflags; + char *vcstype_name; + int vcstype; + char *vcsrevision_src; + char *vcsrevision_scripts; +}; /// sysinfo.c interface source struct sysinfo_interface sysinfo_s; diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index 17faac26b..c0c4d276a 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -13,23 +13,7 @@ #include "../common/cbasetypes.h" -#ifdef _COMMON_SYSINFO_P_ -struct sysinfo_private { - char *platform; - char *osversion; - char *cpu; - int cpucores; - char *arch; - char *compiler; - char *cflags; - char *vcstype_name; - int vcstype; - char *vcsrevision_src; - char *vcsrevision_scripts; -}; -#else struct sysinfo_private; -#endif /** * sysinfo.c interface diff --git a/src/common/thread.c b/src/common/thread.c index 4d110f2dd..4f73aa9b3 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -6,24 +6,27 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "thread.h" + +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" + #ifdef WIN32 -#include "../common/winapi.h" -#define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) -#define __thread __declspec( thread ) +# include "../common/winapi.h" +# define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) +# define __thread __declspec( thread ) #else -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include #endif -#include "cbasetypes.h" -#include "malloc.h" -#include "showmsg.h" -#include "thread.h" - // 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 d6b2bbc6e..887c03179 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -1,7 +1,6 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#pragma once #ifndef _COMMON_THREAD_H_ #define _COMMON_THREAD_H_ diff --git a/src/common/timer.c b/src/common/timer.c index 526854582..10f14b0f2 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -2,11 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/utils.h" +#define HERCULES_CORE + #include "timer.h" #include @@ -14,11 +11,17 @@ #include #include +#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 -#include // struct timeval, gettimeofday() +# include // struct timeval, gettimeofday() +# include #endif struct timer_interface timer_s; diff --git a/src/common/utils.c b/src/common/utils.c index 47747dd32..84925f707 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -2,33 +2,35 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/core.h" -#include "socket.h" +#define HERCULES_CORE + #include "utils.h" -#include +#include // floor() #include +#include #include #include -#include // floor() +#include // 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" #ifdef WIN32 - #include "../common/winapi.h" - #ifndef F_OK - #define F_OK 0x0 - #endif /* F_OK */ +# include "../common/winapi.h" +# ifndef F_OK +# define F_OK 0x0 +# endif /* F_OK */ #else - #include - #include - #include +# include +# include +# include #endif -#include // 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 f89546b8a..823651163 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -5,10 +5,11 @@ #ifndef _COMMON_UTILS_H_ #define _COMMON_UTILS_H_ -#include "../common/cbasetypes.h" #include // FILE* #include +#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/config/const.h b/src/config/const.h index 6557cb987..f9baa4d7d 100644 --- a/src/config/const.h +++ b/src/config/const.h @@ -52,13 +52,6 @@ #define DEFTYPE_MAX CHAR_MAX #endif -/* pointer size fix which fixes several gcc warnings */ -#ifdef __64BIT__ - #define __64BPTRSIZE(y) ((intptr)(y)) -#else - #define __64BPTRSIZE(y) (y) -#endif - /* ATCMD_FUNC(mobinfo) HIT and FLEE calculations */ #ifdef RENEWAL #define MOB_FLEE(mobdata) ( (mobdata)->lv + (mobdata)->status.agi + 100 ) diff --git a/src/config/renewal.h b/src/config/renewal.h index 36615d63b..36bdd3958 100644 --- a/src/config/renewal.h +++ b/src/config/renewal.h @@ -74,5 +74,6 @@ #define RENEWAL_ASPD #endif // DISABLE_RENEWAL +#undef DISABLE_RENEWAL #endif // _CONFIG_RENEWAL_H_ diff --git a/src/login/account.h b/src/login/account.h index 234e7c0c1..329ae31c8 100644 --- a/src/login/account.h +++ b/src/login/account.h @@ -7,6 +7,7 @@ #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 1483196ab..2e4ed7ab9 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -2,17 +2,22 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT +#include "account.h" + +#include +#include + +#include "../common/console.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/timer.h" -#include "../common/console.h" -#include "../common/socket.h" -#include "account.h" -#include -#include /// global defines #define ACCOUNT_SQL_DB_VERSION 20110114 @@ -652,7 +657,7 @@ Sql* account_db_sql_up(AccountDB* self) { AccountDB_SQL* db = (AccountDB_SQL*)self; Sql_HerculesUpdateCheck(db->accounts); #ifdef CONSOLE_INPUT - console->setSQL(db->accounts); + console->input->setSQL(db->accounts); #endif return db->accounts; } diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c index 74f45e418..081f28d84 100644 --- a/src/login/ipban_sql.c +++ b/src/login/ipban_sql.c @@ -2,6 +2,15 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "ipban.h" + +#include +#include + +#include "login.h" +#include "loginlog.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/malloc.h" @@ -9,11 +18,6 @@ #include "../common/socket.h" #include "../common/strlib.h" #include "../common/timer.h" -#include "login.h" -#include "ipban.h" -#include "loginlog.h" -#include -#include // global sql settings static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/login/login.c b/src/login/login.c index af59fcf38..cb46e0226 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -2,6 +2,18 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "login.h" + +#include +#include +#include + +#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" @@ -12,15 +24,6 @@ #include "../common/strlib.h" #include "../common/timer.h" #include "../common/utils.h" -#include "../common/HPM.h" -#include "account.h" -#include "ipban.h" -#include "login.h" -#include "loginlog.h" - -#include -#include -#include struct Login_Config login_config; diff --git a/src/login/login.h b/src/login/login.h index 14c361a15..e77b96a0e 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/mmo.h" // NAME_LENGTH,SEX_* #include "../common/core.h" // CORE_ST_LAST +#include "../common/mmo.h" // NAME_LENGTH,SEX_* enum E_LOGINSERVER_ST { diff --git a/src/login/loginlog.h b/src/login/loginlog.h index 730fb6e62..a86ad431c 100644 --- a/src/login/loginlog.h +++ b/src/login/loginlog.h @@ -4,6 +4,7 @@ #ifndef _LOGIN_LOGINLOG_H_ #define _LOGIN_LOGINLOG_H_ +#include "../common/cbasetypes.h" unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes); void login_log(uint32 ip, const char* username, int rcode, const char* message); @@ -11,5 +12,4 @@ bool loginlog_init(void); bool loginlog_final(void); bool loginlog_config_read(const char* w1, const char* w2); - #endif /* _LOGIN_LOGINLOG_H_ */ diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 231ac783b..2cbc02c93 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -2,13 +2,18 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "loginlog.h" + +#include +#include // exit + #include "../common/cbasetypes.h" #include "../common/mmo.h" #include "../common/socket.h" #include "../common/sql.h" #include "../common/strlib.h" -#include -#include // exit // global sql settings (in ipban_sql.c) static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c index 061479d87..cb8c979c6 100644 --- a/src/map/HPMmap.c +++ b/src/map/HPMmap.c @@ -1,25 +1,15 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/HPM.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" - +#define HERCULES_CORE #include "HPMmap.h" -#include "pc.h" -#include "map.h" -// +#include +#include +#include +#include + #include "atcommand.h" #include "battle.h" #include "battleground.h" @@ -37,12 +27,14 @@ #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" @@ -54,11 +46,19 @@ #include "trade.h" #include "unit.h" #include "vending.h" - -#include -#include -#include -#include +#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" diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 5fd0faf86..df3be40a5 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2,57 +2,60 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/core.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/conf.h" -#include "../common/sysinfo.h" +#define HERCULES_CORE +#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_CARTS, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP #include "atcommand.h" + +#include +#include +#include +#include + #include "battle.h" #include "chat.h" -#include "clif.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 "pc.h" -#include "pc_groups.h" // groupid2name -#include "status.h" -#include "skill.h" +#include "mapreg.h" +#include "mercenary.h" #include "mob.h" #include "npc.h" -#include "pet.h" -#include "homunculus.h" -#include "mail.h" -#include "mercenary.h" -#include "elemental.h" #include "party.h" -#include "guild.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 "mapreg.h" -#include "quest.h" -#include "searchstore.h" +#include "../common/cbasetypes.h" +#include "../common/conf.h" +#include "../common/core.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/sysinfo.h" +#include "../common/timer.h" +#include "../common/utils.h" #include "HPMmap.h" -#include -#include -#include -#include - 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 bc4ab30a3..c8a1863af 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 "pc_groups.h" /** * Declarations diff --git a/src/map/battle.c b/src/map/battle.c index 9089b7102..0865ee4ba 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2,41 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/ers.h" -#include "../common/random.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/sysinfo.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "map.h" -#include "path.h" -#include "pc.h" -#include "status.h" -#include "skill.h" -#include "homunculus.h" -#include "mercenary.h" -#include "elemental.h" -#include "mob.h" -#include "itemdb.h" -#include "clif.h" -#include "pet.h" -#include "guild.h" -#include "party.h" +#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 "battleground.h" -#include "chrif.h" +#include #include #include #include -#include + +#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 88038ddb4..fbe097c78 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -5,8 +5,8 @@ #ifndef _MAP_BATTLE_H_ #define _MAP_BATTLE_H_ -#include "../common/cbasetypes.h" #include "map.h" //ELE_MAX +#include "../common/cbasetypes.h" /** * Declarations diff --git a/src/map/battleground.c b/src/map/battleground.c index 68539e25d..a7169de0e 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -2,29 +2,32 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/conf.h" +#define HERCULES_CORE #include "battleground.h" + +#include +#include + #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 "pc.h" #include "party.h" +#include "pc.h" #include "pet.h" -#include "homunculus.h" -#include "mercenary.h" -#include "mapreg.h" - -#include -#include +#include "../common/cbasetypes.h" +#include "../common/conf.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; diff --git a/src/map/battleground.h b/src/map/battleground.h index 05c4eb060..ec0a86f14 100644 --- a/src/map/battleground.h +++ b/src/map/battleground.h @@ -5,9 +5,9 @@ #ifndef _MAP_BATTLEGROUND_H_ #define _MAP_BATTLEGROUND_H_ -#include "../common/mmo.h" // struct party #include "clif.h" #include "guild.h" +#include "../common/mmo.h" // struct party /** * Defines diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 2a15e66fc..80264b30d 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -2,18 +2,21 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 +#define HERCULES_CORE + +#include "buyingstore.h" // struct s_buyingstore + #include "atcommand.h" // msg_txt #include "battle.h" // battle_config.* -#include "buyingstore.h" // struct s_buyingstore +#include "chrif.h" #include "clif.h" // clif->buyingstore_* #include "log.h" // log_pick_pc, log_zeny #include "pc.h" // struct map_session_data -#include "chrif.h" +#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 5141a1013..914631872 100644 --- a/src/map/buyingstore.h +++ b/src/map/buyingstore.h @@ -5,6 +5,11 @@ #ifndef _MAP_BUYINGSTORE_H_ #define _MAP_BUYINGSTORE_H_ +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // MAX_SLOTS + +struct map_session_data; + /** * Declarations **/ diff --git a/src/map/chat.c b/src/map/chat.c index 08fc4a575..c9d3e6d46 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -2,12 +2,13 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/mmo.h" +#define HERCULES_CORE + +#include "chat.h" + +#include +#include + #include "atcommand.h" // msg_txt() #include "battle.h" // struct battle_config #include "clif.h" @@ -15,10 +16,12 @@ #include "npc.h" // npc_event_do() #include "pc.h" #include "skill.h" // ext_skill_unit_onplace() -#include "chat.h" - -#include -#include +#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; diff --git a/src/map/chat.h b/src/map/chat.h index b0c6cd905..cbc2a391e 100644 --- a/src/map/chat.h +++ b/src/map/chat.h @@ -6,9 +6,12 @@ #define _MAP_CHAT_H_ #include "map.h" // struct block_list, CHATROOM_TITLE_SIZE +#include "../common/cbasetypes.h" +#include "../common/db.h" -struct map_session_data; struct chat_data; +struct map_session_data; +struct npc_data; #define MAX_CHAT_USERS 20 diff --git a/src/map/chrif.c b/src/map/chrif.c index 99a1935fd..81e2d387c 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -2,15 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/ers.h" -#include "../common/HPM.h" +#define HERCULES_CORE + +#include "../config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT +#include "chrif.h" + +#include +#include +#include +#include +#include #include "map.h" #include "battle.h" @@ -25,15 +26,17 @@ #include "instance.h" #include "mercenary.h" #include "elemental.h" -#include "chrif.h" #include "quest.h" #include "storage.h" - -#include -#include -#include -#include -#include +#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; diff --git a/src/map/chrif.h b/src/map/chrif.h index 25e955604..84efc66d3 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -5,9 +5,11 @@ #ifndef _MAP_CHRIF_H_ #define _MAP_CHRIF_H_ -#include "../common/cbasetypes.h" #include + #include "map.h" //TBL_stuff +#include "../common/cbasetypes.h" +#include "../common/db.h" struct status_change_entry; diff --git a/src/map/clif.c b/src/map/clif.c index 062a437a2..1da6070e8 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2,56 +2,59 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/grfio.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 "../common/ers.h" -#include "../common/conf.h" -#include "../common/HPM.h" +#define HERCULES_CORE + +#include "../config/core.h" // ANTI_MAYAP_CHEAT, NEW_CARTS, RENEWAL, SECURE_NPCTIMEOUT +#include "clif.h" + +#include +#include +#include +#include +#include -#include "map.h" -#include "chrif.h" -#include "pc.h" -#include "status.h" -#include "npc.h" -#include "itemdb.h" -#include "chat.h" -#include "trade.h" -#include "storage.h" -#include "script.h" -#include "skill.h" #include "atcommand.h" -#include "intif.h" #include "battle.h" #include "battleground.h" -#include "mob.h" -#include "party.h" -#include "unit.h" +#include "chat.h" +#include "chrif.h" +#include "elemental.h" #include "guild.h" -#include "vending.h" -#include "pet.h" #include "homunculus.h" #include "instance.h" -#include "mercenary.h" -#include "elemental.h" +#include "intif.h" +#include "irc-bot.h" +#include "itemdb.h" #include "log.h" -#include "clif.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 "irc-bot.h" - -#include -#include -#include -#include -#include +#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/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; diff --git a/src/map/clif.h b/src/map/clif.h index bbe07b718..f54c4afce 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -5,13 +5,13 @@ #ifndef _MAP_CLIF_H_ #define _MAP_CLIF_H_ +#include + +#include "map.h" +#include "packets_struct.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/mmo.h" -#include "../common/socket.h" -#include "../map/map.h" -#include "../map/packets_struct.h" -#include /** * Declarations @@ -20,7 +20,6 @@ struct item; struct item_data; struct storage_data; struct guild_storage; -struct block_list; struct unit_data; struct map_session_data; struct homun_data; diff --git a/src/map/date.c b/src/map/date.c index f38ead858..975a00c50 100644 --- a/src/map/date.c +++ b/src/map/date.c @@ -1,10 +1,14 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include "../common/cbasetypes.h" +#define HERCULES_CORE + #include "date.h" + #include +#include "../common/cbasetypes.h" + int date_get_year(void) { time_t t; diff --git a/src/map/date.h b/src/map/date.h index 46f0d86c3..b3ed59b2f 100644 --- a/src/map/date.h +++ b/src/map/date.h @@ -4,6 +4,8 @@ #ifndef _MAP_DATE_H_ #define _MAP_DATE_H_ +#include "../common/cbasetypes.h" + int date_get_year(void); int date_get_month(void); int date_get_day(void); diff --git a/src/map/duel.c b/src/map/duel.c index af2741f77..a423ef240 100644 --- a/src/map/duel.c +++ b/src/map/duel.c @@ -2,18 +2,20 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" +#define HERCULES_CORE -#include "atcommand.h" // msg_txt -#include "clif.h" #include "duel.h" -#include "pc.h" #include #include #include #include +#include "atcommand.h" // msg_txt +#include "clif.h" +#include "pc.h" +#include "../common/cbasetypes.h" + /*========================================== * Duel organizing functions [LuzZza] *------------------------------------------*/ diff --git a/src/map/duel.h b/src/map/duel.h index 5405d2eee..956aed36d 100644 --- a/src/map/duel.h +++ b/src/map/duel.h @@ -5,6 +5,10 @@ #ifndef _MAP_DUEL_H_ #define _MAP_DUEL_H_ +#include "../common/cbasetypes.h" + +struct map_session_data; + struct duel { int members_count; int invites_count; diff --git a/src/map/elemental.c b/src/map/elemental.c index f335600d6..323df41e1 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -2,42 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/utils.h" -#include "../common/random.h" -#include "../common/strlib.h" +#define HERCULES_CORE -#include "log.h" -#include "clif.h" +#include "elemental.h" + +#include +#include +#include +#include + +#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 "pc.h" -#include "status.h" -#include "skill.h" #include "mob.h" -#include "pet.h" -#include "battle.h" +#include "npc.h" #include "party.h" -#include "guild.h" -#include "atcommand.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "npc.h" +#include "skill.h" +#include "status.h" #include "trade.h" #include "unit.h" -#include "elemental.h" - -#include -#include -#include -#include +#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; diff --git a/src/map/elemental.h b/src/map/elemental.h index 6d04a41a5..aa27aadc9 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -7,6 +7,7 @@ #include "status.h" // struct status_data, struct status_change #include "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 fa5805c8b..69f67238d 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -2,35 +2,38 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/showmsg.h" -#include "../common/ers.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "map.h" +#include "../config/core.h" // GP_BOUND_ITEMS #include "guild.h" -#include "storage.h" -#include "battle.h" -#include "npc.h" -#include "pc.h" -#include "status.h" -#include "mob.h" -#include "intif.h" -#include "clif.h" -#include "skill.h" -#include "log.h" -#include "instance.h" #include #include #include +#include "battle.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 b03bd664d..34e27a56c 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -5,18 +5,10 @@ #ifndef _MAP_GUILD_H_ #define _MAP_GUILD_H_ -//#include "../common/mmo.h" -#include "map.h" // NAME_LENGTH - -/** - * Declarations - **/ -struct guild; -struct guild_member; -struct guild_position; -struct guild_castle; -struct map_session_data; -struct mob_data; +#include "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 ff9f7a5b1..b6a83d1cb 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -2,43 +2,45 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/mmo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE -#include "log.h" -#include "clif.h" +#include "../config/core.h" // DBPATH +#include "homunculus.h" + +#include +#include +#include +#include + +#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 "pc.h" -#include "status.h" -#include "skill.h" #include "mob.h" -#include "pet.h" -#include "battle.h" +#include "npc.h" #include "party.h" -#include "guild.h" -#include "atcommand.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "npc.h" +#include "skill.h" +#include "status.h" #include "trade.h" #include "unit.h" - -#include "homunculus.h" - -#include -#include -#include -#include +#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; diff --git a/src/map/homunculus.h b/src/map/homunculus.h index e6d59e30e..9eef6af5b 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -5,9 +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 "pc.h" +#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 caf622b3d..5789d7dd6 100644 --- a/src/map/instance.c +++ b/src/map/instance.c @@ -2,30 +2,32 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/db.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "clif.h" #include "instance.h" -#include "map.h" -#include "npc.h" -#include "party.h" -#include "pc.h" +#include #include #include #include -#include #include +#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 712a0f141..ae649eda7 100644 --- a/src/map/instance.h +++ b/src/map/instance.h @@ -6,8 +6,11 @@ #define _MAP_INSTANCE_H_ #include "script.h" // struct reg_db +#include "../common/cbasetypes.h" #include "../common/mmo.h" // struct point + struct block_list; +struct map_session_data; #define INSTANCE_NAME_LENGTH (60+1) diff --git a/src/map/intif.c b/src/map/intif.c index 6bd24368a..383150fbc 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1,37 +1,40 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "map.h" +#define HERCULES_CORE + +#include "../config/core.h" // GP_BOUND_ITEMS +#include "intif.h" + +#include +#include +#include +#include +#include +#include + +#include "atcommand.h" #include "battle.h" #include "chrif.h" #include "clif.h" -#include "pc.h" -#include "intif.h" -#include "log.h" -#include "storage.h" -#include "party.h" +#include "elemental.h" #include "guild.h" -#include "pet.h" -#include "atcommand.h" -#include "mercenary.h" #include "homunculus.h" -#include "elemental.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 -#include -#include -#include -#include -#include - +#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; diff --git a/src/map/intif.h b/src/map/intif.h index 290dcfcdc..b6ee727f3 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -5,19 +5,22 @@ #ifndef _MAP_INTIF_H_ #define _MAP_INTIF_H_ +#include "../common/cbasetypes.h" /** * Declarations **/ -struct party_member; +struct auction_data; struct guild_member; struct guild_position; -struct s_pet; +struct guild_storage; +struct mail_message; +struct map_session_data; +struct party_member; +struct s_elemental; struct s_homunculus; struct s_mercenary; -struct s_elemental; -struct mail_message; -struct auction_data; +struct s_pet; /** * Defines diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c index ff28082e7..6f016697f 100644 --- a/src/map/irc-bot.c +++ b/src/map/irc-bot.c @@ -2,23 +2,25 @@ // See the LICENSE file // Base Author: shennetsind @ http://hercules.ws -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/random.h" +#define HERCULES_CORE -#include "map.h" -#include "pc.h" -#include "clif.h" #include "irc-bot.h" #include #include #include +#include "clif.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 c15a5d46a..60f03fca5 100644 --- a/src/map/irc-bot.h +++ b/src/map/irc-bot.h @@ -6,6 +6,8 @@ #ifndef _MAP_IRC_BOT_H_ #define _MAP_IRC_BOT_H_ +#include "../common/cbasetypes.h" + #define IRC_NICK_LENGTH 40 #define IRC_IDENT_LENGTH 40 #define IRC_HOST_LENGTH 63 diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 5eeb90be5..1981f435c 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2,23 +2,28 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/conf.h" +#define HERCULES_CORE + +#include "../config/core.h" // DBPATH, RENEWAL #include "itemdb.h" -#include "map.h" -#include "battle.h" // struct battle_config -#include "script.h" // item script processing -#include "pc.h" // W_MUSICAL, W_WHIP #include #include #include +#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/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 77fb2e2ec..12766b288 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -5,9 +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 "map.h" +#include "../common/sql.h" /** * Declarations diff --git a/src/map/log.c b/src/map/log.c index 19a98f34b..523ef1d65 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -2,22 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/sql.h" // SQL_INNODB -#include "../common/strlib.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "battle.h" -#include "itemdb.h" +#define HERCULES_CORE + #include "log.h" -#include "map.h" -#include "mob.h" -#include "pc.h" #include #include #include +#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" + 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 b2cb92c20..ecfedeac2 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -11,11 +11,10 @@ /** * Declarations **/ -struct block_list; -struct map_session_data; -struct mob_data; struct item; struct item_data; +struct map_session_data; +struct mob_data; /** * Defines diff --git a/src/map/mail.c b/src/map/mail.c index 371aa892f..7ba7d7470 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -2,19 +2,21 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/showmsg.h" +#define HERCULES_CORE #include "mail.h" -#include "atcommand.h" -#include "itemdb.h" -#include "clif.h" -#include "pc.h" -#include "log.h" #include #include +#include "atcommand.h" +#include "clif.h" +#include "itemdb.h" +#include "log.h" +#include "pc.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 8df537ff3..30b032ef4 100644 --- a/src/map/mail.h +++ b/src/map/mail.h @@ -5,7 +5,11 @@ #ifndef _MAP_MAIL_H_ #define _MAP_MAIL_H_ -#include "../common/mmo.h" +#include "../common/cbasetypes.h" + +struct item; +struct mail_message; +struct map_session_data; struct mail_interface { void (*clear) (struct map_session_data *sd); diff --git a/src/map/map.c b/src/map/map.c index 24a07699f..bccb51d7e 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2,62 +2,66 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/core.h" -#include "../common/timer.h" -#include "../common/ers.h" -#include "../common/grfio.h" -#include "../common/malloc.h" -#include "../common/socket.h" // WFIFO*() -#include "../common/showmsg.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/conf.h" -#include "../common/console.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL #include "map.h" -#include "path.h" + +#include +#include +#include +#include +#include + +#include "HPMmap.h" +#include "atcommand.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 "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 "mob.h" -#include "npc.h" // npc_setcells(), npc_unsetcells() -#include "chat.h" -#include "itemdb.h" #include "storage.h" -#include "skill.h" #include "trade.h" -#include "party.h" #include "unit.h" -#include "battle.h" -#include "battleground.h" -#include "quest.h" -#include "script.h" -#include "mapreg.h" -#include "guild.h" -#include "pet.h" -#include "homunculus.h" -#include "instance.h" -#include "mercenary.h" -#include "elemental.h" -#include "atcommand.h" -#include "log.h" -#include "mail.h" -#include "irc-bot.h" -#include "HPMmap.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 -#include -#include -#include -#include #ifndef _WIN32 #include #endif @@ -5480,8 +5484,8 @@ void map_cp_defaults(void) { map->cpsd->bl.y = MAP_DEFAULT_Y; map->cpsd->bl.m = map->mapname2mapid(MAP_DEFAULT); - console->addCommand("gm:info",CPCMD_A(gm_position)); - console->addCommand("gm:use",CPCMD_A(gm_use)); + console->input->addCommand("gm:info",CPCMD_A(gm_position)); + console->input->addCommand("gm:use",CPCMD_A(gm_use)); #endif } /* Hercules Plugin Mananger */ @@ -5837,7 +5841,7 @@ int do_init(int argc, char *argv[]) Sql_HerculesUpdateCheck(map->mysql_handle); #ifdef CONSOLE_INPUT - console->setSQL(map->mysql_handle); + console->input->setSQL(map->mysql_handle); #endif ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map->port); diff --git a/src/map/map.h b/src/map/map.h index 6b2e9d909..8277c7a62 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -5,18 +5,18 @@ #ifndef _MAP_MAP_H_ #define _MAP_MAP_H_ +#include + +#include "atcommand.h" #include "../common/cbasetypes.h" #include "../common/core.h" // CORE_ST_LAST #include "../common/mmo.h" #include "../common/mapindex.h" #include "../common/db.h" -#include "../config/core.h" #include "../common/sql.h" -#include "atcommand.h" -#include +struct mob_data; struct npc_data; -struct item_data; struct hChSysCh; enum E_MAPSERVER_ST { @@ -36,7 +36,6 @@ enum E_MAPSERVER_ST { #define NATURAL_HEAL_INTERVAL 500 #define MIN_FLOORITEM 2 #define MAX_FLOORITEM START_ACCOUNT_NUM -#define MAX_LEVEL 175 #define MAX_IGNORE_LIST 20 // official is 14 #define MAX_VENDING 12 #define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo] diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index 61c25f24e..f026fde00 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -2,6 +2,15 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "mapreg.h" + +#include +#include + +#include "map.h" // map->mysql_handle +#include "script.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/ers.h" @@ -10,11 +19,6 @@ #include "../common/sql.h" #include "../common/strlib.h" #include "../common/timer.h" -#include "map.h" // map->mysql_handle -#include "script.h" -#include "mapreg.h" -#include -#include struct mapreg_interface mapreg_s; diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 495621014..26bc8c188 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -2,42 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/mmo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE -#include "log.h" -#include "clif.h" +#include "mercenary.h" + +#include +#include +#include +#include + +#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 "pc.h" -#include "status.h" -#include "skill.h" #include "mob.h" -#include "pet.h" -#include "battle.h" +#include "npc.h" #include "party.h" -#include "guild.h" -#include "atcommand.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "npc.h" +#include "skill.h" +#include "status.h" #include "trade.h" #include "unit.h" -#include "mercenary.h" - -#include -#include -#include -#include +#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; diff --git a/src/map/mercenary.h b/src/map/mercenary.h index dd9266b2e..b998ac006 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -6,6 +6,7 @@ #include "status.h" // struct status_data, struct status_change #include "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 8f12d4b1b..11ac74621 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2,46 +2,49 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/db.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/ers.h" -#include "../common/random.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/socket.h" +#define HERCULES_CORE -#include "map.h" -#include "path.h" -#include "clif.h" -#include "intif.h" -#include "pc.h" -#include "pet.h" -#include "status.h" +#include "../config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP #include "mob.h" -#include "homunculus.h" -#include "mercenary.h" + +#include +#include +#include +#include +#include + +#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 "skill.h" -#include "battle.h" -#include "party.h" -#include "npc.h" #include "log.h" -#include "script.h" -#include "atcommand.h" -#include "date.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 -#include -#include -#include -#include +#include "script.h" +#include "skill.h" +#include "status.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; diff --git a/src/map/mob.h b/src/map/mob.h index 80175b1db..d07f78c77 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -5,12 +5,11 @@ #ifndef _MAP_MOB_H_ #define _MAP_MOB_H_ -#include "../common/mmo.h" // struct item -#include "guild.h" // struct guardian_data #include "map.h" // struct status_data, struct view_data, struct mob_skill -#include "status.h" // struct status data, struct status_change -#include "unit.h" // unit_stop_walking(), unit_stop_attack() -#include "npc.h" +#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 #define MAX_RANDOMMONSTER 5 diff --git a/src/map/npc.c b/src/map/npc.c index 27759d185..289c42d44 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2,41 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/ers.h" -#include "../common/db.h" -#include "../common/socket.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "map.h" -#include "log.h" +#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 +#include +#include +#include +#include +#include + +#include "battle.h" +#include "chat.h" #include "clif.h" +#include "instance.h" #include "intif.h" -#include "pc.h" -#include "status.h" #include "itemdb.h" -#include "script.h" +#include "log.h" +#include "map.h" #include "mob.h" +#include "pc.h" #include "pet.h" -#include "instance.h" -#include "battle.h" +#include "script.h" #include "skill.h" +#include "status.h" #include "unit.h" -#include "npc.h" -#include "chat.h" - -#include -#include -#include -#include -#include -#include +#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; diff --git a/src/map/npc.h b/src/map/npc.h index d11db0164..a277d4968 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -8,10 +8,10 @@ #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" struct HPluginData; -struct block_list; -struct npc_data; struct view_data; enum npc_parse_options { diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index 9d5639efc..f245ffea5 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -2,25 +2,27 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifdef PCRE_SUPPORT +#define HERCULES_CORE -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" +#ifdef PCRE_SUPPORT -#include "mob.h" // struct mob_data #include "npc.h" // struct npc_data -#include "pc.h" // struct map_session_data -#include "script.h" // set_var() - -#include "../../3rdparty/pcre/include/pcre.h" +#include #include #include #include -#include + +#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/party.c b/src/map/party.c index cf5e7bbe3..7c49e241c 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -2,34 +2,37 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/socket.h" // last_tick -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/utils.h" -#include "../common/strlib.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP #include "party.h" + +#include +#include +#include + #include "atcommand.h" //msg_txt() -#include "pc.h" -#include "map.h" -#include "instance.h" #include "battle.h" -#include "intif.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 "itemdb.h" - -#include -#include -#include - +#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 ed8289af6..3bad22b13 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -5,11 +5,12 @@ #ifndef _MAP_PARTY_H_ #define _MAP_PARTY_H_ -#include "../common/mmo.h" // struct party -#include "../config/core.h" #include -#include "map.h" +#include "map.h" // TBL_PC +#include "../common/cbasetypes.h" +#include "../common/db.h" +#include "../common/mmo.h" // struct party #define PARTY_BOOKING_JOBS 6 #define PARTY_BOOKING_RESULTS 10 diff --git a/src/map/path.c b/src/map/path.c index ae9fc389d..d02e9ee4a 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -2,20 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 HERCULES_CORE +#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA #include "path.h" -#include "map.h" #include #include #include +#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 0b67a0120..b48ff05fb 100644 --- a/src/map/path.h +++ b/src/map/path.h @@ -6,6 +6,7 @@ #define _MAP_PATH_H_ #include "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 c8fb14e55..45adfe22a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2,21 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/core.h" // get_svn_revision() -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" // session[] -#include "../common/strlib.h" // safestrncpy() -#include "../common/timer.h" -#include "../common/utils.h" -#include "../common/conf.h" -#include "../common/mmo.h" //NAME_LENGTH -#include "../common/sysinfo.h" +#define HERCULES_CORE +#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_CARTS, MAX_SPIRITBALL, NEW_CARTS, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT #include "pc.h" + +#include +#include +#include +#include + #include "atcommand.h" // get_atcommand_level() #include "battle.h" // battle_config #include "battleground.h" @@ -25,32 +20,40 @@ #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 "path.h" -#include "homunculus.h" -#include "instance.h" #include "mercenary.h" -#include "elemental.h" +#include "mob.h" // struct mob_data #include "npc.h" // fake_nd -#include "pet.h" // pet_unlocktarget() #include "party.h" // party->search() -#include "guild.h" // guild->search(), guild_request_info() +#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 "pc_groups.h" -#include "quest.h" - -#include -#include -#include -#include - +#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 +#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; @@ -10651,9 +10654,7 @@ void pc_defaults(void) { memset(pc->exp_table, 0, sizeof(pc->exp_table) + sizeof(pc->max_level) + sizeof(pc->statp) -#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) + sizeof(pc->level_penalty) -#endif + sizeof(pc->skill_tree) + sizeof(pc->smith_fame_list) + sizeof(pc->chemist_fame_list) diff --git a/src/map/pc.h b/src/map/pc.h index 70df9ca56..c4026a48d 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -5,23 +5,23 @@ #ifndef _MAP_PC_H_ #define _MAP_PC_H_ -#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus -#include "../common/ers.h" -#include "../common/timer.h" // INVALID_TIMER -#include "atcommand.h" // AtCommandType +#include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT + #include "battle.h" // battle_config -#include "battleground.h" +#include "battleground.h" // enum bg_queue_types #include "buyingstore.h" // struct s_buyingstore -#include "itemdb.h" -#include "log.h" -#include "map.h" // RC_MAX -#include "mob.h" -#include "pc_groups.h" -#include "script.h" // struct script_reg, struct script_regstr +#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" // OPTION_*, struct weapon_atk -#include "unit.h" // unit_stop_attack(), unit_stop_walking() +#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 /** * Defines @@ -742,9 +742,8 @@ struct pc_interface { unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL]; unsigned int max_level[CLASS_COUNT][2]; unsigned int statp[MAX_LEVEL+1]; -#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1]; -#endif + unsigned int equip_pos[EQI_MAX]; /* */ struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE]; diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c index 906462c7e..a917ef409 100644 --- a/src/map/pc_groups.c +++ b/src/map/pc_groups.c @@ -2,6 +2,14 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#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" @@ -10,12 +18,6 @@ #include "../common/showmsg.h" #include "../common/strlib.h" // strcmp -#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() - static GroupSettings dummy_group; ///< dummy group used in dummy map sessions @see pc_get_dummy_sd() struct pc_groups_interface pcg_s; diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h index 5c03f999f..7c8cdd82a 100644 --- a/src/map/pc_groups.h +++ b/src/map/pc_groups.h @@ -5,6 +5,10 @@ #ifndef _MAP_PC_GROUPS_H_ #define _MAP_PC_GROUPS_H_ +#include "../common/cbasetypes.h" +#include "../common/conf.h" +#include "../common/db.h" + /// PC permissions enum e_pc_permission { PC_PERM_NONE = 0, // #0 diff --git a/src/map/pet.c b/src/map/pet.c index 993497434..aa2be4473 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -2,37 +2,39 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/db.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/ers.h" +#define HERCULES_CORE -#include "pc.h" -#include "status.h" -#include "map.h" -#include "path.h" -#include "intif.h" -#include "clif.h" -#include "chrif.h" #include "pet.h" -#include "itemdb.h" + +#include +#include +#include + +#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 "atcommand.h" // msg_txt() -#include "log.h" - -#include -#include -#include +#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; diff --git a/src/map/pet.h b/src/map/pet.h index 4ec30b3fb..8dde0fac2 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -5,8 +5,14 @@ #ifndef _MAP_PET_H_ #define _MAP_PET_H_ -#define MAX_PET_DB 300 -#define MAX_PETLOOT_SIZE 30 +#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 + +#define MAX_PET_DB 300 +#define MAX_PETLOOT_SIZE 30 struct s_pet_db { short class_; diff --git a/src/map/quest.c b/src/map/quest.c index bde276f9d..b76d6bc82 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -2,36 +2,37 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE -#include "map.h" -#include "pc.h" -#include "npc.h" -#include "itemdb.h" -#include "script.h" -#include "intif.h" -#include "battle.h" -#include "mob.h" -#include "party.h" -#include "unit.h" -#include "log.h" -#include "clif.h" #include "quest.h" -#include "chrif.h" +#include #include #include #include -#include #include +#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/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 quest_interface quest_s; diff --git a/src/map/quest.h b/src/map/quest.h index e01e35619..87894d639 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -5,6 +5,10 @@ #ifndef _MAP_QUEST_H_ #define _MAP_QUEST_H_ +#include "map.h" // TBL_PC +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // MAX_QUEST_OBJECTIVES + #define MAX_QUEST_DB (60355+1) // Highest quest ID + 1 struct quest_db { diff --git a/src/map/script.c b/src/map/script.c index aecdf9b28..e4cf7f227 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2,6 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // NEW_CARTS, 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 +#include +#include +#include + +#include "atcommand.h" +#include "battle.h" +#include "battleground.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" @@ -10,47 +50,10 @@ #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/sysinfo.h" - -#include "map.h" -#include "path.h" -#include "clif.h" -#include "chrif.h" -#include "itemdb.h" -#include "pc.h" -#include "status.h" -#include "storage.h" -#include "mob.h" -#include "npc.h" -#include "pet.h" -#include "mapreg.h" -#include "homunculus.h" -#include "instance.h" -#include "mercenary.h" -#include "intif.h" -#include "skill.h" -#include "status.h" -#include "chat.h" -#include "battle.h" -#include "battleground.h" -#include "party.h" -#include "guild.h" -#include "atcommand.h" -#include "log.h" -#include "unit.h" -#include "pet.h" -#include "mail.h" -#include "script.h" -#include "quest.h" -#include "elemental.h" -#include "../config/core.h" -#include -#include -#include -#include #ifndef WIN32 #include #endif diff --git a/src/map/script.h b/src/map/script.h index 90b18d87f..899c745da 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -5,17 +5,19 @@ #ifndef _MAP_SCRIPT_H_ #define _MAP_SCRIPT_H_ -#include "../common/strlib.h" //StringBuf -#include "../common/cbasetypes.h" -#include "map.h" //EVENT_NAME_LENGTH - #include #include +#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 **/ -struct map_session_data; struct eri; /** diff --git a/src/map/searchstore.c b/src/map/searchstore.c index 0144aea93..72b28aacd 100644 --- a/src/map/searchstore.c +++ b/src/map/searchstore.c @@ -2,14 +2,17 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#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 "battle.h" // battle_config.* -#include "clif.h" // clif->open_search_store_info, clif->search_store_info_* -#include "pc.h" // struct map_session_data -#include "searchstore.h" // struct s_search_store_info struct searchstore_interface searchstore_s; diff --git a/src/map/searchstore.h b/src/map/searchstore.h index 827e39053..c9b93ba54 100644 --- a/src/map/searchstore.h +++ b/src/map/searchstore.h @@ -5,6 +5,12 @@ #ifndef _MAP_SEARCHSTORE_H_ #define _MAP_SEARCHSTORE_H_ +#include + +#include "map.h" // MESSAGE_SIZE +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // MAX_SLOTS + /** * Defines **/ diff --git a/src/map/skill.c b/src/map/skill.c index c8388770a..b2e94ec79 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2,46 +2,48 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/ers.h" +#define HERCULES_CORE -#include "map.h" -#include "path.h" -#include "clif.h" -#include "pc.h" -#include "status.h" +#include "../config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION() #include "skill.h" -#include "pet.h" + +#include +#include +#include +#include +#include + +#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 "elemental.h" #include "mob.h" #include "npc.h" -#include "battle.h" -#include "battleground.h" #include "party.h" -#include "itemdb.h" +#include "path.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "intif.h" -#include "log.h" -#include "chrif.h" -#include "guild.h" -#include "date.h" +#include "status.h" #include "unit.h" - -#include -#include -#include -#include -#include - +#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 diff --git a/src/map/skill.h b/src/map/skill.h index dda310bd4..b6dbb1fcb 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -5,19 +5,23 @@ #ifndef _MAP_SKILL_H_ #define _MAP_SKILL_H_ -#include "../common/mmo.h" // MAX_SKILL, struct square -#include "../common/db.h" +#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 /** * Declarations **/ -struct map_session_data; struct homun_data; +struct map_session_data; +struct mercenary_data; struct skill_unit; -struct skill_unit_group; -struct status_change_entry; struct square; +struct status_change_entry; /** * Defines diff --git a/src/map/status.c b/src/map/status.c index 4c2bc6d22..eb06138da 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2,43 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/utils.h" -#include "../common/ers.h" -#include "../common/strlib.h" +#define HERCULES_CORE + +#include "../config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP +#include "status.h" +#include +#include +#include +#include +#include +#include + +#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 "npc.h" -#include "mob.h" -#include "clif.h" -#include "guild.h" +#include "script.h" #include "skill.h" -#include "itemdb.h" -#include "battle.h" -#include "chrif.h" #include "skill.h" -#include "status.h" -#include "script.h" #include "unit.h" -#include "homunculus.h" -#include "mercenary.h" -#include "elemental.h" #include "vending.h" - -#include -#include -#include -#include -#include -#include +#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 e47c2b365..baa586297 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -5,14 +5,18 @@ #ifndef _MAP_STATUS_H_ #define _MAP_STATUS_H_ +#include "../config/core.h" // defType, NEW_CARTS, RENEWAL, RENEWAL_ASPD + +#include "../common/cbasetypes.h" #include "../common/mmo.h" struct block_list; -struct mob_data; -struct pet_data; +struct elemental_data; struct homun_data; struct mercenary_data; -struct status_change; +struct mob_data; +struct npc_data; +struct pet_data; //Change the equation when the values are high enough to discard the //imprecision in exchange of overflow protection [Skotlex] @@ -1878,11 +1882,7 @@ struct status_interface { int hp_coefficient2[CLASS_COUNT]; int hp_sigma_val[CLASS_COUNT][MAX_LEVEL+1]; int sp_coefficient[CLASS_COUNT]; -#ifdef RENEWAL_ASPD - int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; -#else - int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89] -#endif + int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; // +1 for RENEWAL_ASPD sc_type Skill2SCTable[MAX_SKILL]; // skill -> status int IconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) unsigned int ChangeFlagTable[SC_MAX]; // status -> flags diff --git a/src/map/storage.c b/src/map/storage.c index e65ed7b80..2db5fff3d 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -2,28 +2,30 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" +#define HERCULES_CORE -#include "map.h" // struct map_session_data #include "storage.h" -#include "chrif.h" -#include "itemdb.h" -#include "clif.h" -#include "intif.h" -#include "pc.h" -#include "guild.h" -#include "battle.h" -#include "atcommand.h" -#include "log.h" #include #include #include +#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" +#include "../common/showmsg.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 8f9f904f6..5edb68cfc 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -5,11 +5,12 @@ #ifndef _MAP_STORAGE_H_ #define _MAP_STORAGE_H_ -struct storage_data; +#include "../common/cbasetypes.h" +#include "../common/db.h" + struct guild_storage; struct item; struct map_session_data; -struct DBMap; struct storage_interface { /* */ diff --git a/src/map/trade.c b/src/map/trade.c index 44b669ebd..83426c407 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -2,25 +2,27 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/socket.h" +#define HERCULES_CORE #include "trade.h" + +#include +#include + +#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 "npc.h" -#include "battle.h" -#include "chrif.h" #include "storage.h" -#include "intif.h" -#include "atcommand.h" -#include "log.h" - -#include -#include +#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 151d4bad5..0ad770e80 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2,45 +2,48 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/showmsg.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // RENEWAL_CAST +#include "unit.h" + +#include +#include +#include + +#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 "mob.h" #include "pet.h" -#include "homunculus.h" -#include "instance.h" -#include "mercenary.h" -#include "elemental.h" +#include "script.h" #include "skill.h" -#include "clif.h" -#include "duel.h" -#include "npc.h" -#include "guild.h" #include "status.h" -#include "unit.h" -#include "battle.h" -#include "battleground.h" -#include "chat.h" +#include "storage.h" #include "trade.h" #include "vending.h" -#include "party.h" -#include "intif.h" -#include "chrif.h" -#include "script.h" -#include "storage.h" - -#include -#include -#include - +#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 33fa4e052..9e05647b1 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -5,15 +5,13 @@ #ifndef _MAP_UNIT_H_ #define _MAP_UNIT_H_ -//#include "map.h" -struct block_list; -struct unit_data; -struct map_session_data; - #include "clif.h" // clr_type -#include "map.h" // struct block_list #include "path.h" // struct walkpath_data -#include "skill.h" // struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset +#include "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; struct unit_data { struct block_list *bl; diff --git a/src/map/vending.c b/src/map/vending.c index 9462975b3..c8ac814db 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -2,24 +2,27 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE + +#include "vending.h" + +#include +#include + +#include "atcommand.h" +#include "battle.h" +#include "chrif.h" #include "clif.h" #include "itemdb.h" -#include "atcommand.h" +#include "log.h" #include "map.h" +#include "npc.h" #include "path.h" -#include "chrif.h" -#include "vending.h" #include "pc.h" -#include "npc.h" #include "skill.h" -#include "battle.h" -#include "log.h" - -#include -#include +#include "../common/nullpo.h" +#include "../common/strlib.h" +#include "../common/utils.h" struct vending_interface vending_s; diff --git a/src/map/vending.h b/src/map/vending.h index a212f8385..a70726374 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -7,6 +7,7 @@ #include "../common/cbasetypes.h" #include "../common/db.h" + struct map_session_data; struct s_search_store_search; diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c index 85d5fb548..96d51aec6 100644 --- a/src/tool/mapcache.c +++ b/src/tool/mapcache.c @@ -1,6 +1,14 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "../config/core.h" // RENEWAL + +#include +#include +#include + #include "../common/cbasetypes.h" #include "../common/grfio.h" #include "../common/malloc.h" @@ -8,12 +16,6 @@ #include "../common/showmsg.h" #include "../common/utils.h" -#include "../config/renewal.h" - -#include -#include -#include - #ifndef _WIN32 #include #endif -- cgit v1.2.3-70-g09d2 From 94657284973f4037596bae468ebfbee5c217e02b Mon Sep 17 00:00:00 2001 From: panikon Date: Sat, 10 May 2014 06:08:56 -0300 Subject: Revert "Fixed order of includes in all source files" This reverts commit b6b3f58795288701d0e162d43fa6f0a47af913b3. Fixes issue 8184 http://hercules.ws/board/tracker/issue-8184-cart-related/ --- src/char/char.c | 44 +++++----- src/char/char.h | 1 + src/char/int_auction.c | 25 +++--- src/char/int_elemental.c | 22 ++--- src/char/int_elemental.h | 2 +- src/char/int_guild.c | 24 +++-- src/char/int_guild.h | 3 + src/char/int_homun.c | 21 ++--- src/char/int_homun.h | 2 - src/char/int_mail.c | 20 ++--- src/char/int_mail.h | 3 - src/char/int_mercenary.c | 22 ++--- src/char/int_mercenary.h | 4 +- src/char/int_party.c | 25 +++--- src/char/int_party.h | 2 + src/char/int_pet.c | 22 ++--- src/char/int_quest.c | 22 +++-- src/char/int_storage.c | 22 ++--- src/char/inter.c | 43 +++++---- src/char/inter.h | 5 +- src/char/pincode.c | 11 +-- src/common/HPM.c | 31 +++---- src/common/HPM.h | 6 +- src/common/HPMi.h | 16 +++- src/common/cbasetypes.h | 6 -- src/common/conf.c | 3 - src/common/conf.h | 1 - src/common/console.c | 223 +++++++++++++++++++++++------------------------ src/common/console.h | 21 ++--- src/common/core.c | 38 ++++---- src/common/core.h | 3 +- src/common/db.c | 10 +-- src/common/db.h | 3 +- src/common/des.c | 7 +- src/common/ers.c | 8 +- src/common/grfio.c | 17 ++-- src/common/malloc.c | 11 +-- src/common/mapindex.c | 15 ++-- src/common/md5calc.c | 8 +- src/common/mmo.h | 6 +- src/common/mutex.c | 5 +- src/common/mutex.h | 1 - src/common/nullpo.c | 6 +- src/common/random.c | 18 ++-- src/common/showmsg.c | 17 ++-- src/common/showmsg.h | 23 ++--- src/common/socket.c | 64 +++++++------- src/common/socket.h | 12 +-- src/common/spinlock.h | 9 +- src/common/sql.c | 12 +-- src/common/sql.h | 3 +- src/common/strlib.c | 13 ++- src/common/strlib.h | 15 ++-- src/common/sysinfo.c | 32 ++----- src/common/sysinfo.h | 16 ++++ src/common/thread.c | 31 +++---- src/common/thread.h | 1 + src/common/timer.c | 19 ++-- src/common/utils.c | 36 ++++---- src/common/utils.h | 3 +- src/config/const.h | 7 ++ src/config/renewal.h | 1 - src/login/account.h | 1 - src/login/account_sql.c | 17 ++-- src/login/ipban_sql.c | 14 ++- src/login/login.c | 21 ++--- src/login/login.h | 2 +- src/login/loginlog.h | 2 +- src/login/loginlog_sql.c | 9 +- src/map/HPMmap.c | 42 ++++----- src/map/atcommand.c | 67 +++++++------- src/map/atcommand.h | 2 +- src/map/battle.c | 61 ++++++------- src/map/battle.h | 2 +- src/map/battleground.c | 33 ++++--- src/map/battleground.h | 2 +- src/map/buyingstore.c | 17 ++-- src/map/buyingstore.h | 5 -- src/map/chat.c | 23 +++-- src/map/chat.h | 5 +- src/map/chrif.c | 35 ++++---- src/map/chrif.h | 4 +- src/map/clif.c | 83 +++++++++--------- src/map/clif.h | 9 +- src/map/date.c | 6 +- src/map/date.h | 2 - src/map/duel.c | 10 +-- src/map/duel.h | 4 - src/map/elemental.c | 54 ++++++------ src/map/elemental.h | 1 - src/map/guild.c | 47 +++++----- src/map/guild.h | 16 +++- src/map/homunculus.c | 56 ++++++------ src/map/homunculus.h | 3 +- src/map/instance.c | 34 ++++---- src/map/instance.h | 3 - src/map/intif.c | 51 +++++------ src/map/intif.h | 13 ++- src/map/irc-bot.c | 22 +++-- src/map/irc-bot.h | 2 - src/map/itemdb.c | 27 +++--- src/map/itemdb.h | 5 +- src/map/log.c | 23 +++-- src/map/log.h | 5 +- src/map/mail.c | 16 ++-- src/map/mail.h | 6 +- src/map/map.c | 96 ++++++++++---------- src/map/map.h | 9 +- src/map/mapreg_sql.c | 14 ++- src/map/mercenary.c | 54 ++++++------ src/map/mercenary.h | 1 - src/map/mob.c | 69 +++++++-------- src/map/mob.h | 9 +- src/map/npc.c | 57 ++++++------ src/map/npc.h | 4 +- src/map/npc_chat.c | 26 +++--- src/map/party.c | 43 +++++---- src/map/party.h | 7 +- src/map/path.c | 17 ++-- src/map/path.h | 1 - src/map/pc.c | 59 ++++++------- src/map/pc.h | 29 +++--- src/map/pc_groups.c | 14 ++- src/map/pc_groups.h | 4 - src/map/pet.c | 48 +++++----- src/map/pet.h | 10 +-- src/map/quest.c | 45 +++++----- src/map/quest.h | 4 - src/map/script.c | 79 ++++++++--------- src/map/script.h | 12 ++- src/map/searchstore.c | 11 +-- src/map/searchstore.h | 6 -- src/map/skill.c | 64 +++++++------- src/map/skill.h | 14 ++- src/map/status.c | 59 ++++++------- src/map/status.h | 16 ++-- src/map/storage.c | 32 ++++--- src/map/storage.h | 5 +- src/map/trade.c | 24 +++-- src/map/unit.c | 63 +++++++------ src/map/unit.h | 12 +-- src/map/vending.c | 27 +++--- src/map/vending.h | 1 - src/tool/mapcache.c | 14 ++- 144 files changed, 1367 insertions(+), 1676 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/char/char.c b/src/char/char.c index 6c0902644..77e393c0d 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2,30 +2,7 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // CONSOLE_INPUT -#include "char.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "int_elemental.h" -#include "int_guild.h" -#include "int_homun.h" -#include "int_mercenary.h" -#include "int_party.h" -#include "int_storage.h" -#include "inter.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" @@ -36,6 +13,25 @@ #include "../common/strlib.h" #include "../common/timer.h" #include "../common/utils.h" +#include "../common/console.h" +#include "../common/HPM.h" +#include "int_guild.h" +#include "int_homun.h" +#include "int_mercenary.h" +#include "int_elemental.h" +#include "int_party.h" +#include "int_storage.h" +#include "char.h" +#include "inter.h" +#include "pincode.h" + +#include +#include +#include +#include +#include +#include +#include // private declarations #define CHAR_CONF_NAME "conf/char-server.conf" @@ -5501,7 +5497,7 @@ int do_init(int argc, char **argv) { Sql_HerculesUpdateCheck(sql_handle); #ifdef CONSOLE_INPUT - console->input->setSQL(sql_handle); + console->setSQL(sql_handle); #endif ShowStatus("The char-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", char_port); diff --git a/src/char/char.h b/src/char/char.h index 09a78f6b9..2928929de 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -5,6 +5,7 @@ #ifndef _COMMON_CHAR_H_ #define _COMMON_CHAR_H_ +#include "../config/core.h" #include "../common/core.h" // CORE_ST_LAST #include "../common/db.h" diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 886b5be26..924930867 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -2,25 +2,22 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_auction.h" - -#include -#include -#include - -#include "char.h" -#include "int_mail.h" -#include "inter.h" -#include "../common/db.h" -#include "../common/malloc.h" #include "../common/mmo.h" +#include "../common/malloc.h" +#include "../common/db.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/sql.h" #include "../common/strlib.h" +#include "../common/sql.h" #include "../common/timer.h" +#include "char.h" +#include "inter.h" +#include "int_mail.h" +#include "int_auction.h" + +#include +#include +#include static DBMap* auction_db_ = NULL; // int auction_id -> struct auction_data* diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c index 3a36e75a2..ed0c2a9ed 100644 --- a/src/char/int_elemental.c +++ b/src/char/int_elemental.c @@ -2,23 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_elemental.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" -#include "../common/malloc.h" #include "../common/mmo.h" +#include "../common/malloc.h" +#include "../common/strlib.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" #include "../common/utils.h" +#include "../common/sql.h" +#include "char.h" +#include "inter.h" + +#include +#include +#include bool mapif_elemental_save(struct s_elemental* ele) { bool flag = true; diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h index c869e6fc2..c90891fc4 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" +struct s_elemental; void inter_elemental_sql_init(void); void inter_elemental_sql_final(void); diff --git a/src/char/int_guild.c b/src/char/int_guild.c index ffbe48e10..895cbbb94 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -2,25 +2,21 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // DBPATH -#include "int_guild.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" #include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" #include "../common/mmo.h" -#include "../common/showmsg.h" +#include "../common/malloc.h" #include "../common/socket.h" +#include "../common/db.h" +#include "../common/showmsg.h" #include "../common/strlib.h" #include "../common/timer.h" +#include "char.h" +#include "inter.h" +#include "int_guild.h" + +#include +#include +#include #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 5e657ff06..4eb7d310b 100644 --- a/src/char/int_guild.h +++ b/src/char/int_guild.h @@ -20,6 +20,9 @@ enum { GS_REMOVE = 0x8000, }; +struct guild; +struct guild_castle; + int inter_guild_parse_frommap(int fd); int inter_guild_sql_init(void); void inter_guild_sql_final(void); diff --git a/src/char/int_homun.c b/src/char/int_homun.c index 795a6b927..143277f05 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -2,23 +2,20 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_homun.h" +#include "../common/mmo.h" +#include "../common/malloc.h" +#include "../common/strlib.h" +#include "../common/showmsg.h" +#include "../common/socket.h" +#include "../common/utils.h" +#include "../common/sql.h" +#include "char.h" +#include "inter.h" #include #include #include -#include "char.h" -#include "inter.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/utils.h" int inter_homunculus_sql_init(void) { diff --git a/src/char/int_homun.h b/src/char/int_homun.h index 9477f4f03..561dc848f 100644 --- a/src/char/int_homun.h +++ b/src/char/int_homun.h @@ -4,8 +4,6 @@ #ifndef _CHAR_INT_HOMUN_H_ #define _CHAR_INT_HOMUN_H_ -#include "../common/cbasetypes.h" - struct s_homunculus; int inter_homunculus_sql_init(void); diff --git a/src/char/int_mail.c b/src/char/int_mail.c index 86a36d59f..826771676 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -2,23 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_mail.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" -#include "../common/malloc.h" #include "../common/mmo.h" +#include "../common/malloc.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/sql.h" #include "../common/strlib.h" +#include "../common/sql.h" #include "../common/timer.h" +#include "char.h" +#include "inter.h" + +#include +#include +#include static int mail_fromsql(int char_id, struct mail_data* md) { diff --git a/src/char/int_mail.h b/src/char/int_mail.h index 824ba48a3..7c06cdc1f 100644 --- a/src/char/int_mail.h +++ b/src/char/int_mail.h @@ -4,9 +4,6 @@ #ifndef _CHAR_INT_MAIL_H_ #define _CHAR_INT_MAIL_H_ -struct item; -struct mail_message; - int inter_mail_parse_frommap(int fd); void mail_sendmail(int send_id, const char* send_name, int dest_id, const char* dest_name, const char* title, const char* body, int zeny, struct item *item); diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c index 1dffb656c..aecb3844a 100644 --- a/src/char/int_mercenary.c +++ b/src/char/int_mercenary.c @@ -2,23 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_mercenary.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" -#include "../common/malloc.h" #include "../common/mmo.h" +#include "../common/malloc.h" +#include "../common/strlib.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/sql.h" -#include "../common/strlib.h" #include "../common/utils.h" +#include "../common/sql.h" +#include "char.h" +#include "inter.h" + +#include +#include +#include bool 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 195a83b34..b614b8cf7 100644 --- a/src/char/int_mercenary.h +++ b/src/char/int_mercenary.h @@ -4,9 +4,7 @@ #ifndef _CHAR_INT_MERCENARY_H_ #define _CHAR_INT_MERCENARY_H_ -#include "../common/cbasetypes.h" - -struct mmo_charstatus; +struct s_mercenary; int inter_mercenary_sql_init(void); void inter_mercenary_sql_final(void); diff --git a/src/char/int_party.c b/src/char/int_party.c index 3e4a743d6..7c328c452 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -2,25 +2,22 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_party.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" #include "../common/cbasetypes.h" +#include "../common/mmo.h" #include "../common/db.h" #include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" +#include "../common/strlib.h" #include "../common/socket.h" +#include "../common/showmsg.h" +#include "../common/mapindex.h" #include "../common/sql.h" -#include "../common/strlib.h" +#include "char.h" +#include "inter.h" +#include "int_party.h" + +#include +#include +#include struct party_data { struct party party; diff --git a/src/char/int_party.h b/src/char/int_party.h index 098c1e9a9..84f00635a 100644 --- a/src/char/int_party.h +++ b/src/char/int_party.h @@ -14,6 +14,8 @@ enum { PS_BREAK = 0x20, //Specify that this party must be deleted. }; +struct party; + int inter_party_parse_frommap(int fd); int inter_party_sql_init(void); void inter_party_sql_final(void); diff --git a/src/char/int_pet.c b/src/char/int_pet.c index 29c40eff9..25f00e6f0 100644 --- a/src/char/int_pet.c +++ b/src/char/int_pet.c @@ -2,23 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_pet.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" -#include "../common/malloc.h" #include "../common/mmo.h" -#include "../common/showmsg.h" +#include "../common/malloc.h" #include "../common/socket.h" -#include "../common/sql.h" #include "../common/strlib.h" +#include "../common/showmsg.h" #include "../common/utils.h" +#include "../common/sql.h" +#include "char.h" +#include "inter.h" + +#include +#include +#include struct s_pet *pet_pt; diff --git a/src/char/int_quest.c b/src/char/int_quest.c index 61b43c57d..061dd89d9 100644 --- a/src/char/int_quest.c +++ b/src/char/int_quest.c @@ -2,25 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "int_quest.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" +#include "../common/mmo.h" #include "../common/db.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/sql.h" #include "../common/timer.h" +#include "char.h" +#include "inter.h" +#include "int_quest.h" + +#include +#include +#include + /** * Loads the entire questlog for a character. * diff --git a/src/char/int_storage.c b/src/char/int_storage.c index bf7b76da0..966e61bb3 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -2,23 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // GP_BOUND_ITEMS -#include "int_storage.h" - -#include -#include -#include - -#include "char.h" -#include "inter.h" -#include "../common/malloc.h" #include "../common/mmo.h" +#include "../common/malloc.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/sql.h" #include "../common/strlib.h" // StringBuf +#include "../common/sql.h" +#include "char.h" +#include "inter.h" + +#include +#include +#include + #define STORAGE_MEMINC 16 diff --git a/src/char/inter.c b/src/char/inter.c index 972407ef3..515ca0ec4 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -2,34 +2,33 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - +#include "../common/mmo.h" +#include "../common/db.h" +#include "../common/malloc.h" +#include "../common/strlib.h" +#include "../common/showmsg.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "char.h" #include "inter.h" +#include "int_party.h" +#include "int_guild.h" +#include "int_storage.h" +#include "int_pet.h" +#include "int_homun.h" +#include "int_mercenary.h" +#include "int_mail.h" +#include "int_auction.h" +#include "int_quest.h" +#include "int_elemental.h" -#include #include -#include #include +#include +#include + #include // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool] -#include "char.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 "../common/db.h" -#include "../common/malloc.h" -#include "../common/mmo.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 5e655237e..25b0c2a96 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -5,10 +5,9 @@ #ifndef _CHAR_INTER_H_ #define _CHAR_INTER_H_ -#include "char.h" -#include "../common/sql.h" - struct accreg; +#include "../common/sql.h" +#include "char.h" int inter_init_sql(const char *file); void inter_final(void); diff --git a/src/char/pincode.c b/src/char/pincode.c index 59182f12d..d51953448 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -2,19 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "pincode.h" - -#include - -#include "char.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 "pincode.h" + +#include int enabled = PINCODE_OK; int changetime = 0; diff --git a/src/common/HPM.c b/src/common/HPM.c index 00b92dc60..9ffce87de 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -1,31 +1,26 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#define HERCULES_CORE - -#include "../config/core.h" // CONSOLE_INPUT -#include "HPM.h" - -#include -#include -#include - #include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/console.h" +#include "../common/mmo.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/conf.h" #include "../common/utils.h" +#include "../common/console.h" +#include "../common/strlib.h" +#include "../common/sql.h" +#include "../common/sysinfo.h" +#include "HPM.h" +#include +#include +#include #ifndef WIN32 -# include +#include #endif struct malloc_interface iMalloc_HPM; @@ -691,7 +686,7 @@ bool hplugins_parse_conf(const char *w1, const char *w2, enum HPluginConfType po void hplugins_share_defaults(void) { /* console */ #ifdef CONSOLE_INPUT - HPM->share(console->input->addCommand,"addCPCommand"); + HPM->share(console->addCommand,"addCPCommand"); #endif /* our own */ HPM->share(hplugins_addpacket,"addPacket"); @@ -760,7 +755,7 @@ void hpm_init(void) { HPM->symbol_defaults(); #ifdef CONSOLE_INPUT - console->input->addCommand("plugins",CPCMD_A(plugins)); + console->addCommand("plugins",CPCMD_A(plugins)); #endif return; } diff --git a/src/common/HPM.h b/src/common/HPM.h index 9c176cfd6..0f0df4cda 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -4,12 +4,8 @@ #ifndef _COMMON_HPM_H_ #define _COMMON_HPM_H_ -#ifndef HERCULES_CORE -#error You should never include HPM.h from a plugin. -#endif - -#include "../common/HPMi.h" #include "../common/cbasetypes.h" +#include "../common/HPMi.h" #ifdef WIN32 #ifndef WIN32_LEAN_AND_MEAN diff --git a/src/common/HPMi.h b/src/common/HPMi.h index b98e87d90..19206aeca 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -5,8 +5,8 @@ #define _COMMON_HPMI_H_ #include "../common/cbasetypes.h" -#include "../common/console.h" #include "../common/core.h" +#include "../common/console.h" #include "../common/sql.h" struct script_state; @@ -20,6 +20,18 @@ struct map_session_data; #define HPExport #endif +#ifndef _COMMON_SHOWMSG_H_ + HPExport void (*ShowMessage) (const char *, ...); + HPExport void (*ShowStatus) (const char *, ...); + HPExport void (*ShowSQL) (const char *, ...); + HPExport void (*ShowInfo) (const char *, ...); + HPExport void (*ShowNotice) (const char *, ...); + HPExport void (*ShowWarning) (const char *, ...); + HPExport void (*ShowDebug) (const char *, ...); + HPExport void (*ShowError) (const char *, ...); + HPExport void (*ShowFatalError) (const char *, ...); +#endif + /* after */ #include "../common/showmsg.h" @@ -180,7 +192,7 @@ HPExport struct HPMi_interface { /* pc group permission */ void (*addPCGPermission) (unsigned int pluginID, char *name, unsigned int *mask); } HPMi_s; -#ifndef HERCULES_CORE +#ifndef _COMMON_HPM_H_ HPExport struct HPMi_interface *HPMi; #endif diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index da0d6b307..f44e80413 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -442,11 +442,5 @@ void SET_FUNCPOINTER(T1& var, T2 p) #define SET_FUNCPOINTER(var,p) ((var) = (p)) #endif -/* pointer size fix which fixes several gcc warnings */ -#ifdef __64BIT__ - #define __64BPTRSIZE(y) ((intptr)(y)) -#else - #define __64BPTRSIZE(y) (y) -#endif #endif /* _COMMON_CBASETYPES_H_ */ diff --git a/src/common/conf.c b/src/common/conf.c index 46a034497..b816b2f7f 100644 --- a/src/common/conf.c +++ b/src/common/conf.c @@ -2,10 +2,7 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - #include "conf.h" - #include "../../3rdparty/libconfig/libconfig.h" #include "../common/showmsg.h" // ShowError diff --git a/src/common/conf.h b/src/common/conf.h index e5b637e47..9aff3df47 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -6,7 +6,6 @@ #define _COMMON_CONF_H_ #include "../common/cbasetypes.h" - #include "../../3rdparty/libconfig/libconfig.h" /** diff --git a/src/common/console.c b/src/common/console.c index 6a82db555..d8f352c8a 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -2,46 +2,42 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT -#include "console.h" - -#include -#include - #include "../common/cbasetypes.h" -#include "../common/core.h" #include "../common/showmsg.h" +#include "../common/core.h" #include "../common/sysinfo.h" +#include "../config/core.h" +#include "console.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/ers.h" + #include "../common/malloc.h" + #include "../common/atomic.h" + #include "../common/spinlock.h" + #include "../common/thread.h" + #include "../common/mutex.h" + #include "../common/timer.h" + #include "../common/strlib.h" + #include "../common/sql.h" #endif +#include +#include #if !defined(WIN32) -# include -# include + #include + #include #else -# include "../common/winapi.h" // Console close event handling -# ifdef CONSOLE_INPUT -# include /* _kbhit() */ -# endif + #include "../common/winapi.h" // Console close event handling #endif -struct console_interface console_s; #ifdef CONSOLE_INPUT -struct console_input_interface console_input_s; + #if defined(WIN32) + #include /* _kbhit() */ + #endif #endif +struct console_interface console_s; + /*====================================== * CORE : Display title *--------------------------------------*/ @@ -120,12 +116,12 @@ CPCMD_C(mem_report,server) { **/ CPCMD(help) { unsigned int i = 0; - for ( i = 0; i < console->input->cmd_list_count; i++ ) { - if( console->input->cmd_list[i]->next_count ) { - ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",console->input->cmd_list[i]->cmd); - console->input->parse_list_subs(console->input->cmd_list[i],2); + for ( i = 0; i < console->cmd_list_count; i++ ) { + if( console->cmd_list[i]->next_count ) { + ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",console->cmd_list[i]->cmd); + console->parse_list_subs(console->cmd_list[i],2); } else { - ShowInfo("- '"CL_WHITE"%s"CL_RESET"'\n",console->input->cmd_list[i]->cmd); + ShowInfo("- '"CL_WHITE"%s"CL_RESET"'\n",console->cmd_list[i]->cmd); } } } @@ -148,7 +144,7 @@ CPCMD_C(skip,update) { ShowDebug("usage example: sql update skip 2013-02-14--16-15.sql\n"); return; } - Sql_HerculesUpdateSkip(console->input->SQL, line); + Sql_HerculesUpdateSkip(console->SQL, line); } /** @@ -210,7 +206,7 @@ void console_load_defaults(void) { unsigned int i, len = ARRAYLENGTH(default_list); struct CParseEntry *cmd; - RECREATE(console->input->cmds,struct CParseEntry *, len); + RECREATE(console->cmds,struct CParseEntry *, len); for(i = 0; i < len; i++) { CREATE(cmd, struct CParseEntry, 1); @@ -224,12 +220,12 @@ void console_load_defaults(void) { cmd->next_count = 0; - console->input->cmd_count++; - console->input->cmds[i] = cmd; + console->cmd_count++; + console->cmds[i] = cmd; default_list[i].self = cmd; if( !default_list[i].connect ) { - RECREATE(console->input->cmd_list,struct CParseEntry *, ++console->input->cmd_list_count); - console->input->cmd_list[console->input->cmd_list_count - 1] = cmd; + RECREATE(console->cmd_list,struct CParseEntry *, ++console->cmd_list_count); + console->cmd_list[console->cmd_list_count - 1] = cmd; } } @@ -237,11 +233,11 @@ void console_load_defaults(void) { unsigned int k; if( !default_list[i].connect ) continue; - for(k = 0; k < console->input->cmd_count; k++) { - if( strcmpi(default_list[i].connect,console->input->cmds[k]->cmd) == 0 ) { + for(k = 0; k < console->cmd_count; k++) { + if( strcmpi(default_list[i].connect,console->cmds[k]->cmd) == 0 ) { cmd = default_list[i].self; - RECREATE(console->input->cmds[k]->u.next, struct CParseEntry *, ++console->input->cmds[k]->next_count); - console->input->cmds[k]->u.next[console->input->cmds[k]->next_count - 1] = cmd; + RECREATE(console->cmds[k]->u.next, struct CParseEntry *, ++console->cmds[k]->next_count); + console->cmds[k]->u.next[console->cmds[k]->next_count - 1] = cmd; break; } } @@ -260,23 +256,23 @@ void console_parse_create(char *name, CParseFunc func) { safestrncpy(sublist, name, CP_CMD_LENGTH * 5); tok = strtok(sublist,":"); - for ( i = 0; i < console->input->cmd_list_count; i++ ) { - if( strcmpi(tok,console->input->cmd_list[i]->cmd) == 0 ) + for ( i = 0; i < console->cmd_list_count; i++ ) { + if( strcmpi(tok,console->cmd_list[i]->cmd) == 0 ) break; } - if( i == console->input->cmd_list_count ) { - RECREATE(console->input->cmds,struct CParseEntry *, ++console->input->cmd_count); + if( i == console->cmd_list_count ) { + RECREATE(console->cmds,struct CParseEntry *, ++console->cmd_count); CREATE(cmd, struct CParseEntry, 1); safestrncpy(cmd->cmd, tok, CP_CMD_LENGTH); cmd->next_count = 0; - console->input->cmds[console->input->cmd_count - 1] = cmd; - RECREATE(console->input->cmd_list,struct CParseEntry *, ++console->input->cmd_list_count); - console->input->cmd_list[console->input->cmd_list_count - 1] = cmd; - i = console->input->cmd_list_count - 1; + console->cmds[console->cmd_count - 1] = cmd; + RECREATE(console->cmd_list,struct CParseEntry *, ++console->cmd_list_count); + console->cmd_list[console->cmd_list_count - 1] = cmd; + i = console->cmd_list_count - 1; } - cmd = console->input->cmd_list[i]; + cmd = console->cmd_list[i]; while( ( tok = strtok(NULL, ":") ) != NULL ) { for(i = 0; i < cmd->next_count; i++) { @@ -285,13 +281,13 @@ void console_parse_create(char *name, CParseFunc func) { } if ( i == cmd->next_count ) { - RECREATE(console->input->cmds,struct CParseEntry *, ++console->input->cmd_count); - CREATE(console->input->cmds[console->input->cmd_count-1], struct CParseEntry, 1); - safestrncpy(console->input->cmds[console->input->cmd_count-1]->cmd, tok, CP_CMD_LENGTH); - console->input->cmds[console->input->cmd_count-1]->next_count = 0; + RECREATE(console->cmds,struct CParseEntry *, ++console->cmd_count); + CREATE(console->cmds[console->cmd_count-1], struct CParseEntry, 1); + safestrncpy(console->cmds[console->cmd_count-1]->cmd, tok, CP_CMD_LENGTH); + console->cmds[console->cmd_count-1]->next_count = 0; RECREATE(cmd->u.next, struct CParseEntry *, ++cmd->next_count); - cmd->u.next[cmd->next_count - 1] = console->input->cmds[console->input->cmd_count-1]; - cmd = console->input->cmds[console->input->cmd_count-1]; + cmd->u.next[cmd->next_count - 1] = console->cmds[console->cmd_count-1]; + cmd = console->cmds[console->cmd_count-1]; continue; } @@ -306,7 +302,7 @@ void console_parse_list_subs(struct CParseEntry *cmd, unsigned char depth) { memset(msg, '-', depth); snprintf(msg + depth,CP_CMD_LENGTH * 2, " '"CL_WHITE"%s"CL_RESET"'",cmd->u.next[i]->cmd); ShowInfo("%s subs\n",msg); - console->input->parse_list_subs(cmd->u.next[i],depth + 1); + console->parse_list_subs(cmd->u.next[i],depth + 1); } else { memset(msg, '-', depth); snprintf(msg + depth,CP_CMD_LENGTH * 2, " %s",cmd->u.next[i]->cmd); @@ -324,21 +320,21 @@ void console_parse_sub(char *line) { memcpy(bline, line, 200); tok = strtok(line, " "); - for ( i = 0; i < console->input->cmd_list_count; i++ ) { - if( strcmpi(tok,console->input->cmd_list[i]->cmd) == 0 ) + for ( i = 0; i < console->cmd_list_count; i++ ) { + if( strcmpi(tok,console->cmd_list[i]->cmd) == 0 ) break; } - if( i == console->input->cmd_list_count ) { + if( i == console->cmd_list_count ) { ShowError("'"CL_WHITE"%s"CL_RESET"' is not a known command, type '"CL_WHITE"help"CL_RESET"' to list all commands\n",line); return; } - cmd = console->input->cmd_list[i]; + cmd = console->cmd_list[i]; len += snprintf(sublist,CP_CMD_LENGTH * 5,"%s", cmd->cmd) + 1; - if( cmd->next_count == 0 && console->input->cmd_list[i]->u.func ) { + if( cmd->next_count == 0 && console->cmd_list[i]->u.func ) { char *r = NULL; if( (tok = strtok(NULL, " ")) ) { r = bline; @@ -355,7 +351,7 @@ void console_parse_sub(char *line) { if( strcmpi("help",tok) == 0 ) { if( cmd->next_count ) { ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",sublist); - console->input->parse_list_subs(cmd,2); + console->parse_list_subs(cmd,2); } else { ShowError("'"CL_WHITE"%s"CL_RESET"' doesn't possess any subcommands\n",sublist); } @@ -396,95 +392,95 @@ void console_parse(char* line) { } void *cThread_main(void *x) { - while( console->input->ptstate ) {/* loopx */ - if( console->input->key_pressed() ) { + while( console->ptstate ) {/* loopx */ + if( console->key_pressed() ) { char input[MAX_CONSOLE_INPUT]; - console->input->parse(input); + console->parse(input); if( input[0] != '\0' ) {/* did we get something? */ - EnterSpinLock(&console->input->ptlock); + EnterSpinLock(&console->ptlock); if( cinput.count == CONSOLE_PARSE_SIZE ) { - LeaveSpinLock(&console->input->ptlock); + LeaveSpinLock(&console->ptlock); continue;/* drop */ } safestrncpy(cinput.queue[cinput.count++],input,MAX_CONSOLE_INPUT); - LeaveSpinLock(&console->input->ptlock); + LeaveSpinLock(&console->ptlock); } } - ramutex_lock( console->input->ptmutex ); - racond_wait( console->input->ptcond, console->input->ptmutex, -1 ); - ramutex_unlock( console->input->ptmutex ); + ramutex_lock( console->ptmutex ); + racond_wait( console->ptcond, console->ptmutex, -1 ); + ramutex_unlock( console->ptmutex ); } return NULL; } int console_parse_timer(int tid, int64 tick, int id, intptr_t data) { int i; - EnterSpinLock(&console->input->ptlock); + EnterSpinLock(&console->ptlock); for(i = 0; i < cinput.count; i++) { - console->input->parse_sub(cinput.queue[i]); + console->parse_sub(cinput.queue[i]); } cinput.count = 0; - LeaveSpinLock(&console->input->ptlock); - racond_signal(console->input->ptcond); + LeaveSpinLock(&console->ptlock); + racond_signal(console->ptcond); return 0; } void console_parse_final(void) { - if( console->input->ptstate ) { - InterlockedDecrement(&console->input->ptstate); - racond_signal(console->input->ptcond); + if( console->ptstate ) { + InterlockedDecrement(&console->ptstate); + racond_signal(console->ptcond); /* wait for thread to close */ - rathread_wait(console->input->pthread, NULL); + rathread_wait(console->pthread, NULL); - racond_destroy(console->input->ptcond); - ramutex_destroy(console->input->ptmutex); + racond_destroy(console->ptcond); + ramutex_destroy(console->ptmutex); } } void console_parse_init(void) { cinput.count = 0; - console->input->ptstate = 1; + console->ptstate = 1; - InitializeSpinLock(&console->input->ptlock); + InitializeSpinLock(&console->ptlock); - console->input->ptmutex = ramutex_create(); - console->input->ptcond = racond_create(); + console->ptmutex = ramutex_create(); + console->ptcond = racond_create(); - if( (console->input->pthread = rathread_create(console->input->pthread_main, NULL)) == NULL ){ + if( (console->pthread = rathread_create(console->pthread_main, NULL)) == NULL ){ ShowFatalError("console_parse_init: failed to spawn console_parse thread.\n"); exit(EXIT_FAILURE); } - timer->add_func_list(console->input->parse_timer, "console_parse_timer"); - timer->add_interval(timer->gettick() + 1000, console->input->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ + timer->add_func_list(console->parse_timer, "console_parse_timer"); + timer->add_interval(timer->gettick() + 1000, console->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ } void console_setSQL(Sql *SQL_handle) { - console->input->SQL = SQL_handle; + console->SQL = SQL_handle; } #endif /* CONSOLE_INPUT */ void console_init (void) { #ifdef CONSOLE_INPUT - console->input->cmd_count = console->input->cmd_list_count = 0; - console->input->load_defaults(); - console->input->parse_init(); + console->cmd_count = console->cmd_list_count = 0; + console->load_defaults(); + console->parse_init(); #endif } void console_final(void) { #ifdef CONSOLE_INPUT unsigned int i; - console->input->parse_final(); - for( i = 0; i < console->input->cmd_count; i++ ) { - if( console->input->cmds[i]->next_count ) - aFree(console->input->cmds[i]->u.next); - aFree(console->input->cmds[i]); + console->parse_final(); + for( i = 0; i < console->cmd_count; i++ ) { + if( console->cmds[i]->next_count ) + aFree(console->cmds[i]->u.next); + aFree(console->cmds[i]); } - aFree(console->input->cmds); - aFree(console->input->cmd_list); + aFree(console->cmds); + aFree(console->cmd_list); #endif } void console_defaults(void) { @@ -493,20 +489,17 @@ void console_defaults(void) { console->final = console_final; console->display_title = display_title; #ifdef CONSOLE_INPUT - console->input = &console_input_s; - console->input->parse_init = console_parse_init; - console->input->parse_final = console_parse_final; - console->input->parse_timer = console_parse_timer; - console->input->pthread_main = cThread_main; - console->input->parse = console_parse; - console->input->parse_sub = console_parse_sub; - console->input->key_pressed = console_parse_key_pressed; - console->input->load_defaults = console_load_defaults; - console->input->parse_list_subs = console_parse_list_subs; - console->input->addCommand = console_parse_create; - console->input->setSQL = console_setSQL; - console->input->SQL = NULL; -#else - console->input = NULL; + console->parse_init = console_parse_init; + console->parse_final = console_parse_final; + console->parse_timer = console_parse_timer; + console->pthread_main = cThread_main; + console->parse = console_parse; + console->parse_sub = console_parse_sub; + console->key_pressed = console_parse_key_pressed; + console->load_defaults = console_load_defaults; + console->parse_list_subs = console_parse_list_subs; + console->addCommand = console_parse_create; + console->setSQL = console_setSQL; + console->SQL = NULL; #endif } diff --git a/src/common/console.h b/src/common/console.h index d2c58f978..3d19ddc9d 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -4,13 +4,11 @@ #ifndef _COMMON_CONSOLE_H_ #define _COMMON_CONSOLE_H_ -#include "../config/core.h" // MAX_CONSOLE_INPUT - -#include "../common/cbasetypes.h" +#include "../common/thread.h" #include "../common/mutex.h" #include "../common/spinlock.h" #include "../common/sql.h" -#include "../common/thread.h" +#include "../config/core.h" /** * Queue Max @@ -49,8 +47,11 @@ struct { unsigned short count; } cinput; +struct console_interface { + void (*init) (void); + void (*final) (void); + void (*display_title) (void); #ifdef CONSOLE_INPUT -struct console_input_interface { /* vars */ SPIN_LOCK ptlock;/* parse thread lock */ rAthread pthread;/* parse thread */ @@ -76,17 +77,7 @@ struct console_input_interface { void (*parse_list_subs) (struct CParseEntry *cmd, unsigned char depth); void (*addCommand) (char *name, CParseFunc func); void (*setSQL) (Sql *SQL_handle); -}; -#else -struct console_input_interface; #endif - -struct console_interface { - void (*init) (void); - void (*final) (void); - void (*display_title) (void); - - struct console_input_interface *input; }; struct console_interface *console; diff --git a/src/common/core.c b/src/common/core.c index 85f824866..49b272488 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -2,40 +2,36 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" -#include "core.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/malloc.h" #include "../common/strlib.h" +#include "core.h" +#include "../common/console.h" +#include "../common/random.h" #include "../common/sysinfo.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/db.h" + #include "../common/socket.h" + #include "../common/timer.h" + #include "../common/thread.h" + #include "../common/sql.h" + #include "../config/core.h" + #include "../common/HPM.h" + #include "../common/utils.h" + #include "../common/conf.h" + #include "../common/ers.h" #endif -#include #include #include +#include #include #ifndef _WIN32 -# include +#include #else -# include "../common/winapi.h" // Console close event handling +#include "../common/winapi.h" // Console close event handling #endif /// Called when a terminate signal is received. diff --git a/src/common/core.h b/src/common/core.h index ba75e6b01..e9f7c5961 100644 --- a/src/common/core.h +++ b/src/common/core.h @@ -7,10 +7,11 @@ #include "../common/db.h" #include "../common/mmo.h" +#include "../config/core.h" /* so that developers with --enable-debug can raise signals from any section of the code they'd like */ #ifdef DEBUG -# include + #include #endif extern int arg_c; diff --git a/src/common/db.c b/src/common/db.c index 1781aa96f..8d6b08815 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -67,18 +67,14 @@ * @encoding US-ASCII * @see #db.h \*****************************************************************************/ - -#define HERCULES_CORE - -#include "db.h" - #include #include -#include "../common/ers.h" -#include "../common/malloc.h" +#include "db.h" #include "../common/mmo.h" +#include "../common/malloc.h" #include "../common/showmsg.h" +#include "../common/ers.h" #include "../common/strlib.h" /*****************************************************************************\ diff --git a/src/common/db.h b/src/common/db.h index 0d2548806..67abe6f19 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -42,9 +42,8 @@ #ifndef _COMMON_DB_H_ #define _COMMON_DB_H_ -#include - #include "../common/cbasetypes.h" +#include /*****************************************************************************\ * (1) Section with public typedefs, enums, unions, structures and defines. * diff --git a/src/common/des.c b/src/common/des.c index 7f952be76..ed6d098dc 100644 --- a/src/common/des.c +++ b/src/common/des.c @@ -1,11 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder - -#define HERCULES_CORE - -#include "des.h" - #include "../common/cbasetypes.h" +#include "../common/des.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/ers.c b/src/common/ers.c index d9895e4f2..5a3d7314a 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -39,18 +39,14 @@ * @encoding US-ASCII * * @see common#ers.h * \*****************************************************************************/ - -#define HERCULES_CORE - -#include "ers.h" - #include #include #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 "../common/nullpo.h" +#include "ers.h" #ifndef DISABLE_ERS diff --git a/src/common/grfio.c b/src/common/grfio.c index 1111fb3f3..bde0ed720 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -2,8 +2,13 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - +#include "../common/cbasetypes.h" +#include "../common/des.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/nullpo.h" #include "grfio.h" #include @@ -12,14 +17,6 @@ #include #include -#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 13cf0b5ce..5b39cbab6 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -2,19 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "malloc.h" +#include "../common/malloc.h" +#include "../common/core.h" +#include "../common/showmsg.h" +#include "../common/sysinfo.h" #include #include #include #include -#include "../common/core.h" -#include "../common/showmsg.h" -#include "../common/sysinfo.h" - struct malloc_interface iMalloc_s; ////////////// Memory Libraries ////////////////// diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 5c69c7063..3128a3cb0 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -2,19 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - +#include "../common/mmo.h" +#include "../common/showmsg.h" +#include "../common/malloc.h" +#include "../common/strlib.h" +#include "../common/db.h" #include "mapindex.h" +#include #include #include -#include - -#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/md5calc.c b/src/common/md5calc.c index e7b506e27..05fde42cc 100644 --- a/src/common/md5calc.c +++ b/src/common/md5calc.c @@ -6,15 +6,11 @@ * ***********************************************************/ -#define HERCULES_CORE - +#include "../common/random.h" #include "md5calc.h" - +#include #include #include -#include - -#include "../common/random.h" #ifndef UINT_MAX #define UINT_MAX 4294967295U diff --git a/src/common/mmo.h b/src/common/mmo.h index 1d826463e..d535d2874 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -5,10 +5,9 @@ #ifndef _COMMON_MMO_H_ #define _COMMON_MMO_H_ -#include - -#include "../common/cbasetypes.h" +#include "cbasetypes.h" #include "../common/db.h" +#include // server->client protocol version // 0 - pre-? @@ -97,7 +96,6 @@ //Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default ) #define MAX_BANK_ZENY 2100000000 -#define MAX_LEVEL 175 #define MAX_FAME 1000000000 #define MAX_CART 100 #define MAX_SKILL 1478 diff --git a/src/common/mutex.c b/src/common/mutex.c index 12524c3b7..0668dbc41 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -1,10 +1,6 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#define HERCULES_CORE - -#include "mutex.h" - #ifdef WIN32 #include "../common/winapi.h" #else @@ -17,6 +13,7 @@ #include "../common/malloc.h" #include "../common/showmsg.h" #include "../common/timer.h" +#include "../common/mutex.h" struct ramutex{ #ifdef WIN32 diff --git a/src/common/mutex.h b/src/common/mutex.h index 3b83b66d6..eeb24e6ff 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -4,7 +4,6 @@ #ifndef _COMMON_MUTEX_H_ #define _COMMON_MUTEX_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 1891835f1..1cb471aff 100644 --- a/src/common/nullpo.c +++ b/src/common/nullpo.c @@ -2,14 +2,10 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "nullpo.h" - #include #include #include - +#include "../common/nullpo.h" #include "../common/showmsg.h" /** diff --git a/src/common/random.c b/src/common/random.c index 7019a31f3..e46c52cad 100644 --- a/src/common/random.c +++ b/src/common/random.c @@ -1,23 +1,17 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#define HERCULES_CORE - -#include "random.h" - -#include // time - -#include // init_genrand, genrand_int32, genrand_res53 - #include "../common/showmsg.h" #include "../common/timer.h" // gettick - +#include "random.h" #if defined(WIN32) -# include "../common/winapi.h" + #include "../common/winapi.h" #elif defined(HAVE_GETPID) || defined(HAVE_GETTID) -# include -# include + #include + #include #endif +#include // time +#include // init_genrand, genrand_int32, genrand_res53 /// Initializes the random number generator with an appropriate seed. diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 1dbcba282..14342fe5e 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -2,26 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - +#include "../common/cbasetypes.h" +#include "../common/strlib.h" // StringBuf #include "showmsg.h" +#include "core.h" //[Ind] - For SERVER_TYPE -#include #include -#include // atexit #include +#include #include +#include // atexit #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 +#include #endif // WIN32 #if defined(DEBUGLOGMAP) diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 5b32f39ae..49fbc34fb 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -5,14 +5,12 @@ #ifndef _COMMON_SHOWMSG_H_ #define _COMMON_SHOWMSG_H_ -#include - -#ifdef HERCULES_CORE -# include "../../3rdparty/libconfig/libconfig.h" -#else -# include "../common/HPMi.h" +#ifndef _COMMON_HPMI_H_ + #include "../../3rdparty/libconfig/libconfig.h" #endif +#include + // for help with the console colors look here: // http://www.edoceo.com/liberum/?doc=printf-with-color // some code explanation (used here): @@ -92,7 +90,7 @@ enum msg_type { }; extern void ClearScreen(void); -#ifdef HERCULES_CORE +#ifndef _COMMON_HPMI_H_ extern void ShowMessage(const char *, ...); extern void ShowStatus(const char *, ...); extern void ShowSQL(const char *, ...); @@ -103,18 +101,7 @@ extern void ClearScreen(void); extern void ShowError(const char *, ...); extern void ShowFatalError(const char *, ...); extern void ShowConfigWarning(config_setting_t *config, const char *string, ...); -#else - HPExport void (*ShowMessage) (const char *, ...); - HPExport void (*ShowStatus) (const char *, ...); - HPExport void (*ShowSQL) (const char *, ...); - HPExport void (*ShowInfo) (const char *, ...); - HPExport void (*ShowNotice) (const char *, ...); - HPExport void (*ShowWarning) (const char *, ...); - HPExport void (*ShowDebug) (const char *, ...); - HPExport void (*ShowError) (const char *, ...); - HPExport void (*ShowFatalError) (const char *, ...); #endif - extern int _vShowMessage(enum msg_type flag, const char *string, va_list ap); #endif /* _COMMON_SHOWMSG_H_ */ diff --git a/src/common/socket.c b/src/common/socket.c index 3738f2c2a..35d350e95 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -2,50 +2,48 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/mmo.h" +#include "../common/timer.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../config/core.h" +#include "../common/HPM.h" -#include "../config/core.h" // SHOW_SERVER_STATS #define _H_SOCKET_C_ + #include "socket.h" -#undef _H_SOCKET_C_ #include #include #include #include -#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 -# include -# include -# include -# include -# include -# include -# include -# include -# include - -# ifndef SIOCGIFCONF -# include // SIOCGIFCONF on Solaris, maybe others? [Shinomori] -# endif -# ifndef FIONBIO -# include // FIONBIO on Solaris [FlavioJS] -# endif - -# ifdef HAVE_SETRLIMIT -# include -# endif + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #ifndef SIOCGIFCONF + #include // SIOCGIFCONF on Solaris, maybe others? [Shinomori] + #endif + #ifndef FIONBIO + #include // FIONBIO on Solaris [FlavioJS] + #endif + + #ifdef HAVE_SETRLIMIT + #include + #endif #endif /** diff --git a/src/common/socket.h b/src/common/socket.h index 804b9284f..75adde4cf 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -5,19 +5,19 @@ #ifndef _COMMON_SOCKET_H_ #define _COMMON_SOCKET_H_ -#include - #include "../common/cbasetypes.h" #ifdef WIN32 -# include "../common/winapi.h" + #include "../common/winapi.h" typedef long in_addr_t; #else -# include -# include -# include + #include + #include + #include #endif +#include + struct HPluginData; #define FIFOSIZE_SERVERLINK 256*1024 diff --git a/src/common/spinlock.h b/src/common/spinlock.h index 0058e1d83..29fbb355b 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -1,3 +1,4 @@ +#pragma once #ifndef _COMMON_SPINLOCK_H_ #define _COMMON_SPINLOCK_H_ @@ -14,14 +15,14 @@ // // -#include "../common/atomic.h" -#include "../common/cbasetypes.h" -#include "../common/thread.h" - #ifdef WIN32 #include "../common/winapi.h" #endif +#include "../common/cbasetypes.h" +#include "../common/atomic.h" +#include "../common/thread.h" + #ifdef WIN32 typedef struct __declspec( align(64) ) SPIN_LOCK{ diff --git a/src/common/sql.c b/src/common/sql.c index aeb56bff0..79ccc8e92 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -2,23 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "sql.h" - -#include // strtoul -#include // 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 "sql.h" #ifdef WIN32 -# include "../common/winapi.h" // Needed before mysql.h +#include "../common/winapi.h" #endif #include +#include // strlen/strnlen/memcpy/memset +#include // strtoul void hercules_mysql_error_handler(unsigned int ecode); diff --git a/src/common/sql.h b/src/common/sql.h index 807e0843c..1fb436853 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -5,9 +5,10 @@ #ifndef _COMMON_SQL_H_ #define _COMMON_SQL_H_ +#include "../common/cbasetypes.h" #include // va_list -#include "../common/cbasetypes.h" + // Return codes #define SQL_ERROR (-1) diff --git a/src/common/strlib.c b/src/common/strlib.c index e2e802915..361595b07 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -2,19 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#define _H_STRLIB_C_ +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#define STRLIB_C #include "strlib.h" -#undef _H_STRLIB_C_ -#include #include #include +#include -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" #define J_MAX_MALLOC_SIZE 65535 diff --git a/src/common/strlib.h b/src/common/strlib.h index decf661a6..10844d257 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -5,16 +5,15 @@ #ifndef _COMMON_STRLIB_H_ #define _COMMON_STRLIB_H_ -#include - #include "../common/cbasetypes.h" +#include #ifndef __USE_GNU -# define __USE_GNU // required to enable strnlen on some platforms -# include -# undef __USE_GNU + #define __USE_GNU // required to enable strnlen on some platforms + #include + #undef __USE_GNU #else -# include + #include #endif #ifdef WIN32 @@ -166,7 +165,7 @@ struct sv_interface *sv; void strlib_defaults(void); /* the purpose of these macros is simply to not make calling them be an annoyance */ -#ifndef _H_STRLIB_C_ +#ifndef STRLIB_C #define jstrescape(pt) (strlib->jstrescape(pt)) #define jstrescapecpy(pt,spt) (strlib->jstrescapecpy((pt),(spt))) #define jmemescapecpy(pt,spt,size) (strlib->jmemescapecpy((pt),(spt),(size))) @@ -190,6 +189,6 @@ void strlib_defaults(void); #define safesnprintf(buf,sz,fmt,...) (strlib->safesnprintf((buf),(sz),(fmt),##__VA_ARGS__)) #define strline(str,pos) (strlib->strline((str),(pos))) #define bin2hex(output,input,count) (strlib->bin2hex((output),(input),(count))) -#endif /* _H_STRLIB_C_ */ +#endif /* STRLIB_C */ #endif /* _COMMON_STRLIB_H_ */ diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 3fdfadb41..a56896458 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -4,39 +4,23 @@ /// See sysinfo.h for a description of this file -#define HERCULES_CORE - +#define _COMMON_SYSINFO_P_ #include "sysinfo.h" - -#include // fopen -#include // atoi +#undef _COMMON_SYSINFO_P_ #include "../common/cbasetypes.h" #include "../common/core.h" -#include "../common/malloc.h" #include "../common/strlib.h" +#include "../common/malloc.h" #ifdef WIN32 -# include // strlen -# include +#include +#include // strlen #else -# include +#include #endif - -/// Private interface fields -struct sysinfo_private { - char *platform; - char *osversion; - char *cpu; - int cpucores; - char *arch; - char *compiler; - char *cflags; - char *vcstype_name; - int vcstype; - char *vcsrevision_src; - char *vcsrevision_scripts; -}; +#include // fopen +#include // atoi /// sysinfo.c interface source struct sysinfo_interface sysinfo_s; diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index c0c4d276a..17faac26b 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -13,7 +13,23 @@ #include "../common/cbasetypes.h" +#ifdef _COMMON_SYSINFO_P_ +struct sysinfo_private { + char *platform; + char *osversion; + char *cpu; + int cpucores; + char *arch; + char *compiler; + char *cflags; + char *vcstype_name; + int vcstype; + char *vcsrevision_src; + char *vcsrevision_scripts; +}; +#else struct sysinfo_private; +#endif /** * sysinfo.c interface diff --git a/src/common/thread.c b/src/common/thread.c index 4f73aa9b3..4d110f2dd 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -6,27 +6,24 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#define HERCULES_CORE - -#include "thread.h" - -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" - #ifdef WIN32 -# include "../common/winapi.h" -# define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) -# define __thread __declspec( thread ) +#include "../common/winapi.h" +#define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) +#define __thread __declspec( thread ) #else -# include -# include -# include -# include -# include -# include +#include +#include +#include +#include +#include +#include #endif +#include "cbasetypes.h" +#include "malloc.h" +#include "showmsg.h" +#include "thread.h" + // 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 887c03179..d6b2bbc6e 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -1,6 +1,7 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#pragma once #ifndef _COMMON_THREAD_H_ #define _COMMON_THREAD_H_ diff --git a/src/common/timer.c b/src/common/timer.c index 10f14b0f2..526854582 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -2,8 +2,11 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - +#include "../common/cbasetypes.h" +#include "../common/db.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "../common/utils.h" #include "timer.h" #include @@ -11,17 +14,11 @@ #include #include -#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 // struct timeval, gettimeofday() -# include +#include +#include // struct timeval, gettimeofday() #endif struct timer_interface timer_s; diff --git a/src/common/utils.c b/src/common/utils.c index 84925f707..47747dd32 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -2,35 +2,33 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - +#include "../common/cbasetypes.h" +#include "../common/mmo.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "../common/core.h" +#include "socket.h" #include "utils.h" -#include // floor() -#include #include +#include #include #include -#include // 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 // floor() #ifdef WIN32 -# include "../common/winapi.h" -# ifndef F_OK -# define F_OK 0x0 -# endif /* F_OK */ + #include "../common/winapi.h" + #ifndef F_OK + #define F_OK 0x0 + #endif /* F_OK */ #else -# include -# include -# include + #include + #include + #include #endif +#include // 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 823651163..f89546b8a 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -5,11 +5,10 @@ #ifndef _COMMON_UTILS_H_ #define _COMMON_UTILS_H_ +#include "../common/cbasetypes.h" #include // FILE* #include -#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/config/const.h b/src/config/const.h index f9baa4d7d..6557cb987 100644 --- a/src/config/const.h +++ b/src/config/const.h @@ -52,6 +52,13 @@ #define DEFTYPE_MAX CHAR_MAX #endif +/* pointer size fix which fixes several gcc warnings */ +#ifdef __64BIT__ + #define __64BPTRSIZE(y) ((intptr)(y)) +#else + #define __64BPTRSIZE(y) (y) +#endif + /* ATCMD_FUNC(mobinfo) HIT and FLEE calculations */ #ifdef RENEWAL #define MOB_FLEE(mobdata) ( (mobdata)->lv + (mobdata)->status.agi + 100 ) diff --git a/src/config/renewal.h b/src/config/renewal.h index 36bdd3958..36615d63b 100644 --- a/src/config/renewal.h +++ b/src/config/renewal.h @@ -74,6 +74,5 @@ #define RENEWAL_ASPD #endif // DISABLE_RENEWAL -#undef DISABLE_RENEWAL #endif // _CONFIG_RENEWAL_H_ diff --git a/src/login/account.h b/src/login/account.h index 329ae31c8..234e7c0c1 100644 --- a/src/login/account.h +++ b/src/login/account.h @@ -7,7 +7,6 @@ #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 2e4ed7ab9..1483196ab 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -2,22 +2,17 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // CONSOLE_INPUT -#include "account.h" - -#include -#include - -#include "../common/console.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/timer.h" +#include "../common/console.h" +#include "../common/socket.h" +#include "account.h" +#include +#include /// global defines #define ACCOUNT_SQL_DB_VERSION 20110114 @@ -657,7 +652,7 @@ Sql* account_db_sql_up(AccountDB* self) { AccountDB_SQL* db = (AccountDB_SQL*)self; Sql_HerculesUpdateCheck(db->accounts); #ifdef CONSOLE_INPUT - console->input->setSQL(db->accounts); + console->setSQL(db->accounts); #endif return db->accounts; } diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c index 081f28d84..74f45e418 100644 --- a/src/login/ipban_sql.c +++ b/src/login/ipban_sql.c @@ -2,15 +2,6 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "ipban.h" - -#include -#include - -#include "login.h" -#include "loginlog.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/malloc.h" @@ -18,6 +9,11 @@ #include "../common/socket.h" #include "../common/strlib.h" #include "../common/timer.h" +#include "login.h" +#include "ipban.h" +#include "loginlog.h" +#include +#include // global sql settings static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/login/login.c b/src/login/login.c index cb46e0226..af59fcf38 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -2,18 +2,6 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "login.h" - -#include -#include -#include - -#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" @@ -24,6 +12,15 @@ #include "../common/strlib.h" #include "../common/timer.h" #include "../common/utils.h" +#include "../common/HPM.h" +#include "account.h" +#include "ipban.h" +#include "login.h" +#include "loginlog.h" + +#include +#include +#include struct Login_Config login_config; diff --git a/src/login/login.h b/src/login/login.h index e77b96a0e..14c361a15 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 enum E_LOGINSERVER_ST { diff --git a/src/login/loginlog.h b/src/login/loginlog.h index a86ad431c..730fb6e62 100644 --- a/src/login/loginlog.h +++ b/src/login/loginlog.h @@ -4,7 +4,6 @@ #ifndef _LOGIN_LOGINLOG_H_ #define _LOGIN_LOGINLOG_H_ -#include "../common/cbasetypes.h" unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes); void login_log(uint32 ip, const char* username, int rcode, const char* message); @@ -12,4 +11,5 @@ bool loginlog_init(void); bool loginlog_final(void); bool loginlog_config_read(const char* w1, const char* w2); + #endif /* _LOGIN_LOGINLOG_H_ */ diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 2cbc02c93..231ac783b 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -2,18 +2,13 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "loginlog.h" - -#include -#include // exit - #include "../common/cbasetypes.h" #include "../common/mmo.h" #include "../common/socket.h" #include "../common/sql.h" #include "../common/strlib.h" +#include +#include // exit // global sql settings (in ipban_sql.c) static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c index cb8c979c6..061479d87 100644 --- a/src/map/HPMmap.c +++ b/src/map/HPMmap.c @@ -1,15 +1,25 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "../common/HPM.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 "HPMmap.h" -#include -#include -#include -#include +#include "HPMmap.h" +#include "pc.h" +#include "map.h" +// #include "atcommand.h" #include "battle.h" #include "battleground.h" @@ -27,14 +37,12 @@ #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" @@ -46,19 +54,11 @@ #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 +#include +#include +#include #include "../common/HPMDataCheck.h" diff --git a/src/map/atcommand.c b/src/map/atcommand.c index df3be40a5..5fd0faf86 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2,60 +2,57 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/mmo.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/core.h" +#include "../common/showmsg.h" +#include "../common/malloc.h" +#include "../common/random.h" +#include "../common/socket.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/conf.h" +#include "../common/sysinfo.h" -#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_CARTS, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP #include "atcommand.h" - -#include -#include -#include -#include - #include "battle.h" #include "chat.h" -#include "chrif.h" #include "clif.h" +#include "chrif.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 "status.h" +#include "skill.h" +#include "mob.h" +#include "npc.h" #include "pet.h" -#include "quest.h" +#include "homunculus.h" +#include "mail.h" +#include "mercenary.h" +#include "elemental.h" +#include "party.h" +#include "guild.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" -#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 "mapreg.h" +#include "quest.h" +#include "searchstore.h" #include "HPMmap.h" +#include +#include +#include +#include + 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 c8a1863af..bc4ab30a3 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 "pc_groups.h" /** * Declarations diff --git a/src/map/battle.c b/src/map/battle.c index 0865ee4ba..9089b7102 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2,44 +2,41 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 "battle.h" - -#include -#include -#include -#include - -#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/timer.h" #include "../common/nullpo.h" -#include "../common/random.h" +#include "../common/malloc.h" #include "../common/showmsg.h" +#include "../common/ers.h" +#include "../common/random.h" #include "../common/socket.h" #include "../common/strlib.h" -#include "../common/sysinfo.h" -#include "../common/timer.h" #include "../common/utils.h" +#include "../common/sysinfo.h" +#include "../common/HPM.h" + +#include "map.h" +#include "path.h" +#include "pc.h" +#include "status.h" +#include "skill.h" +#include "homunculus.h" +#include "mercenary.h" +#include "elemental.h" +#include "mob.h" +#include "itemdb.h" +#include "clif.h" +#include "pet.h" +#include "guild.h" +#include "party.h" +#include "battle.h" +#include "battleground.h" +#include "chrif.h" + +#include +#include +#include +#include struct Battle_Config battle_config; struct battle_interface battle_s; diff --git a/src/map/battle.h b/src/map/battle.h index fbe097c78..88038ddb4 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.h" //ELE_MAX /** * Declarations diff --git a/src/map/battleground.c b/src/map/battleground.c index a7169de0e..68539e25d 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -2,32 +2,29 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/timer.h" +#include "../common/malloc.h" +#include "../common/nullpo.h" +#include "../common/showmsg.h" +#include "../common/socket.h" +#include "../common/strlib.h" +#include "../common/conf.h" #include "battleground.h" - -#include -#include - #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 "party.h" #include "pet.h" -#include "../common/cbasetypes.h" -#include "../common/conf.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 "homunculus.h" +#include "mercenary.h" +#include "mapreg.h" + +#include +#include struct battleground_interface bg_s; diff --git a/src/map/battleground.h b/src/map/battleground.h index ec0a86f14..05c4eb060 100644 --- a/src/map/battleground.h +++ b/src/map/battleground.h @@ -5,9 +5,9 @@ #ifndef _MAP_BATTLEGROUND_H_ #define _MAP_BATTLEGROUND_H_ +#include "../common/mmo.h" // struct party #include "clif.h" #include "guild.h" -#include "../common/mmo.h" // struct party /** * Defines diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 80264b30d..2a15e66fc 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -2,21 +2,18 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 "atcommand.h" // msg_txt +#include "battle.h" // battle_config.* +#include "buyingstore.h" // struct s_buyingstore +#include "clif.h" // clif->buyingstore_* +#include "log.h" // log_pick_pc, log_zeny +#include "pc.h" // struct map_session_data +#include "chrif.h" struct buyingstore_interface buyingstore_s; diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h index 914631872..5141a1013 100644 --- a/src/map/buyingstore.h +++ b/src/map/buyingstore.h @@ -5,11 +5,6 @@ #ifndef _MAP_BUYINGSTORE_H_ #define _MAP_BUYINGSTORE_H_ -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // MAX_SLOTS - -struct map_session_data; - /** * Declarations **/ diff --git a/src/map/chat.c b/src/map/chat.c index c9d3e6d46..08fc4a575 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -2,13 +2,12 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "chat.h" - -#include -#include - +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/nullpo.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/mmo.h" #include "atcommand.h" // msg_txt() #include "battle.h" // struct battle_config #include "clif.h" @@ -16,12 +15,10 @@ #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" +#include "chat.h" + +#include +#include struct chat_interface chat_s; diff --git a/src/map/chat.h b/src/map/chat.h index cbc2a391e..b0c6cd905 100644 --- a/src/map/chat.h +++ b/src/map/chat.h @@ -6,12 +6,9 @@ #define _MAP_CHAT_H_ #include "map.h" // struct block_list, CHATROOM_TITLE_SIZE -#include "../common/cbasetypes.h" -#include "../common/db.h" -struct chat_data; struct map_session_data; -struct npc_data; +struct chat_data; #define MAX_CHAT_USERS 20 diff --git a/src/map/chrif.c b/src/map/chrif.c index 81e2d387c..99a1935fd 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -2,16 +2,15 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT -#include "chrif.h" - -#include -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/ers.h" +#include "../common/HPM.h" #include "map.h" #include "battle.h" @@ -26,17 +25,15 @@ #include "instance.h" #include "mercenary.h" #include "elemental.h" +#include "chrif.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" + +#include +#include +#include +#include +#include struct chrif_interface chrif_s; diff --git a/src/map/chrif.h b/src/map/chrif.h index 84efc66d3..25e955604 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -5,11 +5,9 @@ #ifndef _MAP_CHRIF_H_ #define _MAP_CHRIF_H_ +#include "../common/cbasetypes.h" #include - #include "map.h" //TBL_stuff -#include "../common/cbasetypes.h" -#include "../common/db.h" struct status_change_entry; diff --git a/src/map/clif.c b/src/map/clif.c index cb2474961..1a6665307 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2,59 +2,56 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // ANTI_MAYAP_CHEAT, NEW_CARTS, RENEWAL, SECURE_NPCTIMEOUT -#include "clif.h" - -#include -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/grfio.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 "../common/ers.h" +#include "../common/conf.h" +#include "../common/HPM.h" +#include "map.h" +#include "chrif.h" +#include "pc.h" +#include "status.h" +#include "npc.h" +#include "itemdb.h" +#include "chat.h" +#include "trade.h" +#include "storage.h" +#include "script.h" +#include "skill.h" #include "atcommand.h" +#include "intif.h" #include "battle.h" #include "battleground.h" -#include "chat.h" -#include "chrif.h" -#include "elemental.h" +#include "mob.h" +#include "party.h" +#include "unit.h" #include "guild.h" +#include "vending.h" +#include "pet.h" #include "homunculus.h" #include "instance.h" -#include "intif.h" -#include "irc-bot.h" -#include "itemdb.h" +#include "mercenary.h" +#include "elemental.h" #include "log.h" +#include "clif.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/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 "irc-bot.h" + +#include +#include +#include +#include +#include struct clif_interface clif_s; diff --git a/src/map/clif.h b/src/map/clif.h index 7b27e1fe6..0f4a9e756 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -5,13 +5,13 @@ #ifndef _MAP_CLIF_H_ #define _MAP_CLIF_H_ -#include - -#include "map.h" -#include "packets_struct.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/mmo.h" +#include "../common/socket.h" +#include "../map/map.h" +#include "../map/packets_struct.h" +#include /** * Declarations @@ -20,6 +20,7 @@ struct item; struct item_data; struct storage_data; struct guild_storage; +struct block_list; struct unit_data; struct map_session_data; struct homun_data; diff --git a/src/map/date.c b/src/map/date.c index 975a00c50..f38ead858 100644 --- a/src/map/date.c +++ b/src/map/date.c @@ -1,14 +1,10 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#define HERCULES_CORE - +#include "../common/cbasetypes.h" #include "date.h" - #include -#include "../common/cbasetypes.h" - int date_get_year(void) { time_t t; diff --git a/src/map/date.h b/src/map/date.h index b3ed59b2f..46f0d86c3 100644 --- a/src/map/date.h +++ b/src/map/date.h @@ -4,8 +4,6 @@ #ifndef _MAP_DATE_H_ #define _MAP_DATE_H_ -#include "../common/cbasetypes.h" - int date_get_year(void); int date_get_month(void); int date_get_day(void); diff --git a/src/map/duel.c b/src/map/duel.c index a423ef240..af2741f77 100644 --- a/src/map/duel.c +++ b/src/map/duel.c @@ -2,20 +2,18 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "atcommand.h" // msg_txt +#include "clif.h" #include "duel.h" +#include "pc.h" #include #include #include #include -#include "atcommand.h" // msg_txt -#include "clif.h" -#include "pc.h" -#include "../common/cbasetypes.h" - /*========================================== * Duel organizing functions [LuzZza] *------------------------------------------*/ diff --git a/src/map/duel.h b/src/map/duel.h index 956aed36d..5405d2eee 100644 --- a/src/map/duel.h +++ b/src/map/duel.h @@ -5,10 +5,6 @@ #ifndef _MAP_DUEL_H_ #define _MAP_DUEL_H_ -#include "../common/cbasetypes.h" - -struct map_session_data; - struct duel { int members_count; int invites_count; diff --git a/src/map/elemental.c b/src/map/elemental.c index 323df41e1..f335600d6 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -2,44 +2,42 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "elemental.h" - -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/mmo.h" +#include "../common/showmsg.h" +#include "../common/utils.h" +#include "../common/random.h" +#include "../common/strlib.h" -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" +#include "log.h" #include "clif.h" -#include "guild.h" +#include "chrif.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 "status.h" +#include "skill.h" +#include "mob.h" #include "pet.h" +#include "battle.h" +#include "party.h" +#include "guild.h" +#include "atcommand.h" #include "script.h" -#include "skill.h" -#include "status.h" +#include "npc.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" +#include "elemental.h" + +#include +#include +#include +#include struct elemental_interface elemental_s; diff --git a/src/map/elemental.h b/src/map/elemental.h index aa27aadc9..6d04a41a5 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -7,7 +7,6 @@ #include "status.h" // struct status_data, struct status_change #include "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 69f67238d..fa5805c8b 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -2,37 +2,34 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // GP_BOUND_ITEMS -#include "guild.h" - -#include -#include -#include - -#include "battle.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/timer.h" +#include "../common/nullpo.h" #include "../common/malloc.h" #include "../common/mapindex.h" -#include "../common/nullpo.h" #include "../common/showmsg.h" +#include "../common/ers.h" #include "../common/strlib.h" -#include "../common/timer.h" #include "../common/utils.h" +#include "../common/HPM.h" + +#include "map.h" +#include "guild.h" +#include "storage.h" +#include "battle.h" +#include "npc.h" +#include "pc.h" +#include "status.h" +#include "mob.h" +#include "intif.h" +#include "clif.h" +#include "skill.h" +#include "log.h" +#include "instance.h" + +#include +#include +#include struct guild_interface guild_s; diff --git a/src/map/guild.h b/src/map/guild.h index 34e27a56c..b03bd664d 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -5,10 +5,18 @@ #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 "../common/mmo.h" +#include "map.h" // NAME_LENGTH + +/** + * Declarations + **/ +struct guild; +struct guild_member; +struct guild_position; +struct guild_castle; +struct map_session_data; +struct mob_data; /** * Defines diff --git a/src/map/homunculus.c b/src/map/homunculus.c index b6a83d1cb..ff9f7a5b1 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -2,45 +2,43 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // DBPATH -#include "homunculus.h" - -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/mmo.h" +#include "../common/random.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" +#include "log.h" #include "clif.h" -#include "guild.h" +#include "chrif.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 "status.h" +#include "skill.h" +#include "mob.h" #include "pet.h" +#include "battle.h" +#include "party.h" +#include "guild.h" +#include "atcommand.h" #include "script.h" -#include "skill.h" -#include "status.h" +#include "npc.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" + +#include "homunculus.h" + +#include +#include +#include +#include struct homunculus_interface homunculus_s; diff --git a/src/map/homunculus.h b/src/map/homunculus.h index 9eef6af5b..e6d59e30e 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -5,10 +5,9 @@ #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 "pc.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 5789d7dd6..caf622b3d 100644 --- a/src/map/instance.c +++ b/src/map/instance.c @@ -2,32 +2,30 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/malloc.h" +#include "../common/nullpo.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/db.h" +#include "../common/HPM.h" +#include "clif.h" #include "instance.h" +#include "map.h" +#include "npc.h" +#include "party.h" +#include "pc.h" -#include #include #include #include +#include #include -#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 ae649eda7..712a0f141 100644 --- a/src/map/instance.h +++ b/src/map/instance.h @@ -6,11 +6,8 @@ #define _MAP_INSTANCE_H_ #include "script.h" // struct reg_db -#include "../common/cbasetypes.h" #include "../common/mmo.h" // struct point - struct block_list; -struct map_session_data; #define INSTANCE_NAME_LENGTH (60+1) diff --git a/src/map/intif.c b/src/map/intif.c index 383150fbc..6bd24368a 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1,40 +1,37 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#define HERCULES_CORE - -#include "../config/core.h" // GP_BOUND_ITEMS -#include "intif.h" - -#include -#include -#include -#include -#include -#include - -#include "atcommand.h" +#include "../common/showmsg.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/malloc.h" +#include "../common/strlib.h" +#include "map.h" #include "battle.h" #include "chrif.h" #include "clif.h" -#include "elemental.h" -#include "guild.h" -#include "homunculus.h" +#include "pc.h" +#include "intif.h" #include "log.h" -#include "mail.h" -#include "map.h" -#include "mercenary.h" +#include "storage.h" #include "party.h" -#include "pc.h" +#include "guild.h" #include "pet.h" +#include "atcommand.h" +#include "mercenary.h" +#include "homunculus.h" +#include "elemental.h" +#include "mail.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" + +#include +#include +#include +#include +#include +#include + struct intif_interface intif_s; diff --git a/src/map/intif.h b/src/map/intif.h index b6ee727f3..290dcfcdc 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -5,22 +5,19 @@ #ifndef _MAP_INTIF_H_ #define _MAP_INTIF_H_ -#include "../common/cbasetypes.h" /** * Declarations **/ -struct auction_data; +struct party_member; struct guild_member; struct guild_position; -struct guild_storage; -struct mail_message; -struct map_session_data; -struct party_member; -struct s_elemental; +struct s_pet; struct s_homunculus; struct s_mercenary; -struct s_pet; +struct s_elemental; +struct mail_message; +struct auction_data; /** * Defines diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c index 6f016697f..ff28082e7 100644 --- a/src/map/irc-bot.c +++ b/src/map/irc-bot.c @@ -2,25 +2,23 @@ // See the LICENSE file // Base Author: shennetsind @ http://hercules.ws -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/strlib.h" +#include "../common/showmsg.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/random.h" +#include "map.h" +#include "pc.h" +#include "clif.h" #include "irc-bot.h" #include #include #include -#include "clif.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 60f03fca5..c15a5d46a 100644 --- a/src/map/irc-bot.h +++ b/src/map/irc-bot.h @@ -6,8 +6,6 @@ #ifndef _MAP_IRC_BOT_H_ #define _MAP_IRC_BOT_H_ -#include "../common/cbasetypes.h" - #define IRC_NICK_LENGTH 40 #define IRC_IDENT_LENGTH 40 #define IRC_HOST_LENGTH 63 diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 1981f435c..5eeb90be5 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2,27 +2,22 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // DBPATH, RENEWAL -#include "itemdb.h" - -#include -#include -#include - -#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/conf.h" -#include "../common/malloc.h" #include "../common/nullpo.h" +#include "../common/malloc.h" #include "../common/random.h" #include "../common/showmsg.h" #include "../common/strlib.h" #include "../common/utils.h" +#include "../common/conf.h" +#include "itemdb.h" +#include "map.h" +#include "battle.h" // struct battle_config +#include "script.h" // item script processing +#include "pc.h" // W_MUSICAL, W_WHIP + +#include +#include +#include struct itemdb_interface itemdb_s; diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 12766b288..77fb2e2ec 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -5,12 +5,9 @@ #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.h" /** * Declarations diff --git a/src/map/log.c b/src/map/log.c index 523ef1d65..19a98f34b 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -2,24 +2,21 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "log.h" - -#include -#include -#include - +#include "../common/cbasetypes.h" +#include "../common/sql.h" // SQL_INNODB +#include "../common/strlib.h" +#include "../common/nullpo.h" +#include "../common/showmsg.h" #include "battle.h" #include "itemdb.h" +#include "log.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 +#include +#include struct log_interface log_s; diff --git a/src/map/log.h b/src/map/log.h index ecfedeac2..b2cb92c20 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -11,10 +11,11 @@ /** * Declarations **/ -struct item; -struct item_data; +struct block_list; struct map_session_data; struct mob_data; +struct item; +struct item_data; /** * Defines diff --git a/src/map/mail.c b/src/map/mail.c index 7ba7d7470..371aa892f 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -2,20 +2,18 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/nullpo.h" +#include "../common/showmsg.h" #include "mail.h" - -#include -#include - #include "atcommand.h" -#include "clif.h" #include "itemdb.h" -#include "log.h" +#include "clif.h" #include "pc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" +#include "log.h" + +#include +#include struct mail_interface mail_s; diff --git a/src/map/mail.h b/src/map/mail.h index 30b032ef4..8df537ff3 100644 --- a/src/map/mail.h +++ b/src/map/mail.h @@ -5,11 +5,7 @@ #ifndef _MAP_MAIL_H_ #define _MAP_MAIL_H_ -#include "../common/cbasetypes.h" - -struct item; -struct mail_message; -struct map_session_data; +#include "../common/mmo.h" struct mail_interface { void (*clear) (struct map_session_data *sd); diff --git a/src/map/map.c b/src/map/map.c index 01d3dbb9f..315924e2e 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2,66 +2,62 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/core.h" +#include "../common/timer.h" +#include "../common/ers.h" +#include "../common/grfio.h" +#include "../common/malloc.h" +#include "../common/socket.h" // WFIFO*() +#include "../common/showmsg.h" +#include "../common/nullpo.h" +#include "../common/random.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/conf.h" +#include "../common/console.h" +#include "../common/HPM.h" -#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL #include "map.h" - -#include -#include -#include -#include -#include - -#include "HPMmap.h" -#include "atcommand.h" -#include "battle.h" -#include "battleground.h" -#include "chat.h" +#include "path.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 "mob.h" +#include "npc.h" // npc_setcells(), npc_unsetcells() +#include "chat.h" +#include "itemdb.h" #include "storage.h" +#include "skill.h" #include "trade.h" +#include "party.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" +#include "battle.h" +#include "battleground.h" +#include "quest.h" +#include "script.h" +#include "mapreg.h" +#include "guild.h" +#include "pet.h" +#include "homunculus.h" +#include "instance.h" +#include "mercenary.h" +#include "elemental.h" +#include "atcommand.h" +#include "log.h" +#include "mail.h" +#include "irc-bot.h" +#include "HPMmap.h" +#include +#include +#include +#include +#include #ifndef _WIN32 #include #endif @@ -5486,8 +5482,8 @@ void map_cp_defaults(void) { map->cpsd->bl.y = MAP_DEFAULT_Y; map->cpsd->bl.m = map->mapname2mapid(MAP_DEFAULT); - console->input->addCommand("gm:info",CPCMD_A(gm_position)); - console->input->addCommand("gm:use",CPCMD_A(gm_use)); + console->addCommand("gm:info",CPCMD_A(gm_position)); + console->addCommand("gm:use",CPCMD_A(gm_use)); #endif } /* Hercules Plugin Mananger */ @@ -5843,7 +5839,7 @@ int do_init(int argc, char *argv[]) Sql_HerculesUpdateCheck(map->mysql_handle); #ifdef CONSOLE_INPUT - console->input->setSQL(map->mysql_handle); + console->setSQL(map->mysql_handle); #endif ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map->port); diff --git a/src/map/map.h b/src/map/map.h index 539b02ed8..c61868b13 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -5,18 +5,18 @@ #ifndef _MAP_MAP_H_ #define _MAP_MAP_H_ -#include - -#include "atcommand.h" #include "../common/cbasetypes.h" #include "../common/core.h" // CORE_ST_LAST #include "../common/mmo.h" #include "../common/mapindex.h" #include "../common/db.h" +#include "../config/core.h" #include "../common/sql.h" +#include "atcommand.h" +#include -struct mob_data; struct npc_data; +struct item_data; struct hChSysCh; enum E_MAPSERVER_ST { @@ -36,6 +36,7 @@ enum E_MAPSERVER_ST { #define NATURAL_HEAL_INTERVAL 500 #define MIN_FLOORITEM 2 #define MAX_FLOORITEM START_ACCOUNT_NUM +#define MAX_LEVEL 175 #define MAX_IGNORE_LIST 20 // official is 14 #define MAX_VENDING 12 #define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo] diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index f026fde00..61c25f24e 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -2,15 +2,6 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "mapreg.h" - -#include -#include - -#include "map.h" // map->mysql_handle -#include "script.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/ers.h" @@ -19,6 +10,11 @@ #include "../common/sql.h" #include "../common/strlib.h" #include "../common/timer.h" +#include "map.h" // map->mysql_handle +#include "script.h" +#include "mapreg.h" +#include +#include struct mapreg_interface mapreg_s; diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 26bc8c188..495621014 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -2,44 +2,42 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "mercenary.h" - -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/mmo.h" +#include "../common/random.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" +#include "log.h" #include "clif.h" -#include "guild.h" +#include "chrif.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 "status.h" +#include "skill.h" +#include "mob.h" #include "pet.h" +#include "battle.h" +#include "party.h" +#include "guild.h" +#include "atcommand.h" #include "script.h" -#include "skill.h" -#include "status.h" +#include "npc.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" +#include "mercenary.h" + +#include +#include +#include +#include struct mercenary_interface mercenary_s; diff --git a/src/map/mercenary.h b/src/map/mercenary.h index b998ac006..dd9266b2e 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -6,7 +6,6 @@ #include "status.h" // struct status_data, struct status_change #include "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 11ac74621..8f12d4b1b 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2,49 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP -#include "mob.h" - -#include -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/timer.h" +#include "../common/db.h" +#include "../common/nullpo.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "../common/ers.h" +#include "../common/random.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/socket.h" -#include "atcommand.h" -#include "battle.h" +#include "map.h" +#include "path.h" #include "clif.h" -#include "date.h" +#include "intif.h" +#include "pc.h" +#include "pet.h" +#include "status.h" +#include "mob.h" +#include "homunculus.h" +#include "mercenary.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 "skill.h" +#include "battle.h" #include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" -#include "quest.h" +#include "npc.h" +#include "log.h" #include "script.h" -#include "skill.h" -#include "status.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 "atcommand.h" +#include "date.h" +#include "quest.h" + +#include +#include +#include +#include +#include struct mob_interface mob_s; diff --git a/src/map/mob.h b/src/map/mob.h index d07f78c77..80175b1db 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -5,11 +5,12 @@ #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 "guild.h" // struct guardian_data +#include "map.h" // struct status_data, struct view_data, struct mob_skill +#include "status.h" // struct status data, struct status_change +#include "unit.h" // unit_stop_walking(), unit_stop_attack() +#include "npc.h" #define MAX_RANDOMMONSTER 5 diff --git a/src/map/npc.c b/src/map/npc.c index 8e5854dbf..20b500630 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2,44 +2,41 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 "npc.h" - -#include -#include -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/ers.h" +#include "../common/db.h" +#include "../common/socket.h" +#include "../common/HPM.h" -#include "battle.h" -#include "chat.h" +#include "map.h" +#include "log.h" #include "clif.h" -#include "instance.h" #include "intif.h" +#include "pc.h" +#include "status.h" #include "itemdb.h" -#include "log.h" -#include "map.h" +#include "script.h" #include "mob.h" -#include "pc.h" #include "pet.h" -#include "script.h" +#include "instance.h" +#include "battle.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" +#include "npc.h" +#include "chat.h" + +#include +#include +#include +#include +#include +#include struct npc_interface npc_s; diff --git a/src/map/npc.h b/src/map/npc.h index 6e9686d33..c154b14d0 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -8,10 +8,10 @@ #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" struct HPluginData; +struct block_list; +struct npc_data; struct view_data; enum npc_parse_options { diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index f245ffea5..9d5639efc 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -2,27 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - #ifdef PCRE_SUPPORT +#include "../common/timer.h" +#include "../common/malloc.h" +#include "../common/nullpo.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" + +#include "mob.h" // struct mob_data #include "npc.h" // struct npc_data +#include "pc.h" // struct map_session_data +#include "script.h" // set_var() + +#include "../../3rdparty/pcre/include/pcre.h" -#include #include #include #include - -#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" +#include /** * interface sources diff --git a/src/map/party.c b/src/map/party.c index 7c49e241c..cf5e7bbe3 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -2,37 +2,34 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/timer.h" +#include "../common/socket.h" // last_tick +#include "../common/nullpo.h" +#include "../common/malloc.h" +#include "../common/random.h" +#include "../common/showmsg.h" +#include "../common/utils.h" +#include "../common/strlib.h" +#include "../common/HPM.h" -#include "../config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP #include "party.h" - -#include -#include -#include - #include "atcommand.h" //msg_txt() -#include "battle.h" -#include "clif.h" +#include "pc.h" +#include "map.h" #include "instance.h" +#include "battle.h" #include "intif.h" -#include "itemdb.h" +#include "clif.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" +#include "itemdb.h" + +#include +#include +#include + struct party_interface party_s; diff --git a/src/map/party.h b/src/map/party.h index 3bad22b13..ed8289af6 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -5,12 +5,11 @@ #ifndef _MAP_PARTY_H_ #define _MAP_PARTY_H_ +#include "../common/mmo.h" // struct party +#include "../config/core.h" #include -#include "map.h" // TBL_PC -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/mmo.h" // struct party +#include "map.h" #define PARTY_BOOKING_JOBS 6 #define PARTY_BOOKING_RESULTS 10 diff --git a/src/map/path.c b/src/map/path.c index d02e9ee4a..ae9fc389d 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -2,16 +2,6 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA -#include "path.h" - -#include -#include -#include - -#include "map.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/malloc.h" @@ -19,6 +9,13 @@ #include "../common/random.h" #include "../common/showmsg.h" +#include "path.h" +#include "map.h" + +#include +#include +#include + #define SET_OPEN 0 #define SET_CLOSED 1 diff --git a/src/map/path.h b/src/map/path.h index b48ff05fb..0b67a0120 100644 --- a/src/map/path.h +++ b/src/map/path.h @@ -6,7 +6,6 @@ #define _MAP_PATH_H_ #include "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 45adfe22a..c8fb14e55 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2,16 +2,21 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/core.h" // get_svn_revision() +#include "../common/malloc.h" +#include "../common/nullpo.h" +#include "../common/random.h" +#include "../common/showmsg.h" +#include "../common/socket.h" // session[] +#include "../common/strlib.h" // safestrncpy() +#include "../common/timer.h" +#include "../common/utils.h" +#include "../common/conf.h" +#include "../common/mmo.h" //NAME_LENGTH +#include "../common/sysinfo.h" -#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_CARTS, MAX_SPIRITBALL, NEW_CARTS, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT #include "pc.h" - -#include -#include -#include -#include - #include "atcommand.h" // get_atcommand_level() #include "battle.h" // battle_config #include "battleground.h" @@ -20,40 +25,32 @@ #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 "path.h" +#include "homunculus.h" +#include "instance.h" #include "mercenary.h" -#include "mob.h" // struct mob_data +#include "elemental.h" #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 "party.h" // party->search() +#include "guild.h" // guild->search(), guild_request_info() #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 -#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 "pc_groups.h" +#include "quest.h" + +#include +#include +#include +#include + struct pc_interface pc_s; @@ -10654,7 +10651,9 @@ void pc_defaults(void) { memset(pc->exp_table, 0, sizeof(pc->exp_table) + sizeof(pc->max_level) + sizeof(pc->statp) +#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) + sizeof(pc->level_penalty) +#endif + sizeof(pc->skill_tree) + sizeof(pc->smith_fame_list) + sizeof(pc->chemist_fame_list) diff --git a/src/map/pc.h b/src/map/pc.h index c4026a48d..70df9ca56 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 "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus +#include "../common/ers.h" +#include "../common/timer.h" // INVALID_TIMER +#include "atcommand.h" // AtCommandType #include "battle.h" // battle_config -#include "battleground.h" // enum bg_queue_types +#include "battleground.h" #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 "itemdb.h" +#include "log.h" +#include "map.h" // RC_MAX +#include "mob.h" +#include "pc_groups.h" +#include "script.h" // struct script_reg, struct script_regstr #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 "status.h" // OPTION_*, struct weapon_atk +#include "unit.h" // unit_stop_attack(), unit_stop_walking() #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 /** * Defines @@ -742,8 +742,9 @@ struct pc_interface { unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL]; unsigned int max_level[CLASS_COUNT][2]; unsigned int statp[MAX_LEVEL+1]; +#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1]; - +#endif unsigned int equip_pos[EQI_MAX]; /* */ struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE]; diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c index a917ef409..906462c7e 100644 --- a/src/map/pc_groups.c +++ b/src/map/pc_groups.c @@ -2,14 +2,6 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#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" @@ -18,6 +10,12 @@ #include "../common/showmsg.h" #include "../common/strlib.h" // strcmp +#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() + static GroupSettings dummy_group; ///< dummy group used in dummy map sessions @see pc_get_dummy_sd() struct pc_groups_interface pcg_s; diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h index 7c8cdd82a..5c03f999f 100644 --- a/src/map/pc_groups.h +++ b/src/map/pc_groups.h @@ -5,10 +5,6 @@ #ifndef _MAP_PC_GROUPS_H_ #define _MAP_PC_GROUPS_H_ -#include "../common/cbasetypes.h" -#include "../common/conf.h" -#include "../common/db.h" - /// PC permissions enum e_pc_permission { PC_PERM_NONE = 0, // #0 diff --git a/src/map/pet.c b/src/map/pet.c index aa2be4473..993497434 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -2,39 +2,37 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "pet.h" - -#include -#include -#include +#include "../common/db.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/malloc.h" +#include "../common/random.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/ers.h" -#include "atcommand.h" // msg_txt() -#include "battle.h" -#include "chrif.h" -#include "clif.h" +#include "pc.h" +#include "status.h" +#include "map.h" +#include "path.h" #include "intif.h" +#include "clif.h" +#include "chrif.h" +#include "pet.h" #include "itemdb.h" -#include "log.h" -#include "map.h" +#include "battle.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" +#include "atcommand.h" // msg_txt() +#include "log.h" + +#include +#include +#include struct pet_interface pet_s; diff --git a/src/map/pet.h b/src/map/pet.h index 8dde0fac2..4ec30b3fb 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -5,14 +5,8 @@ #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 - -#define MAX_PET_DB 300 -#define MAX_PETLOOT_SIZE 30 +#define MAX_PET_DB 300 +#define MAX_PETLOOT_SIZE 30 struct s_pet_db { short class_; diff --git a/src/map/quest.c b/src/map/quest.c index b76d6bc82..bde276f9d 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -2,37 +2,36 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/malloc.h" +#include "../common/nullpo.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "map.h" +#include "pc.h" +#include "npc.h" +#include "itemdb.h" +#include "script.h" +#include "intif.h" +#include "battle.h" +#include "mob.h" +#include "party.h" +#include "unit.h" +#include "log.h" +#include "clif.h" #include "quest.h" +#include "chrif.h" -#include #include #include #include +#include #include -#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/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 quest_interface quest_s; diff --git a/src/map/quest.h b/src/map/quest.h index 87894d639..e01e35619 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -5,10 +5,6 @@ #ifndef _MAP_QUEST_H_ #define _MAP_QUEST_H_ -#include "map.h" // TBL_PC -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // MAX_QUEST_OBJECTIVES - #define MAX_QUEST_DB (60355+1) // Highest quest ID + 1 struct quest_db { diff --git a/src/map/script.c b/src/map/script.c index 068be8524..4d77c506b 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2,46 +2,6 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // NEW_CARTS, 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 -#include -#include -#include - -#include "atcommand.h" -#include "battle.h" -#include "battleground.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" @@ -50,10 +10,47 @@ #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/sysinfo.h" + +#include "map.h" +#include "path.h" +#include "clif.h" +#include "chrif.h" +#include "itemdb.h" +#include "pc.h" +#include "status.h" +#include "storage.h" +#include "mob.h" +#include "npc.h" +#include "pet.h" +#include "mapreg.h" +#include "homunculus.h" +#include "instance.h" +#include "mercenary.h" +#include "intif.h" +#include "skill.h" +#include "status.h" +#include "chat.h" +#include "battle.h" +#include "battleground.h" +#include "party.h" +#include "guild.h" +#include "atcommand.h" +#include "log.h" +#include "unit.h" +#include "pet.h" +#include "mail.h" +#include "script.h" +#include "quest.h" +#include "elemental.h" +#include "../config/core.h" +#include +#include +#include +#include #ifndef WIN32 #include #endif diff --git a/src/map/script.h b/src/map/script.h index 899c745da..90b18d87f 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -5,19 +5,17 @@ #ifndef _MAP_SCRIPT_H_ #define _MAP_SCRIPT_H_ +#include "../common/strlib.h" //StringBuf +#include "../common/cbasetypes.h" +#include "map.h" //EVENT_NAME_LENGTH + #include #include -#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 **/ +struct map_session_data; struct eri; /** diff --git a/src/map/searchstore.c b/src/map/searchstore.c index 72b28aacd..0144aea93 100644 --- a/src/map/searchstore.c +++ b/src/map/searchstore.c @@ -2,17 +2,14 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 "battle.h" // battle_config.* +#include "clif.h" // clif->open_search_store_info, clif->search_store_info_* +#include "pc.h" // struct map_session_data +#include "searchstore.h" // struct s_search_store_info struct searchstore_interface searchstore_s; diff --git a/src/map/searchstore.h b/src/map/searchstore.h index c9b93ba54..827e39053 100644 --- a/src/map/searchstore.h +++ b/src/map/searchstore.h @@ -5,12 +5,6 @@ #ifndef _MAP_SEARCHSTORE_H_ #define _MAP_SEARCHSTORE_H_ -#include - -#include "map.h" // MESSAGE_SIZE -#include "../common/cbasetypes.h" -#include "../common/mmo.h" // MAX_SLOTS - /** * Defines **/ diff --git a/src/map/skill.c b/src/map/skill.c index b2e94ec79..c8388770a 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2,48 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION() -#include "skill.h" - -#include -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/malloc.h" +#include "../common/random.h" +#include "../common/showmsg.h" +#include "../common/strlib.h" +#include "../common/utils.h" +#include "../common/ers.h" -#include "battle.h" -#include "battleground.h" -#include "chrif.h" +#include "map.h" +#include "path.h" #include "clif.h" -#include "date.h" -#include "elemental.h" -#include "guild.h" +#include "pc.h" +#include "status.h" +#include "skill.h" +#include "pet.h" #include "homunculus.h" -#include "intif.h" -#include "itemdb.h" -#include "log.h" -#include "map.h" #include "mercenary.h" +#include "elemental.h" #include "mob.h" #include "npc.h" +#include "battle.h" +#include "battleground.h" #include "party.h" -#include "path.h" -#include "pc.h" -#include "pet.h" +#include "itemdb.h" #include "script.h" -#include "status.h" +#include "intif.h" +#include "log.h" +#include "chrif.h" +#include "guild.h" +#include "date.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" + +#include +#include +#include +#include +#include + #define SKILLUNITTIMER_INTERVAL 100 diff --git a/src/map/skill.h b/src/map/skill.h index b6dbb1fcb..dda310bd4 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -5,23 +5,19 @@ #ifndef _MAP_SKILL_H_ #define _MAP_SKILL_H_ -#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 "../common/db.h" +#include "map.h" // struct block_list /** * Declarations **/ -struct homun_data; struct map_session_data; -struct mercenary_data; +struct homun_data; struct skill_unit; -struct square; +struct skill_unit_group; struct status_change_entry; +struct square; /** * Defines diff --git a/src/map/status.c b/src/map/status.c index eb06138da..4c2bc6d22 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2,46 +2,43 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP -#include "status.h" - -#include -#include -#include -#include -#include -#include +#include "../common/cbasetypes.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/random.h" +#include "../common/showmsg.h" +#include "../common/malloc.h" +#include "../common/utils.h" +#include "../common/ers.h" +#include "../common/strlib.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 "npc.h" +#include "mob.h" +#include "clif.h" +#include "guild.h" #include "skill.h" +#include "itemdb.h" +#include "battle.h" +#include "chrif.h" #include "skill.h" +#include "status.h" +#include "script.h" #include "unit.h" +#include "homunculus.h" +#include "mercenary.h" +#include "elemental.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" + +#include +#include +#include +#include +#include +#include struct status_interface status_s; diff --git a/src/map/status.h b/src/map/status.h index baa586297..e47c2b365 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -5,18 +5,14 @@ #ifndef _MAP_STATUS_H_ #define _MAP_STATUS_H_ -#include "../config/core.h" // defType, NEW_CARTS, RENEWAL, RENEWAL_ASPD - -#include "../common/cbasetypes.h" #include "../common/mmo.h" struct block_list; -struct elemental_data; -struct homun_data; -struct mercenary_data; struct mob_data; -struct npc_data; struct pet_data; +struct homun_data; +struct mercenary_data; +struct status_change; //Change the equation when the values are high enough to discard the //imprecision in exchange of overflow protection [Skotlex] @@ -1882,7 +1878,11 @@ struct status_interface { int hp_coefficient2[CLASS_COUNT]; int hp_sigma_val[CLASS_COUNT][MAX_LEVEL+1]; int sp_coefficient[CLASS_COUNT]; - int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; // +1 for RENEWAL_ASPD +#ifdef RENEWAL_ASPD + int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; +#else + int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89] +#endif sc_type Skill2SCTable[MAX_SKILL]; // skill -> status int IconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) unsigned int ChangeFlagTable[SC_MAX]; // status -> flags diff --git a/src/map/storage.c b/src/map/storage.c index 2db5fff3d..e65ed7b80 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -2,29 +2,27 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/cbasetypes.h" +#include "../common/db.h" +#include "../common/nullpo.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" +#include "map.h" // struct map_session_data #include "storage.h" - -#include -#include -#include - -#include "atcommand.h" -#include "battle.h" #include "chrif.h" +#include "itemdb.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" -#include "../common/showmsg.h" +#include "guild.h" +#include "battle.h" +#include "atcommand.h" +#include "log.h" + +#include +#include +#include struct storage_interface storage_s; struct guild_storage_interface gstorage_s; diff --git a/src/map/storage.h b/src/map/storage.h index 5edb68cfc..8f9f904f6 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -5,12 +5,11 @@ #ifndef _MAP_STORAGE_H_ #define _MAP_STORAGE_H_ -#include "../common/cbasetypes.h" -#include "../common/db.h" - +struct storage_data; struct guild_storage; struct item; struct map_session_data; +struct DBMap; struct storage_interface { /* */ diff --git a/src/map/trade.c b/src/map/trade.c index 83426c407..44b669ebd 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -2,27 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE +#include "../common/nullpo.h" +#include "../common/socket.h" #include "trade.h" - -#include -#include - -#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 "npc.h" +#include "battle.h" +#include "chrif.h" #include "storage.h" -#include "../common/nullpo.h" -#include "../common/socket.h" +#include "intif.h" +#include "atcommand.h" +#include "log.h" + +#include +#include struct trade_interface trade_s; diff --git a/src/map/unit.c b/src/map/unit.c index 0ad770e80..151d4bad5 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2,48 +2,45 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "../config/core.h" // RENEWAL_CAST -#include "unit.h" - -#include -#include -#include +#include "../common/showmsg.h" +#include "../common/timer.h" +#include "../common/nullpo.h" +#include "../common/db.h" +#include "../common/malloc.h" +#include "../common/random.h" +#include "../common/HPM.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 "mob.h" #include "pet.h" -#include "script.h" +#include "homunculus.h" +#include "instance.h" +#include "mercenary.h" +#include "elemental.h" #include "skill.h" +#include "clif.h" +#include "duel.h" +#include "npc.h" +#include "guild.h" #include "status.h" -#include "storage.h" +#include "unit.h" +#include "battle.h" +#include "battleground.h" +#include "chat.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" +#include "party.h" +#include "intif.h" +#include "chrif.h" +#include "script.h" +#include "storage.h" + +#include +#include +#include + 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 9e05647b1..33fa4e052 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -5,13 +5,15 @@ #ifndef _MAP_UNIT_H_ #define _MAP_UNIT_H_ +//#include "map.h" +struct block_list; +struct unit_data; +struct map_session_data; + #include "clif.h" // clr_type +#include "map.h" // struct block_list #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" - -struct map_session_data; -struct block_list; +#include "skill.h" // struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset struct unit_data { struct block_list *bl; diff --git a/src/map/vending.c b/src/map/vending.c index c8ac814db..9462975b3 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -2,27 +2,24 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#define HERCULES_CORE - -#include "vending.h" - -#include -#include - -#include "atcommand.h" -#include "battle.h" -#include "chrif.h" +#include "../common/nullpo.h" +#include "../common/strlib.h" +#include "../common/utils.h" #include "clif.h" #include "itemdb.h" -#include "log.h" +#include "atcommand.h" #include "map.h" -#include "npc.h" #include "path.h" +#include "chrif.h" +#include "vending.h" #include "pc.h" +#include "npc.h" #include "skill.h" -#include "../common/nullpo.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#include "battle.h" +#include "log.h" + +#include +#include struct vending_interface vending_s; diff --git a/src/map/vending.h b/src/map/vending.h index a70726374..a212f8385 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -7,7 +7,6 @@ #include "../common/cbasetypes.h" #include "../common/db.h" - struct map_session_data; struct s_search_store_search; diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c index 96d51aec6..85d5fb548 100644 --- a/src/tool/mapcache.c +++ b/src/tool/mapcache.c @@ -1,14 +1,6 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#define HERCULES_CORE - -#include "../config/core.h" // RENEWAL - -#include -#include -#include - #include "../common/cbasetypes.h" #include "../common/grfio.h" #include "../common/malloc.h" @@ -16,6 +8,12 @@ #include "../common/showmsg.h" #include "../common/utils.h" +#include "../config/renewal.h" + +#include +#include +#include + #ifndef _WIN32 #include #endif -- cgit v1.2.3-70-g09d2 From 0ab52ac65bdba93be94e4149e267698d31b41d72 Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 10 May 2014 17:17:13 +0200 Subject: Re-commit of "Fixed order of includes in all source files" This reverts commit 94657284973f4037596bae468ebfbee5c217e02b. --- src/char/char.c | 44 +++++----- src/char/char.h | 1 - src/char/int_auction.c | 25 +++--- src/char/int_elemental.c | 22 +++-- src/char/int_elemental.h | 2 +- src/char/int_guild.c | 24 ++--- src/char/int_guild.h | 3 - src/char/int_homun.c | 21 +++-- src/char/int_homun.h | 2 + src/char/int_mail.c | 20 +++-- src/char/int_mail.h | 3 + src/char/int_mercenary.c | 22 +++-- src/char/int_mercenary.h | 4 +- src/char/int_party.c | 25 +++--- src/char/int_party.h | 2 - src/char/int_pet.c | 22 +++-- src/char/int_quest.c | 22 ++--- src/char/int_storage.c | 22 +++-- src/char/inter.c | 43 ++++----- src/char/inter.h | 5 +- src/char/pincode.c | 11 ++- src/common/HPM.c | 31 ++++--- src/common/HPM.h | 6 +- src/common/HPMi.h | 16 +--- src/common/cbasetypes.h | 6 ++ src/common/conf.c | 3 + src/common/conf.h | 1 + src/common/console.c | 223 ++++++++++++++++++++++++----------------------- src/common/console.h | 21 +++-- src/common/core.c | 38 ++++---- src/common/core.h | 3 +- src/common/db.c | 10 ++- src/common/db.h | 3 +- src/common/des.c | 7 +- src/common/ers.c | 8 +- src/common/grfio.c | 17 ++-- src/common/malloc.c | 11 ++- src/common/mapindex.c | 15 ++-- src/common/md5calc.c | 8 +- src/common/mmo.h | 6 +- src/common/mutex.c | 5 +- src/common/mutex.h | 1 + src/common/nullpo.c | 6 +- src/common/random.c | 18 ++-- src/common/showmsg.c | 17 ++-- src/common/showmsg.h | 23 +++-- src/common/socket.c | 64 +++++++------- src/common/socket.h | 12 +-- src/common/spinlock.h | 9 +- src/common/sql.c | 12 ++- src/common/sql.h | 3 +- src/common/strlib.c | 13 +-- src/common/strlib.h | 15 ++-- src/common/sysinfo.c | 32 +++++-- src/common/sysinfo.h | 16 ---- src/common/thread.c | 31 ++++--- src/common/thread.h | 1 - src/common/timer.c | 19 ++-- src/common/utils.c | 36 ++++---- src/common/utils.h | 3 +- src/config/const.h | 7 -- src/config/renewal.h | 1 + src/login/account.h | 1 + src/login/account_sql.c | 17 ++-- src/login/ipban_sql.c | 14 +-- src/login/login.c | 21 +++-- src/login/login.h | 2 +- src/login/loginlog.h | 2 +- src/login/loginlog_sql.c | 9 +- src/map/HPMmap.c | 42 ++++----- src/map/atcommand.c | 67 +++++++------- src/map/atcommand.h | 2 +- src/map/battle.c | 61 +++++++------ src/map/battle.h | 2 +- src/map/battleground.c | 33 +++---- src/map/battleground.h | 2 +- src/map/buyingstore.c | 17 ++-- src/map/buyingstore.h | 5 ++ src/map/chat.c | 23 ++--- src/map/chat.h | 5 +- src/map/chrif.c | 35 ++++---- src/map/chrif.h | 4 +- src/map/clif.c | 83 +++++++++--------- src/map/clif.h | 9 +- src/map/date.c | 6 +- src/map/date.h | 2 + src/map/duel.c | 10 ++- src/map/duel.h | 4 + src/map/elemental.c | 54 ++++++------ src/map/elemental.h | 1 + src/map/guild.c | 47 +++++----- src/map/guild.h | 16 +--- src/map/homunculus.c | 56 ++++++------ src/map/homunculus.h | 3 +- src/map/instance.c | 34 ++++---- src/map/instance.h | 3 + src/map/intif.c | 51 ++++++----- src/map/intif.h | 13 +-- src/map/irc-bot.c | 22 ++--- src/map/irc-bot.h | 2 + src/map/itemdb.c | 27 +++--- src/map/itemdb.h | 5 +- src/map/log.c | 23 ++--- src/map/log.h | 5 +- src/map/mail.c | 16 ++-- src/map/mail.h | 6 +- src/map/map.c | 96 ++++++++++---------- src/map/map.h | 9 +- src/map/mapreg_sql.c | 14 +-- src/map/mercenary.c | 54 ++++++------ src/map/mercenary.h | 1 + src/map/mob.c | 69 ++++++++------- src/map/mob.h | 9 +- src/map/npc.c | 57 ++++++------ src/map/npc.h | 4 +- src/map/npc_chat.c | 26 +++--- src/map/party.c | 43 ++++----- src/map/party.h | 7 +- src/map/path.c | 17 ++-- src/map/path.h | 1 + src/map/pc.c | 59 +++++++------ src/map/pc.h | 29 +++--- src/map/pc_groups.c | 14 +-- src/map/pc_groups.h | 4 + src/map/pet.c | 48 +++++----- src/map/pet.h | 10 ++- src/map/quest.c | 45 +++++----- src/map/quest.h | 4 + src/map/script.c | 79 +++++++++-------- src/map/script.h | 12 +-- src/map/searchstore.c | 11 ++- src/map/searchstore.h | 6 ++ src/map/skill.c | 64 +++++++------- src/map/skill.h | 14 +-- src/map/status.c | 59 +++++++------ src/map/status.h | 16 ++-- src/map/storage.c | 32 +++---- src/map/storage.h | 5 +- src/map/trade.c | 24 ++--- src/map/unit.c | 63 ++++++------- src/map/unit.h | 12 ++- src/map/vending.c | 27 +++--- src/map/vending.h | 1 + src/tool/mapcache.c | 14 +-- 144 files changed, 1676 insertions(+), 1367 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/char/char.c b/src/char/char.c index 77e393c0d..6c0902644 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -2,7 +2,30 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT +#include "char.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "int_elemental.h" +#include "int_guild.h" +#include "int_homun.h" +#include "int_mercenary.h" +#include "int_party.h" +#include "int_storage.h" +#include "inter.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" @@ -13,25 +36,6 @@ #include "../common/strlib.h" #include "../common/timer.h" #include "../common/utils.h" -#include "../common/console.h" -#include "../common/HPM.h" -#include "int_guild.h" -#include "int_homun.h" -#include "int_mercenary.h" -#include "int_elemental.h" -#include "int_party.h" -#include "int_storage.h" -#include "char.h" -#include "inter.h" -#include "pincode.h" - -#include -#include -#include -#include -#include -#include -#include // private declarations #define CHAR_CONF_NAME "conf/char-server.conf" @@ -5497,7 +5501,7 @@ int do_init(int argc, char **argv) { Sql_HerculesUpdateCheck(sql_handle); #ifdef CONSOLE_INPUT - console->setSQL(sql_handle); + console->input->setSQL(sql_handle); #endif ShowStatus("The char-server is "CL_GREEN"ready"CL_RESET" (Server is listening on the port %d).\n\n", char_port); diff --git a/src/char/char.h b/src/char/char.h index 2928929de..09a78f6b9 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -5,7 +5,6 @@ #ifndef _COMMON_CHAR_H_ #define _COMMON_CHAR_H_ -#include "../config/core.h" #include "../common/core.h" // CORE_ST_LAST #include "../common/db.h" diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 924930867..886b5be26 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -2,22 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" +#define HERCULES_CORE + +#include "int_auction.h" + +#include +#include +#include + +#include "char.h" +#include "int_mail.h" +#include "inter.h" #include "../common/db.h" +#include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" -#include "int_mail.h" -#include "int_auction.h" - -#include -#include -#include static DBMap* auction_db_ = NULL; // int auction_id -> struct auction_data* diff --git a/src/char/int_elemental.c b/src/char/int_elemental.c index ed0c2a9ed..3a36e75a2 100644 --- a/src/char/int_elemental.c +++ b/src/char/int_elemental.c @@ -2,20 +2,24 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_elemental.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" + bool mapif_elemental_save(struct s_elemental* ele) { bool flag = true; diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h index c90891fc4..c869e6fc2 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_ -struct s_elemental; +#include "../common/cbasetypes.h" void inter_elemental_sql_init(void); void inter_elemental_sql_final(void); diff --git a/src/char/int_guild.c b/src/char/int_guild.c index 895cbbb94..ffbe48e10 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -2,21 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // DBPATH +#include "int_guild.h" + +#include +#include +#include + +#include "char.h" +#include "inter.h" #include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/socket.h" #include "../common/db.h" +#include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" +#include "../common/socket.h" #include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" -#include "int_guild.h" - -#include -#include -#include #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 4eb7d310b..5e657ff06 100644 --- a/src/char/int_guild.h +++ b/src/char/int_guild.h @@ -20,9 +20,6 @@ enum { GS_REMOVE = 0x8000, }; -struct guild; -struct guild_castle; - int inter_guild_parse_frommap(int fd); int inter_guild_sql_init(void); void inter_guild_sql_final(void); diff --git a/src/char/int_homun.c b/src/char/int_homun.c index 143277f05..795a6b927 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -2,20 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_homun.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" int inter_homunculus_sql_init(void) { diff --git a/src/char/int_homun.h b/src/char/int_homun.h index 561dc848f..9477f4f03 100644 --- a/src/char/int_homun.h +++ b/src/char/int_homun.h @@ -4,6 +4,8 @@ #ifndef _CHAR_INT_HOMUN_H_ #define _CHAR_INT_HOMUN_H_ +#include "../common/cbasetypes.h" + struct s_homunculus; int inter_homunculus_sql_init(void); diff --git a/src/char/int_mail.c b/src/char/int_mail.c index 826771676..86a36d59f 100644 --- a/src/char/int_mail.c +++ b/src/char/int_mail.c @@ -2,19 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" +#define HERCULES_CORE + +#include "int_mail.h" + +#include +#include +#include + +#include "char.h" +#include "inter.h" #include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" - -#include -#include -#include static int mail_fromsql(int char_id, struct mail_data* md) { diff --git a/src/char/int_mail.h b/src/char/int_mail.h index 7c06cdc1f..824ba48a3 100644 --- a/src/char/int_mail.h +++ b/src/char/int_mail.h @@ -4,6 +4,9 @@ #ifndef _CHAR_INT_MAIL_H_ #define _CHAR_INT_MAIL_H_ +struct item; +struct mail_message; + int inter_mail_parse_frommap(int fd); void mail_sendmail(int send_id, const char* send_name, int dest_id, const char* dest_name, const char* title, const char* body, int zeny, struct item *item); diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c index aecb3844a..1dffb656c 100644 --- a/src/char/int_mercenary.c +++ b/src/char/int_mercenary.c @@ -2,20 +2,24 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_mercenary.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" + bool mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status) { char* data; diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h index b614b8cf7..195a83b34 100644 --- a/src/char/int_mercenary.h +++ b/src/char/int_mercenary.h @@ -4,7 +4,9 @@ #ifndef _CHAR_INT_MERCENARY_H_ #define _CHAR_INT_MERCENARY_H_ -struct s_mercenary; +#include "../common/cbasetypes.h" + +struct mmo_charstatus; int inter_mercenary_sql_init(void); void inter_mercenary_sql_final(void); diff --git a/src/char/int_party.c b/src/char/int_party.c index 7c328c452..3e4a743d6 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -2,23 +2,26 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/socket.h" -#include "../common/showmsg.h" -#include "../common/mapindex.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + #include "int_party.h" #include #include #include +#include "char.h" +#include "inter.h" +#include "../common/cbasetypes.h" +#include "../common/db.h" +#include "../common/malloc.h" +#include "../common/mapindex.h" +#include "../common/mmo.h" +#include "../common/showmsg.h" +#include "../common/socket.h" +#include "../common/sql.h" +#include "../common/strlib.h" + struct party_data { struct party party; unsigned int min_lv, max_lv; diff --git a/src/char/int_party.h b/src/char/int_party.h index 84f00635a..098c1e9a9 100644 --- a/src/char/int_party.h +++ b/src/char/int_party.h @@ -14,8 +14,6 @@ enum { PS_BREAK = 0x20, //Specify that this party must be deleted. }; -struct party; - int inter_party_parse_frommap(int fd); int inter_party_sql_init(void); void inter_party_sql_final(void); diff --git a/src/char/int_pet.c b/src/char/int_pet.c index 25f00e6f0..29c40eff9 100644 --- a/src/char/int_pet.c +++ b/src/char/int_pet.c @@ -2,20 +2,24 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/utils.h" -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "int_pet.h" #include #include #include +#include "char.h" +#include "inter.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/utils.h" + struct s_pet *pet_pt; //--------------------------------------------------------- diff --git a/src/char/int_quest.c b/src/char/int_quest.c index 061dd89d9..61b43c57d 100644 --- a/src/char/int_quest.c +++ b/src/char/int_quest.c @@ -2,23 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" +#define HERCULES_CORE + +#include "int_quest.h" + +#include +#include +#include + +#include "char.h" +#include "inter.h" #include "../common/db.h" #include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" #include "../common/socket.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/timer.h" -#include "char.h" -#include "inter.h" -#include "int_quest.h" - -#include -#include -#include - /** * Loads the entire questlog for a character. * diff --git a/src/char/int_storage.c b/src/char/int_storage.c index 966e61bb3..bf7b76da0 100644 --- a/src/char/int_storage.c +++ b/src/char/int_storage.c @@ -2,19 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" // StringBuf -#include "../common/sql.h" -#include "char.h" -#include "inter.h" +#define HERCULES_CORE + +#include "../config/core.h" // GP_BOUND_ITEMS +#include "int_storage.h" #include -#include #include +#include +#include "char.h" +#include "inter.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" // StringBuf #define STORAGE_MEMINC 16 diff --git a/src/char/inter.c b/src/char/inter.c index 515ca0ec4..972407ef3 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -2,33 +2,34 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "char.h" +#define HERCULES_CORE + #include "inter.h" -#include "int_party.h" -#include "int_guild.h" -#include "int_storage.h" -#include "int_pet.h" -#include "int_homun.h" -#include "int_mercenary.h" -#include "int_mail.h" -#include "int_auction.h" -#include "int_quest.h" -#include "int_elemental.h" +#include #include -#include #include -#include - +#include #include // for stat/lstat/fstat - [Dekamaster/Ultimate GM Tool] +#include "char.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 "../common/db.h" +#include "../common/malloc.h" +#include "../common/mmo.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 25b0c2a96..5e655237e 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -5,9 +5,10 @@ #ifndef _CHAR_INTER_H_ #define _CHAR_INTER_H_ -struct accreg; -#include "../common/sql.h" #include "char.h" +#include "../common/sql.h" + +struct accreg; int inter_init_sql(const char *file); void inter_final(void); diff --git a/src/char/pincode.c b/src/char/pincode.c index d51953448..59182f12d 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "pincode.h" + +#include + +#include "char.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 "pincode.h" - -#include int enabled = PINCODE_OK; int changetime = 0; diff --git a/src/common/HPM.c b/src/common/HPM.c index 9ffce87de..00b92dc60 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -1,26 +1,31 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT +#include "HPM.h" + +#include +#include +#include + #include "../common/cbasetypes.h" -#include "../common/mmo.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/timer.h" -#include "../common/conf.h" -#include "../common/utils.h" -#include "../common/console.h" -#include "../common/strlib.h" #include "../common/sql.h" +#include "../common/strlib.h" #include "../common/sysinfo.h" -#include "HPM.h" +#include "../common/timer.h" +#include "../common/utils.h" -#include -#include -#include #ifndef WIN32 -#include +# include #endif struct malloc_interface iMalloc_HPM; @@ -686,7 +691,7 @@ bool hplugins_parse_conf(const char *w1, const char *w2, enum HPluginConfType po void hplugins_share_defaults(void) { /* console */ #ifdef CONSOLE_INPUT - HPM->share(console->addCommand,"addCPCommand"); + HPM->share(console->input->addCommand,"addCPCommand"); #endif /* our own */ HPM->share(hplugins_addpacket,"addPacket"); @@ -755,7 +760,7 @@ void hpm_init(void) { HPM->symbol_defaults(); #ifdef CONSOLE_INPUT - console->addCommand("plugins",CPCMD_A(plugins)); + console->input->addCommand("plugins",CPCMD_A(plugins)); #endif return; } diff --git a/src/common/HPM.h b/src/common/HPM.h index 0f0df4cda..9c176cfd6 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -4,8 +4,12 @@ #ifndef _COMMON_HPM_H_ #define _COMMON_HPM_H_ -#include "../common/cbasetypes.h" +#ifndef HERCULES_CORE +#error You should never include HPM.h from a plugin. +#endif + #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 19206aeca..b98e87d90 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -5,8 +5,8 @@ #define _COMMON_HPMI_H_ #include "../common/cbasetypes.h" -#include "../common/core.h" #include "../common/console.h" +#include "../common/core.h" #include "../common/sql.h" struct script_state; @@ -20,18 +20,6 @@ struct map_session_data; #define HPExport #endif -#ifndef _COMMON_SHOWMSG_H_ - HPExport void (*ShowMessage) (const char *, ...); - HPExport void (*ShowStatus) (const char *, ...); - HPExport void (*ShowSQL) (const char *, ...); - HPExport void (*ShowInfo) (const char *, ...); - HPExport void (*ShowNotice) (const char *, ...); - HPExport void (*ShowWarning) (const char *, ...); - HPExport void (*ShowDebug) (const char *, ...); - HPExport void (*ShowError) (const char *, ...); - HPExport void (*ShowFatalError) (const char *, ...); -#endif - /* after */ #include "../common/showmsg.h" @@ -192,7 +180,7 @@ HPExport struct HPMi_interface { /* pc group permission */ void (*addPCGPermission) (unsigned int pluginID, char *name, unsigned int *mask); } HPMi_s; -#ifndef _COMMON_HPM_H_ +#ifndef HERCULES_CORE HPExport struct HPMi_interface *HPMi; #endif diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index f44e80413..da0d6b307 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -442,5 +442,11 @@ void SET_FUNCPOINTER(T1& var, T2 p) #define SET_FUNCPOINTER(var,p) ((var) = (p)) #endif +/* pointer size fix which fixes several gcc warnings */ +#ifdef __64BIT__ + #define __64BPTRSIZE(y) ((intptr)(y)) +#else + #define __64BPTRSIZE(y) (y) +#endif #endif /* _COMMON_CBASETYPES_H_ */ diff --git a/src/common/conf.c b/src/common/conf.c index b816b2f7f..46a034497 100644 --- a/src/common/conf.c +++ b/src/common/conf.c @@ -2,7 +2,10 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + #include "conf.h" + #include "../../3rdparty/libconfig/libconfig.h" #include "../common/showmsg.h" // ShowError diff --git a/src/common/conf.h b/src/common/conf.h index 9aff3df47..e5b637e47 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -6,6 +6,7 @@ #define _COMMON_CONF_H_ #include "../common/cbasetypes.h" + #include "../../3rdparty/libconfig/libconfig.h" /** diff --git a/src/common/console.c b/src/common/console.c index d8f352c8a..6a82db555 100644 --- a/src/common/console.c +++ b/src/common/console.c @@ -2,42 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT, MAX_CONSOLE_INPUT +#include "console.h" + +#include +#include + #include "../common/cbasetypes.h" -#include "../common/showmsg.h" #include "../common/core.h" +#include "../common/showmsg.h" #include "../common/sysinfo.h" -#include "../config/core.h" -#include "console.h" #ifndef MINICORE - #include "../common/ers.h" - #include "../common/malloc.h" - #include "../common/atomic.h" - #include "../common/spinlock.h" - #include "../common/thread.h" - #include "../common/mutex.h" - #include "../common/timer.h" - #include "../common/strlib.h" - #include "../common/sql.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 -#include #if !defined(WIN32) - #include - #include +# include +# include #else - #include "../common/winapi.h" // Console close event handling +# include "../common/winapi.h" // Console close event handling +# ifdef CONSOLE_INPUT +# include /* _kbhit() */ +# endif #endif +struct console_interface console_s; #ifdef CONSOLE_INPUT - #if defined(WIN32) - #include /* _kbhit() */ - #endif +struct console_input_interface console_input_s; #endif -struct console_interface console_s; - /*====================================== * CORE : Display title *--------------------------------------*/ @@ -116,12 +120,12 @@ CPCMD_C(mem_report,server) { **/ CPCMD(help) { unsigned int i = 0; - for ( i = 0; i < console->cmd_list_count; i++ ) { - if( console->cmd_list[i]->next_count ) { - ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",console->cmd_list[i]->cmd); - console->parse_list_subs(console->cmd_list[i],2); + for ( i = 0; i < console->input->cmd_list_count; i++ ) { + if( console->input->cmd_list[i]->next_count ) { + ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",console->input->cmd_list[i]->cmd); + console->input->parse_list_subs(console->input->cmd_list[i],2); } else { - ShowInfo("- '"CL_WHITE"%s"CL_RESET"'\n",console->cmd_list[i]->cmd); + ShowInfo("- '"CL_WHITE"%s"CL_RESET"'\n",console->input->cmd_list[i]->cmd); } } } @@ -144,7 +148,7 @@ CPCMD_C(skip,update) { ShowDebug("usage example: sql update skip 2013-02-14--16-15.sql\n"); return; } - Sql_HerculesUpdateSkip(console->SQL, line); + Sql_HerculesUpdateSkip(console->input->SQL, line); } /** @@ -206,7 +210,7 @@ void console_load_defaults(void) { unsigned int i, len = ARRAYLENGTH(default_list); struct CParseEntry *cmd; - RECREATE(console->cmds,struct CParseEntry *, len); + RECREATE(console->input->cmds,struct CParseEntry *, len); for(i = 0; i < len; i++) { CREATE(cmd, struct CParseEntry, 1); @@ -220,12 +224,12 @@ void console_load_defaults(void) { cmd->next_count = 0; - console->cmd_count++; - console->cmds[i] = cmd; + console->input->cmd_count++; + console->input->cmds[i] = cmd; default_list[i].self = cmd; if( !default_list[i].connect ) { - RECREATE(console->cmd_list,struct CParseEntry *, ++console->cmd_list_count); - console->cmd_list[console->cmd_list_count - 1] = cmd; + RECREATE(console->input->cmd_list,struct CParseEntry *, ++console->input->cmd_list_count); + console->input->cmd_list[console->input->cmd_list_count - 1] = cmd; } } @@ -233,11 +237,11 @@ void console_load_defaults(void) { unsigned int k; if( !default_list[i].connect ) continue; - for(k = 0; k < console->cmd_count; k++) { - if( strcmpi(default_list[i].connect,console->cmds[k]->cmd) == 0 ) { + for(k = 0; k < console->input->cmd_count; k++) { + if( strcmpi(default_list[i].connect,console->input->cmds[k]->cmd) == 0 ) { cmd = default_list[i].self; - RECREATE(console->cmds[k]->u.next, struct CParseEntry *, ++console->cmds[k]->next_count); - console->cmds[k]->u.next[console->cmds[k]->next_count - 1] = cmd; + RECREATE(console->input->cmds[k]->u.next, struct CParseEntry *, ++console->input->cmds[k]->next_count); + console->input->cmds[k]->u.next[console->input->cmds[k]->next_count - 1] = cmd; break; } } @@ -256,23 +260,23 @@ void console_parse_create(char *name, CParseFunc func) { safestrncpy(sublist, name, CP_CMD_LENGTH * 5); tok = strtok(sublist,":"); - for ( i = 0; i < console->cmd_list_count; i++ ) { - if( strcmpi(tok,console->cmd_list[i]->cmd) == 0 ) + for ( i = 0; i < console->input->cmd_list_count; i++ ) { + if( strcmpi(tok,console->input->cmd_list[i]->cmd) == 0 ) break; } - if( i == console->cmd_list_count ) { - RECREATE(console->cmds,struct CParseEntry *, ++console->cmd_count); + if( i == console->input->cmd_list_count ) { + RECREATE(console->input->cmds,struct CParseEntry *, ++console->input->cmd_count); CREATE(cmd, struct CParseEntry, 1); safestrncpy(cmd->cmd, tok, CP_CMD_LENGTH); cmd->next_count = 0; - console->cmds[console->cmd_count - 1] = cmd; - RECREATE(console->cmd_list,struct CParseEntry *, ++console->cmd_list_count); - console->cmd_list[console->cmd_list_count - 1] = cmd; - i = console->cmd_list_count - 1; + console->input->cmds[console->input->cmd_count - 1] = cmd; + RECREATE(console->input->cmd_list,struct CParseEntry *, ++console->input->cmd_list_count); + console->input->cmd_list[console->input->cmd_list_count - 1] = cmd; + i = console->input->cmd_list_count - 1; } - cmd = console->cmd_list[i]; + cmd = console->input->cmd_list[i]; while( ( tok = strtok(NULL, ":") ) != NULL ) { for(i = 0; i < cmd->next_count; i++) { @@ -281,13 +285,13 @@ void console_parse_create(char *name, CParseFunc func) { } if ( i == cmd->next_count ) { - RECREATE(console->cmds,struct CParseEntry *, ++console->cmd_count); - CREATE(console->cmds[console->cmd_count-1], struct CParseEntry, 1); - safestrncpy(console->cmds[console->cmd_count-1]->cmd, tok, CP_CMD_LENGTH); - console->cmds[console->cmd_count-1]->next_count = 0; + RECREATE(console->input->cmds,struct CParseEntry *, ++console->input->cmd_count); + CREATE(console->input->cmds[console->input->cmd_count-1], struct CParseEntry, 1); + safestrncpy(console->input->cmds[console->input->cmd_count-1]->cmd, tok, CP_CMD_LENGTH); + console->input->cmds[console->input->cmd_count-1]->next_count = 0; RECREATE(cmd->u.next, struct CParseEntry *, ++cmd->next_count); - cmd->u.next[cmd->next_count - 1] = console->cmds[console->cmd_count-1]; - cmd = console->cmds[console->cmd_count-1]; + cmd->u.next[cmd->next_count - 1] = console->input->cmds[console->input->cmd_count-1]; + cmd = console->input->cmds[console->input->cmd_count-1]; continue; } @@ -302,7 +306,7 @@ void console_parse_list_subs(struct CParseEntry *cmd, unsigned char depth) { memset(msg, '-', depth); snprintf(msg + depth,CP_CMD_LENGTH * 2, " '"CL_WHITE"%s"CL_RESET"'",cmd->u.next[i]->cmd); ShowInfo("%s subs\n",msg); - console->parse_list_subs(cmd->u.next[i],depth + 1); + console->input->parse_list_subs(cmd->u.next[i],depth + 1); } else { memset(msg, '-', depth); snprintf(msg + depth,CP_CMD_LENGTH * 2, " %s",cmd->u.next[i]->cmd); @@ -320,21 +324,21 @@ void console_parse_sub(char *line) { memcpy(bline, line, 200); tok = strtok(line, " "); - for ( i = 0; i < console->cmd_list_count; i++ ) { - if( strcmpi(tok,console->cmd_list[i]->cmd) == 0 ) + for ( i = 0; i < console->input->cmd_list_count; i++ ) { + if( strcmpi(tok,console->input->cmd_list[i]->cmd) == 0 ) break; } - if( i == console->cmd_list_count ) { + if( i == console->input->cmd_list_count ) { ShowError("'"CL_WHITE"%s"CL_RESET"' is not a known command, type '"CL_WHITE"help"CL_RESET"' to list all commands\n",line); return; } - cmd = console->cmd_list[i]; + cmd = console->input->cmd_list[i]; len += snprintf(sublist,CP_CMD_LENGTH * 5,"%s", cmd->cmd) + 1; - if( cmd->next_count == 0 && console->cmd_list[i]->u.func ) { + if( cmd->next_count == 0 && console->input->cmd_list[i]->u.func ) { char *r = NULL; if( (tok = strtok(NULL, " ")) ) { r = bline; @@ -351,7 +355,7 @@ void console_parse_sub(char *line) { if( strcmpi("help",tok) == 0 ) { if( cmd->next_count ) { ShowInfo("- '"CL_WHITE"%s"CL_RESET"' subs\n",sublist); - console->parse_list_subs(cmd,2); + console->input->parse_list_subs(cmd,2); } else { ShowError("'"CL_WHITE"%s"CL_RESET"' doesn't possess any subcommands\n",sublist); } @@ -392,95 +396,95 @@ void console_parse(char* line) { } void *cThread_main(void *x) { - while( console->ptstate ) {/* loopx */ - if( console->key_pressed() ) { + while( console->input->ptstate ) {/* loopx */ + if( console->input->key_pressed() ) { char input[MAX_CONSOLE_INPUT]; - console->parse(input); + console->input->parse(input); if( input[0] != '\0' ) {/* did we get something? */ - EnterSpinLock(&console->ptlock); + EnterSpinLock(&console->input->ptlock); if( cinput.count == CONSOLE_PARSE_SIZE ) { - LeaveSpinLock(&console->ptlock); + LeaveSpinLock(&console->input->ptlock); continue;/* drop */ } safestrncpy(cinput.queue[cinput.count++],input,MAX_CONSOLE_INPUT); - LeaveSpinLock(&console->ptlock); + LeaveSpinLock(&console->input->ptlock); } } - ramutex_lock( console->ptmutex ); - racond_wait( console->ptcond, console->ptmutex, -1 ); - ramutex_unlock( console->ptmutex ); + ramutex_lock( console->input->ptmutex ); + racond_wait( console->input->ptcond, console->input->ptmutex, -1 ); + ramutex_unlock( console->input->ptmutex ); } return NULL; } int console_parse_timer(int tid, int64 tick, int id, intptr_t data) { int i; - EnterSpinLock(&console->ptlock); + EnterSpinLock(&console->input->ptlock); for(i = 0; i < cinput.count; i++) { - console->parse_sub(cinput.queue[i]); + console->input->parse_sub(cinput.queue[i]); } cinput.count = 0; - LeaveSpinLock(&console->ptlock); - racond_signal(console->ptcond); + LeaveSpinLock(&console->input->ptlock); + racond_signal(console->input->ptcond); return 0; } void console_parse_final(void) { - if( console->ptstate ) { - InterlockedDecrement(&console->ptstate); - racond_signal(console->ptcond); + if( console->input->ptstate ) { + InterlockedDecrement(&console->input->ptstate); + racond_signal(console->input->ptcond); /* wait for thread to close */ - rathread_wait(console->pthread, NULL); + rathread_wait(console->input->pthread, NULL); - racond_destroy(console->ptcond); - ramutex_destroy(console->ptmutex); + racond_destroy(console->input->ptcond); + ramutex_destroy(console->input->ptmutex); } } void console_parse_init(void) { cinput.count = 0; - console->ptstate = 1; + console->input->ptstate = 1; - InitializeSpinLock(&console->ptlock); + InitializeSpinLock(&console->input->ptlock); - console->ptmutex = ramutex_create(); - console->ptcond = racond_create(); + console->input->ptmutex = ramutex_create(); + console->input->ptcond = racond_create(); - if( (console->pthread = rathread_create(console->pthread_main, NULL)) == NULL ){ + if( (console->input->pthread = rathread_create(console->input->pthread_main, NULL)) == NULL ){ ShowFatalError("console_parse_init: failed to spawn console_parse thread.\n"); exit(EXIT_FAILURE); } - timer->add_func_list(console->parse_timer, "console_parse_timer"); - timer->add_interval(timer->gettick() + 1000, console->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ + timer->add_func_list(console->input->parse_timer, "console_parse_timer"); + timer->add_interval(timer->gettick() + 1000, console->input->parse_timer, 0, 0, 500);/* start listening in 1s; re-try every 0.5s */ } void console_setSQL(Sql *SQL_handle) { - console->SQL = SQL_handle; + console->input->SQL = SQL_handle; } #endif /* CONSOLE_INPUT */ void console_init (void) { #ifdef CONSOLE_INPUT - console->cmd_count = console->cmd_list_count = 0; - console->load_defaults(); - console->parse_init(); + console->input->cmd_count = console->input->cmd_list_count = 0; + console->input->load_defaults(); + console->input->parse_init(); #endif } void console_final(void) { #ifdef CONSOLE_INPUT unsigned int i; - console->parse_final(); - for( i = 0; i < console->cmd_count; i++ ) { - if( console->cmds[i]->next_count ) - aFree(console->cmds[i]->u.next); - aFree(console->cmds[i]); + console->input->parse_final(); + for( i = 0; i < console->input->cmd_count; i++ ) { + if( console->input->cmds[i]->next_count ) + aFree(console->input->cmds[i]->u.next); + aFree(console->input->cmds[i]); } - aFree(console->cmds); - aFree(console->cmd_list); + aFree(console->input->cmds); + aFree(console->input->cmd_list); #endif } void console_defaults(void) { @@ -489,17 +493,20 @@ void console_defaults(void) { console->final = console_final; console->display_title = display_title; #ifdef CONSOLE_INPUT - console->parse_init = console_parse_init; - console->parse_final = console_parse_final; - console->parse_timer = console_parse_timer; - console->pthread_main = cThread_main; - console->parse = console_parse; - console->parse_sub = console_parse_sub; - console->key_pressed = console_parse_key_pressed; - console->load_defaults = console_load_defaults; - console->parse_list_subs = console_parse_list_subs; - console->addCommand = console_parse_create; - console->setSQL = console_setSQL; - console->SQL = NULL; + console->input = &console_input_s; + console->input->parse_init = console_parse_init; + console->input->parse_final = console_parse_final; + console->input->parse_timer = console_parse_timer; + console->input->pthread_main = cThread_main; + console->input->parse = console_parse; + console->input->parse_sub = console_parse_sub; + console->input->key_pressed = console_parse_key_pressed; + console->input->load_defaults = console_load_defaults; + console->input->parse_list_subs = console_parse_list_subs; + console->input->addCommand = console_parse_create; + console->input->setSQL = console_setSQL; + console->input->SQL = NULL; +#else + console->input = NULL; #endif } diff --git a/src/common/console.h b/src/common/console.h index 3d19ddc9d..d2c58f978 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -4,11 +4,13 @@ #ifndef _COMMON_CONSOLE_H_ #define _COMMON_CONSOLE_H_ -#include "../common/thread.h" +#include "../config/core.h" // MAX_CONSOLE_INPUT + +#include "../common/cbasetypes.h" #include "../common/mutex.h" #include "../common/spinlock.h" #include "../common/sql.h" -#include "../config/core.h" +#include "../common/thread.h" /** * Queue Max @@ -47,11 +49,8 @@ struct { unsigned short count; } cinput; -struct console_interface { - void (*init) (void); - void (*final) (void); - void (*display_title) (void); #ifdef CONSOLE_INPUT +struct console_input_interface { /* vars */ SPIN_LOCK ptlock;/* parse thread lock */ rAthread pthread;/* parse thread */ @@ -77,7 +76,17 @@ struct console_interface { void (*parse_list_subs) (struct CParseEntry *cmd, unsigned char depth); void (*addCommand) (char *name, CParseFunc func); void (*setSQL) (Sql *SQL_handle); +}; +#else +struct console_input_interface; #endif + +struct console_interface { + void (*init) (void); + void (*final) (void); + void (*display_title) (void); + + struct console_input_interface *input; }; struct console_interface *console; diff --git a/src/common/core.c b/src/common/core.c index 49b272488..85f824866 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -2,36 +2,40 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/strlib.h" +#define HERCULES_CORE + +#include "../config/core.h" #include "core.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" #ifndef MINICORE - #include "../common/db.h" - #include "../common/socket.h" - #include "../common/timer.h" - #include "../common/thread.h" - #include "../common/sql.h" - #include "../config/core.h" - #include "../common/HPM.h" - #include "../common/utils.h" - #include "../common/conf.h" - #include "../common/ers.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 +#include #include #include -#include #include #ifndef _WIN32 -#include +# include #else -#include "../common/winapi.h" // Console close event handling +# include "../common/winapi.h" // Console close event handling #endif /// Called when a terminate signal is received. diff --git a/src/common/core.h b/src/common/core.h index e9f7c5961..ba75e6b01 100644 --- a/src/common/core.h +++ b/src/common/core.h @@ -7,11 +7,10 @@ #include "../common/db.h" #include "../common/mmo.h" -#include "../config/core.h" /* so that developers with --enable-debug can raise signals from any section of the code they'd like */ #ifdef DEBUG - #include +# include #endif extern int arg_c; diff --git a/src/common/db.c b/src/common/db.c index 8d6b08815..1781aa96f 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -67,14 +67,18 @@ * @encoding US-ASCII * @see #db.h \*****************************************************************************/ + +#define HERCULES_CORE + +#include "db.h" + #include #include -#include "db.h" -#include "../common/mmo.h" +#include "../common/ers.h" #include "../common/malloc.h" +#include "../common/mmo.h" #include "../common/showmsg.h" -#include "../common/ers.h" #include "../common/strlib.h" /*****************************************************************************\ diff --git a/src/common/db.h b/src/common/db.h index 67abe6f19..0d2548806 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -42,9 +42,10 @@ #ifndef _COMMON_DB_H_ #define _COMMON_DB_H_ -#include "../common/cbasetypes.h" #include +#include "../common/cbasetypes.h" + /*****************************************************************************\ * (1) Section with public typedefs, enums, unions, structures and defines. * * DBRelease - Enumeration of release options. * diff --git a/src/common/des.c b/src/common/des.c index ed6d098dc..7f952be76 100644 --- a/src/common/des.c +++ b/src/common/des.c @@ -1,8 +1,11 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include "../common/cbasetypes.h" -#include "../common/des.h" +#define HERCULES_CORE + +#include "des.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/ers.c b/src/common/ers.c index 5a3d7314a..d9895e4f2 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -39,14 +39,18 @@ * @encoding US-ASCII * * @see common#ers.h * \*****************************************************************************/ + +#define HERCULES_CORE + +#include "ers.h" + #include #include #include "../common/cbasetypes.h" #include "../common/malloc.h" // CREATE, RECREATE, aMalloc, aFree -#include "../common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL #include "../common/nullpo.h" -#include "ers.h" +#include "../common/showmsg.h" // ShowMessage, ShowError, ShowFatalError, CL_BOLD, CL_NORMAL #ifndef DISABLE_ERS diff --git a/src/common/grfio.c b/src/common/grfio.c index bde0ed720..1111fb3f3 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -2,13 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/des.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/nullpo.h" +#define HERCULES_CORE + #include "grfio.h" #include @@ -17,6 +12,14 @@ #include #include +#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 5b39cbab6..13cf0b5ce 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/malloc.h" -#include "../common/core.h" -#include "../common/showmsg.h" -#include "../common/sysinfo.h" +#define HERCULES_CORE + +#include "malloc.h" #include #include #include #include +#include "../common/core.h" +#include "../common/showmsg.h" +#include "../common/sysinfo.h" + struct malloc_interface iMalloc_s; ////////////// Memory Libraries ////////////////// diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 3128a3cb0..5c69c7063 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/db.h" +#define HERCULES_CORE + #include "mapindex.h" -#include #include #include +#include + +#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/md5calc.c b/src/common/md5calc.c index 05fde42cc..e7b506e27 100644 --- a/src/common/md5calc.c +++ b/src/common/md5calc.c @@ -6,11 +6,15 @@ * ***********************************************************/ -#include "../common/random.h" +#define HERCULES_CORE + #include "md5calc.h" -#include + #include #include +#include + +#include "../common/random.h" #ifndef UINT_MAX #define UINT_MAX 4294967295U diff --git a/src/common/mmo.h b/src/common/mmo.h index d535d2874..1d826463e 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -5,10 +5,11 @@ #ifndef _COMMON_MMO_H_ #define _COMMON_MMO_H_ -#include "cbasetypes.h" -#include "../common/db.h" #include +#include "../common/cbasetypes.h" +#include "../common/db.h" + // server->client protocol version // 0 - pre-? // 1 - ? - 0x196 @@ -96,6 +97,7 @@ //Official Limit: 2.1b ( the var that stores the money doesn't go much higher than this by default ) #define MAX_BANK_ZENY 2100000000 +#define MAX_LEVEL 175 #define MAX_FAME 1000000000 #define MAX_CART 100 #define MAX_SKILL 1478 diff --git a/src/common/mutex.c b/src/common/mutex.c index 0668dbc41..12524c3b7 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -1,6 +1,10 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "mutex.h" + #ifdef WIN32 #include "../common/winapi.h" #else @@ -13,7 +17,6 @@ #include "../common/malloc.h" #include "../common/showmsg.h" #include "../common/timer.h" -#include "../common/mutex.h" struct ramutex{ #ifdef WIN32 diff --git a/src/common/mutex.h b/src/common/mutex.h index eeb24e6ff..3b83b66d6 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -4,6 +4,7 @@ #ifndef _COMMON_MUTEX_H_ #define _COMMON_MUTEX_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 1cb471aff..1891835f1 100644 --- a/src/common/nullpo.c +++ b/src/common/nullpo.c @@ -2,10 +2,14 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "nullpo.h" + #include #include #include -#include "../common/nullpo.h" + #include "../common/showmsg.h" /** diff --git a/src/common/random.c b/src/common/random.c index e46c52cad..7019a31f3 100644 --- a/src/common/random.c +++ b/src/common/random.c @@ -1,17 +1,23 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "random.h" + +#include // time + +#include // init_genrand, genrand_int32, genrand_res53 + #include "../common/showmsg.h" #include "../common/timer.h" // gettick -#include "random.h" + #if defined(WIN32) - #include "../common/winapi.h" +# include "../common/winapi.h" #elif defined(HAVE_GETPID) || defined(HAVE_GETTID) - #include - #include +# include +# include #endif -#include // time -#include // init_genrand, genrand_int32, genrand_res53 /// Initializes the random number generator with an appropriate seed. diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 14342fe5e..1dbcba282 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -2,23 +2,26 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/strlib.h" // StringBuf +#define HERCULES_CORE + #include "showmsg.h" -#include "core.h" //[Ind] - For SERVER_TYPE +#include #include +#include // atexit #include -#include #include -#include // atexit #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 +# include #endif // WIN32 #if defined(DEBUGLOGMAP) diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 49fbc34fb..5b32f39ae 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -5,12 +5,14 @@ #ifndef _COMMON_SHOWMSG_H_ #define _COMMON_SHOWMSG_H_ -#ifndef _COMMON_HPMI_H_ - #include "../../3rdparty/libconfig/libconfig.h" -#endif - #include +#ifdef HERCULES_CORE +# include "../../3rdparty/libconfig/libconfig.h" +#else +# include "../common/HPMi.h" +#endif + // for help with the console colors look here: // http://www.edoceo.com/liberum/?doc=printf-with-color // some code explanation (used here): @@ -90,7 +92,7 @@ enum msg_type { }; extern void ClearScreen(void); -#ifndef _COMMON_HPMI_H_ +#ifdef HERCULES_CORE extern void ShowMessage(const char *, ...); extern void ShowStatus(const char *, ...); extern void ShowSQL(const char *, ...); @@ -101,7 +103,18 @@ extern void ClearScreen(void); extern void ShowError(const char *, ...); extern void ShowFatalError(const char *, ...); extern void ShowConfigWarning(config_setting_t *config, const char *string, ...); +#else + HPExport void (*ShowMessage) (const char *, ...); + HPExport void (*ShowStatus) (const char *, ...); + HPExport void (*ShowSQL) (const char *, ...); + HPExport void (*ShowInfo) (const char *, ...); + HPExport void (*ShowNotice) (const char *, ...); + HPExport void (*ShowWarning) (const char *, ...); + HPExport void (*ShowDebug) (const char *, ...); + HPExport void (*ShowError) (const char *, ...); + HPExport void (*ShowFatalError) (const char *, ...); #endif + extern int _vShowMessage(enum msg_type flag, const char *string, va_list ap); #endif /* _COMMON_SHOWMSG_H_ */ diff --git a/src/common/socket.c b/src/common/socket.c index 35d350e95..3738f2c2a 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -2,48 +2,50 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../config/core.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // SHOW_SERVER_STATS #define _H_SOCKET_C_ - #include "socket.h" +#undef _H_SOCKET_C_ #include #include #include #include +#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 - #include - #include - #include - #include - #include - #include - #include - #include - #include - - #ifndef SIOCGIFCONF - #include // SIOCGIFCONF on Solaris, maybe others? [Shinomori] - #endif - #ifndef FIONBIO - #include // FIONBIO on Solaris [FlavioJS] - #endif - - #ifdef HAVE_SETRLIMIT - #include - #endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef SIOCGIFCONF +# include // SIOCGIFCONF on Solaris, maybe others? [Shinomori] +# endif +# ifndef FIONBIO +# include // FIONBIO on Solaris [FlavioJS] +# endif + +# ifdef HAVE_SETRLIMIT +# include +# endif #endif /** diff --git a/src/common/socket.h b/src/common/socket.h index 75adde4cf..804b9284f 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -5,19 +5,19 @@ #ifndef _COMMON_SOCKET_H_ #define _COMMON_SOCKET_H_ +#include + #include "../common/cbasetypes.h" #ifdef WIN32 - #include "../common/winapi.h" +# include "../common/winapi.h" typedef long in_addr_t; #else - #include - #include - #include +# include +# include +# include #endif -#include - struct HPluginData; #define FIFOSIZE_SERVERLINK 256*1024 diff --git a/src/common/spinlock.h b/src/common/spinlock.h index 29fbb355b..0058e1d83 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -1,4 +1,3 @@ -#pragma once #ifndef _COMMON_SPINLOCK_H_ #define _COMMON_SPINLOCK_H_ @@ -15,14 +14,14 @@ // // +#include "../common/atomic.h" +#include "../common/cbasetypes.h" +#include "../common/thread.h" + #ifdef WIN32 #include "../common/winapi.h" #endif -#include "../common/cbasetypes.h" -#include "../common/atomic.h" -#include "../common/thread.h" - #ifdef WIN32 typedef struct __declspec( align(64) ) SPIN_LOCK{ diff --git a/src/common/sql.c b/src/common/sql.c index 79ccc8e92..aeb56bff0 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -2,19 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "sql.h" + +#include // strtoul +#include // 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 "sql.h" #ifdef WIN32 -#include "../common/winapi.h" +# include "../common/winapi.h" // Needed before mysql.h #endif #include -#include // strlen/strnlen/memcpy/memset -#include // strtoul void hercules_mysql_error_handler(unsigned int ecode); diff --git a/src/common/sql.h b/src/common/sql.h index 1fb436853..807e0843c 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -5,10 +5,9 @@ #ifndef _COMMON_SQL_H_ #define _COMMON_SQL_H_ -#include "../common/cbasetypes.h" #include // va_list - +#include "../common/cbasetypes.h" // Return codes #define SQL_ERROR (-1) diff --git a/src/common/strlib.c b/src/common/strlib.c index 361595b07..e2e802915 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -2,16 +2,19 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#define STRLIB_C +#define HERCULES_CORE + +#define _H_STRLIB_C_ #include "strlib.h" +#undef _H_STRLIB_C_ +#include #include #include -#include +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" #define J_MAX_MALLOC_SIZE 65535 diff --git a/src/common/strlib.h b/src/common/strlib.h index 10844d257..decf661a6 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -5,15 +5,16 @@ #ifndef _COMMON_STRLIB_H_ #define _COMMON_STRLIB_H_ -#include "../common/cbasetypes.h" #include +#include "../common/cbasetypes.h" + #ifndef __USE_GNU - #define __USE_GNU // required to enable strnlen on some platforms - #include - #undef __USE_GNU +# define __USE_GNU // required to enable strnlen on some platforms +# include +# undef __USE_GNU #else - #include +# include #endif #ifdef WIN32 @@ -165,7 +166,7 @@ struct sv_interface *sv; void strlib_defaults(void); /* the purpose of these macros is simply to not make calling them be an annoyance */ -#ifndef STRLIB_C +#ifndef _H_STRLIB_C_ #define jstrescape(pt) (strlib->jstrescape(pt)) #define jstrescapecpy(pt,spt) (strlib->jstrescapecpy((pt),(spt))) #define jmemescapecpy(pt,spt,size) (strlib->jmemescapecpy((pt),(spt),(size))) @@ -189,6 +190,6 @@ void strlib_defaults(void); #define safesnprintf(buf,sz,fmt,...) (strlib->safesnprintf((buf),(sz),(fmt),##__VA_ARGS__)) #define strline(str,pos) (strlib->strline((str),(pos))) #define bin2hex(output,input,count) (strlib->bin2hex((output),(input),(count))) -#endif /* STRLIB_C */ +#endif /* _H_STRLIB_C_ */ #endif /* _COMMON_STRLIB_H_ */ diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index a56896458..3fdfadb41 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -4,23 +4,39 @@ /// See sysinfo.h for a description of this file -#define _COMMON_SYSINFO_P_ +#define HERCULES_CORE + #include "sysinfo.h" -#undef _COMMON_SYSINFO_P_ + +#include // fopen +#include // atoi #include "../common/cbasetypes.h" #include "../common/core.h" -#include "../common/strlib.h" #include "../common/malloc.h" +#include "../common/strlib.h" #ifdef WIN32 -#include -#include // strlen +# include // strlen +# include #else -#include +# include #endif -#include // fopen -#include // atoi + +/// Private interface fields +struct sysinfo_private { + char *platform; + char *osversion; + char *cpu; + int cpucores; + char *arch; + char *compiler; + char *cflags; + char *vcstype_name; + int vcstype; + char *vcsrevision_src; + char *vcsrevision_scripts; +}; /// sysinfo.c interface source struct sysinfo_interface sysinfo_s; diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index 17faac26b..c0c4d276a 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -13,23 +13,7 @@ #include "../common/cbasetypes.h" -#ifdef _COMMON_SYSINFO_P_ -struct sysinfo_private { - char *platform; - char *osversion; - char *cpu; - int cpucores; - char *arch; - char *compiler; - char *cflags; - char *vcstype_name; - int vcstype; - char *vcsrevision_src; - char *vcsrevision_scripts; -}; -#else struct sysinfo_private; -#endif /** * sysinfo.c interface diff --git a/src/common/thread.c b/src/common/thread.c index 4d110f2dd..4f73aa9b3 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -6,24 +6,27 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "thread.h" + +#include "../common/cbasetypes.h" +#include "../common/malloc.h" +#include "../common/showmsg.h" + #ifdef WIN32 -#include "../common/winapi.h" -#define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) -#define __thread __declspec( thread ) +# include "../common/winapi.h" +# define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) +# define __thread __declspec( thread ) #else -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include #endif -#include "cbasetypes.h" -#include "malloc.h" -#include "showmsg.h" -#include "thread.h" - // 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 d6b2bbc6e..887c03179 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -1,7 +1,6 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#pragma once #ifndef _COMMON_THREAD_H_ #define _COMMON_THREAD_H_ diff --git a/src/common/timer.c b/src/common/timer.c index 526854582..10f14b0f2 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -2,11 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/utils.h" +#define HERCULES_CORE + #include "timer.h" #include @@ -14,11 +11,17 @@ #include #include +#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 -#include // struct timeval, gettimeofday() +# include // struct timeval, gettimeofday() +# include #endif struct timer_interface timer_s; diff --git a/src/common/utils.c b/src/common/utils.c index 47747dd32..84925f707 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -2,33 +2,35 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/core.h" -#include "socket.h" +#define HERCULES_CORE + #include "utils.h" -#include +#include // floor() #include +#include #include #include -#include // floor() +#include // 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" #ifdef WIN32 - #include "../common/winapi.h" - #ifndef F_OK - #define F_OK 0x0 - #endif /* F_OK */ +# include "../common/winapi.h" +# ifndef F_OK +# define F_OK 0x0 +# endif /* F_OK */ #else - #include - #include - #include +# include +# include +# include #endif -#include // 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 f89546b8a..823651163 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -5,10 +5,11 @@ #ifndef _COMMON_UTILS_H_ #define _COMMON_UTILS_H_ -#include "../common/cbasetypes.h" #include // FILE* #include +#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/config/const.h b/src/config/const.h index 6557cb987..f9baa4d7d 100644 --- a/src/config/const.h +++ b/src/config/const.h @@ -52,13 +52,6 @@ #define DEFTYPE_MAX CHAR_MAX #endif -/* pointer size fix which fixes several gcc warnings */ -#ifdef __64BIT__ - #define __64BPTRSIZE(y) ((intptr)(y)) -#else - #define __64BPTRSIZE(y) (y) -#endif - /* ATCMD_FUNC(mobinfo) HIT and FLEE calculations */ #ifdef RENEWAL #define MOB_FLEE(mobdata) ( (mobdata)->lv + (mobdata)->status.agi + 100 ) diff --git a/src/config/renewal.h b/src/config/renewal.h index 36615d63b..36bdd3958 100644 --- a/src/config/renewal.h +++ b/src/config/renewal.h @@ -74,5 +74,6 @@ #define RENEWAL_ASPD #endif // DISABLE_RENEWAL +#undef DISABLE_RENEWAL #endif // _CONFIG_RENEWAL_H_ diff --git a/src/login/account.h b/src/login/account.h index 234e7c0c1..329ae31c8 100644 --- a/src/login/account.h +++ b/src/login/account.h @@ -7,6 +7,7 @@ #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 1483196ab..2e4ed7ab9 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -2,17 +2,22 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // CONSOLE_INPUT +#include "account.h" + +#include +#include + +#include "../common/console.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/timer.h" -#include "../common/console.h" -#include "../common/socket.h" -#include "account.h" -#include -#include /// global defines #define ACCOUNT_SQL_DB_VERSION 20110114 @@ -652,7 +657,7 @@ Sql* account_db_sql_up(AccountDB* self) { AccountDB_SQL* db = (AccountDB_SQL*)self; Sql_HerculesUpdateCheck(db->accounts); #ifdef CONSOLE_INPUT - console->setSQL(db->accounts); + console->input->setSQL(db->accounts); #endif return db->accounts; } diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c index 74f45e418..081f28d84 100644 --- a/src/login/ipban_sql.c +++ b/src/login/ipban_sql.c @@ -2,6 +2,15 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "ipban.h" + +#include +#include + +#include "login.h" +#include "loginlog.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/malloc.h" @@ -9,11 +18,6 @@ #include "../common/socket.h" #include "../common/strlib.h" #include "../common/timer.h" -#include "login.h" -#include "ipban.h" -#include "loginlog.h" -#include -#include // global sql settings static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/login/login.c b/src/login/login.c index af59fcf38..cb46e0226 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -2,6 +2,18 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "login.h" + +#include +#include +#include + +#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" @@ -12,15 +24,6 @@ #include "../common/strlib.h" #include "../common/timer.h" #include "../common/utils.h" -#include "../common/HPM.h" -#include "account.h" -#include "ipban.h" -#include "login.h" -#include "loginlog.h" - -#include -#include -#include struct Login_Config login_config; diff --git a/src/login/login.h b/src/login/login.h index 14c361a15..e77b96a0e 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/mmo.h" // NAME_LENGTH,SEX_* #include "../common/core.h" // CORE_ST_LAST +#include "../common/mmo.h" // NAME_LENGTH,SEX_* enum E_LOGINSERVER_ST { diff --git a/src/login/loginlog.h b/src/login/loginlog.h index 730fb6e62..a86ad431c 100644 --- a/src/login/loginlog.h +++ b/src/login/loginlog.h @@ -4,6 +4,7 @@ #ifndef _LOGIN_LOGINLOG_H_ #define _LOGIN_LOGINLOG_H_ +#include "../common/cbasetypes.h" unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes); void login_log(uint32 ip, const char* username, int rcode, const char* message); @@ -11,5 +12,4 @@ bool loginlog_init(void); bool loginlog_final(void); bool loginlog_config_read(const char* w1, const char* w2); - #endif /* _LOGIN_LOGINLOG_H_ */ diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 231ac783b..2cbc02c93 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -2,13 +2,18 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "loginlog.h" + +#include +#include // exit + #include "../common/cbasetypes.h" #include "../common/mmo.h" #include "../common/socket.h" #include "../common/sql.h" #include "../common/strlib.h" -#include -#include // exit // global sql settings (in ipban_sql.c) static char global_db_hostname[32] = "127.0.0.1"; diff --git a/src/map/HPMmap.c b/src/map/HPMmap.c index 061479d87..cb8c979c6 100644 --- a/src/map/HPMmap.c +++ b/src/map/HPMmap.c @@ -1,25 +1,15 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/HPM.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" - +#define HERCULES_CORE #include "HPMmap.h" -#include "pc.h" -#include "map.h" -// +#include +#include +#include +#include + #include "atcommand.h" #include "battle.h" #include "battleground.h" @@ -37,12 +27,14 @@ #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" @@ -54,11 +46,19 @@ #include "trade.h" #include "unit.h" #include "vending.h" - -#include -#include -#include -#include +#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" diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 5fd0faf86..df3be40a5 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -2,57 +2,60 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/mmo.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/core.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/conf.h" -#include "../common/sysinfo.h" +#define HERCULES_CORE +#include "../config/core.h" // AUTOLOOTITEM_SIZE, AUTOTRADE_PERSISTENCY, MAX_CARTS, MAX_SUGGESTIONS, MOB_FLEE(), MOB_HIT(), RENEWAL, RENEWAL_DROP, RENEWAL_EXP #include "atcommand.h" + +#include +#include +#include +#include + #include "battle.h" #include "chat.h" -#include "clif.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 "pc.h" -#include "pc_groups.h" // groupid2name -#include "status.h" -#include "skill.h" +#include "mapreg.h" +#include "mercenary.h" #include "mob.h" #include "npc.h" -#include "pet.h" -#include "homunculus.h" -#include "mail.h" -#include "mercenary.h" -#include "elemental.h" #include "party.h" -#include "guild.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 "mapreg.h" -#include "quest.h" -#include "searchstore.h" +#include "../common/cbasetypes.h" +#include "../common/conf.h" +#include "../common/core.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/sysinfo.h" +#include "../common/timer.h" +#include "../common/utils.h" #include "HPMmap.h" -#include -#include -#include -#include - 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 bc4ab30a3..c8a1863af 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 "pc_groups.h" /** * Declarations diff --git a/src/map/battle.c b/src/map/battle.c index 9089b7102..0865ee4ba 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2,41 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/ers.h" -#include "../common/random.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/sysinfo.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "map.h" -#include "path.h" -#include "pc.h" -#include "status.h" -#include "skill.h" -#include "homunculus.h" -#include "mercenary.h" -#include "elemental.h" -#include "mob.h" -#include "itemdb.h" -#include "clif.h" -#include "pet.h" -#include "guild.h" -#include "party.h" +#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 "battleground.h" -#include "chrif.h" +#include #include #include #include -#include + +#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 88038ddb4..fbe097c78 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -5,8 +5,8 @@ #ifndef _MAP_BATTLE_H_ #define _MAP_BATTLE_H_ -#include "../common/cbasetypes.h" #include "map.h" //ELE_MAX +#include "../common/cbasetypes.h" /** * Declarations diff --git a/src/map/battleground.c b/src/map/battleground.c index 68539e25d..a7169de0e 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -2,29 +2,32 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/strlib.h" -#include "../common/conf.h" +#define HERCULES_CORE #include "battleground.h" + +#include +#include + #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 "pc.h" #include "party.h" +#include "pc.h" #include "pet.h" -#include "homunculus.h" -#include "mercenary.h" -#include "mapreg.h" - -#include -#include +#include "../common/cbasetypes.h" +#include "../common/conf.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; diff --git a/src/map/battleground.h b/src/map/battleground.h index 05c4eb060..ec0a86f14 100644 --- a/src/map/battleground.h +++ b/src/map/battleground.h @@ -5,9 +5,9 @@ #ifndef _MAP_BATTLEGROUND_H_ #define _MAP_BATTLEGROUND_H_ -#include "../common/mmo.h" // struct party #include "clif.h" #include "guild.h" +#include "../common/mmo.h" // struct party /** * Defines diff --git a/src/map/buyingstore.c b/src/map/buyingstore.c index 2a15e66fc..80264b30d 100644 --- a/src/map/buyingstore.c +++ b/src/map/buyingstore.c @@ -2,18 +2,21 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 +#define HERCULES_CORE + +#include "buyingstore.h" // struct s_buyingstore + #include "atcommand.h" // msg_txt #include "battle.h" // battle_config.* -#include "buyingstore.h" // struct s_buyingstore +#include "chrif.h" #include "clif.h" // clif->buyingstore_* #include "log.h" // log_pick_pc, log_zeny #include "pc.h" // struct map_session_data -#include "chrif.h" +#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 5141a1013..914631872 100644 --- a/src/map/buyingstore.h +++ b/src/map/buyingstore.h @@ -5,6 +5,11 @@ #ifndef _MAP_BUYINGSTORE_H_ #define _MAP_BUYINGSTORE_H_ +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // MAX_SLOTS + +struct map_session_data; + /** * Declarations **/ diff --git a/src/map/chat.c b/src/map/chat.c index 08fc4a575..c9d3e6d46 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -2,12 +2,13 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/mmo.h" +#define HERCULES_CORE + +#include "chat.h" + +#include +#include + #include "atcommand.h" // msg_txt() #include "battle.h" // struct battle_config #include "clif.h" @@ -15,10 +16,12 @@ #include "npc.h" // npc_event_do() #include "pc.h" #include "skill.h" // ext_skill_unit_onplace() -#include "chat.h" - -#include -#include +#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; diff --git a/src/map/chat.h b/src/map/chat.h index b0c6cd905..cbc2a391e 100644 --- a/src/map/chat.h +++ b/src/map/chat.h @@ -6,9 +6,12 @@ #define _MAP_CHAT_H_ #include "map.h" // struct block_list, CHATROOM_TITLE_SIZE +#include "../common/cbasetypes.h" +#include "../common/db.h" -struct map_session_data; struct chat_data; +struct map_session_data; +struct npc_data; #define MAX_CHAT_USERS 20 diff --git a/src/map/chrif.c b/src/map/chrif.c index 99a1935fd..81e2d387c 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -2,15 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/ers.h" -#include "../common/HPM.h" +#define HERCULES_CORE + +#include "../config/core.h" // AUTOTRADE_PERSISTENCY, STATS_OPT_OUT +#include "chrif.h" + +#include +#include +#include +#include +#include #include "map.h" #include "battle.h" @@ -25,15 +26,17 @@ #include "instance.h" #include "mercenary.h" #include "elemental.h" -#include "chrif.h" #include "quest.h" #include "storage.h" - -#include -#include -#include -#include -#include +#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; diff --git a/src/map/chrif.h b/src/map/chrif.h index 25e955604..84efc66d3 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -5,9 +5,11 @@ #ifndef _MAP_CHRIF_H_ #define _MAP_CHRIF_H_ -#include "../common/cbasetypes.h" #include + #include "map.h" //TBL_stuff +#include "../common/cbasetypes.h" +#include "../common/db.h" struct status_change_entry; diff --git a/src/map/clif.c b/src/map/clif.c index 1a6665307..cb2474961 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2,56 +2,59 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/grfio.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 "../common/ers.h" -#include "../common/conf.h" -#include "../common/HPM.h" +#define HERCULES_CORE + +#include "../config/core.h" // ANTI_MAYAP_CHEAT, NEW_CARTS, RENEWAL, SECURE_NPCTIMEOUT +#include "clif.h" + +#include +#include +#include +#include +#include -#include "map.h" -#include "chrif.h" -#include "pc.h" -#include "status.h" -#include "npc.h" -#include "itemdb.h" -#include "chat.h" -#include "trade.h" -#include "storage.h" -#include "script.h" -#include "skill.h" #include "atcommand.h" -#include "intif.h" #include "battle.h" #include "battleground.h" -#include "mob.h" -#include "party.h" -#include "unit.h" +#include "chat.h" +#include "chrif.h" +#include "elemental.h" #include "guild.h" -#include "vending.h" -#include "pet.h" #include "homunculus.h" #include "instance.h" -#include "mercenary.h" -#include "elemental.h" +#include "intif.h" +#include "irc-bot.h" +#include "itemdb.h" #include "log.h" -#include "clif.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 "irc-bot.h" - -#include -#include -#include -#include -#include +#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/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; diff --git a/src/map/clif.h b/src/map/clif.h index 0f4a9e756..7b27e1fe6 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -5,13 +5,13 @@ #ifndef _MAP_CLIF_H_ #define _MAP_CLIF_H_ +#include + +#include "map.h" +#include "packets_struct.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/mmo.h" -#include "../common/socket.h" -#include "../map/map.h" -#include "../map/packets_struct.h" -#include /** * Declarations @@ -20,7 +20,6 @@ struct item; struct item_data; struct storage_data; struct guild_storage; -struct block_list; struct unit_data; struct map_session_data; struct homun_data; diff --git a/src/map/date.c b/src/map/date.c index f38ead858..975a00c50 100644 --- a/src/map/date.c +++ b/src/map/date.c @@ -1,10 +1,14 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include "../common/cbasetypes.h" +#define HERCULES_CORE + #include "date.h" + #include +#include "../common/cbasetypes.h" + int date_get_year(void) { time_t t; diff --git a/src/map/date.h b/src/map/date.h index 46f0d86c3..b3ed59b2f 100644 --- a/src/map/date.h +++ b/src/map/date.h @@ -4,6 +4,8 @@ #ifndef _MAP_DATE_H_ #define _MAP_DATE_H_ +#include "../common/cbasetypes.h" + int date_get_year(void); int date_get_month(void); int date_get_day(void); diff --git a/src/map/duel.c b/src/map/duel.c index af2741f77..a423ef240 100644 --- a/src/map/duel.c +++ b/src/map/duel.c @@ -2,18 +2,20 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" +#define HERCULES_CORE -#include "atcommand.h" // msg_txt -#include "clif.h" #include "duel.h" -#include "pc.h" #include #include #include #include +#include "atcommand.h" // msg_txt +#include "clif.h" +#include "pc.h" +#include "../common/cbasetypes.h" + /*========================================== * Duel organizing functions [LuzZza] *------------------------------------------*/ diff --git a/src/map/duel.h b/src/map/duel.h index 5405d2eee..956aed36d 100644 --- a/src/map/duel.h +++ b/src/map/duel.h @@ -5,6 +5,10 @@ #ifndef _MAP_DUEL_H_ #define _MAP_DUEL_H_ +#include "../common/cbasetypes.h" + +struct map_session_data; + struct duel { int members_count; int invites_count; diff --git a/src/map/elemental.c b/src/map/elemental.c index f335600d6..323df41e1 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -2,42 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/mmo.h" -#include "../common/showmsg.h" -#include "../common/utils.h" -#include "../common/random.h" -#include "../common/strlib.h" +#define HERCULES_CORE -#include "log.h" -#include "clif.h" +#include "elemental.h" + +#include +#include +#include +#include + +#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 "pc.h" -#include "status.h" -#include "skill.h" #include "mob.h" -#include "pet.h" -#include "battle.h" +#include "npc.h" #include "party.h" -#include "guild.h" -#include "atcommand.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "npc.h" +#include "skill.h" +#include "status.h" #include "trade.h" #include "unit.h" -#include "elemental.h" - -#include -#include -#include -#include +#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; diff --git a/src/map/elemental.h b/src/map/elemental.h index 6d04a41a5..aa27aadc9 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -7,6 +7,7 @@ #include "status.h" // struct status_data, struct status_change #include "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 fa5805c8b..69f67238d 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -2,35 +2,38 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/mapindex.h" -#include "../common/showmsg.h" -#include "../common/ers.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "map.h" +#include "../config/core.h" // GP_BOUND_ITEMS #include "guild.h" -#include "storage.h" -#include "battle.h" -#include "npc.h" -#include "pc.h" -#include "status.h" -#include "mob.h" -#include "intif.h" -#include "clif.h" -#include "skill.h" -#include "log.h" -#include "instance.h" #include #include #include +#include "battle.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 b03bd664d..34e27a56c 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -5,18 +5,10 @@ #ifndef _MAP_GUILD_H_ #define _MAP_GUILD_H_ -//#include "../common/mmo.h" -#include "map.h" // NAME_LENGTH - -/** - * Declarations - **/ -struct guild; -struct guild_member; -struct guild_position; -struct guild_castle; -struct map_session_data; -struct mob_data; +#include "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 ff9f7a5b1..b6a83d1cb 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -2,43 +2,45 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/mmo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE -#include "log.h" -#include "clif.h" +#include "../config/core.h" // DBPATH +#include "homunculus.h" + +#include +#include +#include +#include + +#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 "pc.h" -#include "status.h" -#include "skill.h" #include "mob.h" -#include "pet.h" -#include "battle.h" +#include "npc.h" #include "party.h" -#include "guild.h" -#include "atcommand.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "npc.h" +#include "skill.h" +#include "status.h" #include "trade.h" #include "unit.h" - -#include "homunculus.h" - -#include -#include -#include -#include +#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; diff --git a/src/map/homunculus.h b/src/map/homunculus.h index e6d59e30e..9eef6af5b 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -5,9 +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 "pc.h" +#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 caf622b3d..5789d7dd6 100644 --- a/src/map/instance.c +++ b/src/map/instance.c @@ -2,30 +2,32 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/db.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "clif.h" #include "instance.h" -#include "map.h" -#include "npc.h" -#include "party.h" -#include "pc.h" +#include #include #include #include -#include #include +#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 712a0f141..ae649eda7 100644 --- a/src/map/instance.h +++ b/src/map/instance.h @@ -6,8 +6,11 @@ #define _MAP_INSTANCE_H_ #include "script.h" // struct reg_db +#include "../common/cbasetypes.h" #include "../common/mmo.h" // struct point + struct block_list; +struct map_session_data; #define INSTANCE_NAME_LENGTH (60+1) diff --git a/src/map/intif.c b/src/map/intif.c index 6bd24368a..383150fbc 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1,37 +1,40 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "map.h" +#define HERCULES_CORE + +#include "../config/core.h" // GP_BOUND_ITEMS +#include "intif.h" + +#include +#include +#include +#include +#include +#include + +#include "atcommand.h" #include "battle.h" #include "chrif.h" #include "clif.h" -#include "pc.h" -#include "intif.h" -#include "log.h" -#include "storage.h" -#include "party.h" +#include "elemental.h" #include "guild.h" -#include "pet.h" -#include "atcommand.h" -#include "mercenary.h" #include "homunculus.h" -#include "elemental.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 -#include -#include -#include -#include -#include - +#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; diff --git a/src/map/intif.h b/src/map/intif.h index 290dcfcdc..b6ee727f3 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -5,19 +5,22 @@ #ifndef _MAP_INTIF_H_ #define _MAP_INTIF_H_ +#include "../common/cbasetypes.h" /** * Declarations **/ -struct party_member; +struct auction_data; struct guild_member; struct guild_position; -struct s_pet; +struct guild_storage; +struct mail_message; +struct map_session_data; +struct party_member; +struct s_elemental; struct s_homunculus; struct s_mercenary; -struct s_elemental; -struct mail_message; -struct auction_data; +struct s_pet; /** * Defines diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c index ff28082e7..6f016697f 100644 --- a/src/map/irc-bot.c +++ b/src/map/irc-bot.c @@ -2,23 +2,25 @@ // See the LICENSE file // Base Author: shennetsind @ http://hercules.ws -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/strlib.h" -#include "../common/showmsg.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/random.h" +#define HERCULES_CORE -#include "map.h" -#include "pc.h" -#include "clif.h" #include "irc-bot.h" #include #include #include +#include "clif.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 c15a5d46a..60f03fca5 100644 --- a/src/map/irc-bot.h +++ b/src/map/irc-bot.h @@ -6,6 +6,8 @@ #ifndef _MAP_IRC_BOT_H_ #define _MAP_IRC_BOT_H_ +#include "../common/cbasetypes.h" + #define IRC_NICK_LENGTH 40 #define IRC_IDENT_LENGTH 40 #define IRC_HOST_LENGTH 63 diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 5eeb90be5..1981f435c 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -2,23 +2,28 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/conf.h" +#define HERCULES_CORE + +#include "../config/core.h" // DBPATH, RENEWAL #include "itemdb.h" -#include "map.h" -#include "battle.h" // struct battle_config -#include "script.h" // item script processing -#include "pc.h" // W_MUSICAL, W_WHIP #include #include #include +#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/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 77fb2e2ec..12766b288 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -5,9 +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 "map.h" +#include "../common/sql.h" /** * Declarations diff --git a/src/map/log.c b/src/map/log.c index 19a98f34b..523ef1d65 100644 --- a/src/map/log.c +++ b/src/map/log.c @@ -2,22 +2,25 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/sql.h" // SQL_INNODB -#include "../common/strlib.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "battle.h" -#include "itemdb.h" +#define HERCULES_CORE + #include "log.h" -#include "map.h" -#include "mob.h" -#include "pc.h" #include #include #include +#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" + 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 b2cb92c20..ecfedeac2 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -11,11 +11,10 @@ /** * Declarations **/ -struct block_list; -struct map_session_data; -struct mob_data; struct item; struct item_data; +struct map_session_data; +struct mob_data; /** * Defines diff --git a/src/map/mail.c b/src/map/mail.c index 371aa892f..7ba7d7470 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -2,19 +2,21 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/showmsg.h" +#define HERCULES_CORE #include "mail.h" -#include "atcommand.h" -#include "itemdb.h" -#include "clif.h" -#include "pc.h" -#include "log.h" #include #include +#include "atcommand.h" +#include "clif.h" +#include "itemdb.h" +#include "log.h" +#include "pc.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 8df537ff3..30b032ef4 100644 --- a/src/map/mail.h +++ b/src/map/mail.h @@ -5,7 +5,11 @@ #ifndef _MAP_MAIL_H_ #define _MAP_MAIL_H_ -#include "../common/mmo.h" +#include "../common/cbasetypes.h" + +struct item; +struct mail_message; +struct map_session_data; struct mail_interface { void (*clear) (struct map_session_data *sd); diff --git a/src/map/map.c b/src/map/map.c index 315924e2e..01d3dbb9f 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2,62 +2,66 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/core.h" -#include "../common/timer.h" -#include "../common/ers.h" -#include "../common/grfio.h" -#include "../common/malloc.h" -#include "../common/socket.h" // WFIFO*() -#include "../common/showmsg.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/conf.h" -#include "../common/console.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA, CONSOLE_INPUT, DBPATH, RENEWAL #include "map.h" -#include "path.h" + +#include +#include +#include +#include +#include + +#include "HPMmap.h" +#include "atcommand.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 "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 "mob.h" -#include "npc.h" // npc_setcells(), npc_unsetcells() -#include "chat.h" -#include "itemdb.h" #include "storage.h" -#include "skill.h" #include "trade.h" -#include "party.h" #include "unit.h" -#include "battle.h" -#include "battleground.h" -#include "quest.h" -#include "script.h" -#include "mapreg.h" -#include "guild.h" -#include "pet.h" -#include "homunculus.h" -#include "instance.h" -#include "mercenary.h" -#include "elemental.h" -#include "atcommand.h" -#include "log.h" -#include "mail.h" -#include "irc-bot.h" -#include "HPMmap.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 -#include -#include -#include -#include #ifndef _WIN32 #include #endif @@ -5482,8 +5486,8 @@ void map_cp_defaults(void) { map->cpsd->bl.y = MAP_DEFAULT_Y; map->cpsd->bl.m = map->mapname2mapid(MAP_DEFAULT); - console->addCommand("gm:info",CPCMD_A(gm_position)); - console->addCommand("gm:use",CPCMD_A(gm_use)); + console->input->addCommand("gm:info",CPCMD_A(gm_position)); + console->input->addCommand("gm:use",CPCMD_A(gm_use)); #endif } /* Hercules Plugin Mananger */ @@ -5839,7 +5843,7 @@ int do_init(int argc, char *argv[]) Sql_HerculesUpdateCheck(map->mysql_handle); #ifdef CONSOLE_INPUT - console->setSQL(map->mysql_handle); + console->input->setSQL(map->mysql_handle); #endif ShowStatus("Server is '"CL_GREEN"ready"CL_RESET"' and listening on port '"CL_WHITE"%d"CL_RESET"'.\n\n", map->port); diff --git a/src/map/map.h b/src/map/map.h index c61868b13..539b02ed8 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -5,18 +5,18 @@ #ifndef _MAP_MAP_H_ #define _MAP_MAP_H_ +#include + +#include "atcommand.h" #include "../common/cbasetypes.h" #include "../common/core.h" // CORE_ST_LAST #include "../common/mmo.h" #include "../common/mapindex.h" #include "../common/db.h" -#include "../config/core.h" #include "../common/sql.h" -#include "atcommand.h" -#include +struct mob_data; struct npc_data; -struct item_data; struct hChSysCh; enum E_MAPSERVER_ST { @@ -36,7 +36,6 @@ enum E_MAPSERVER_ST { #define NATURAL_HEAL_INTERVAL 500 #define MIN_FLOORITEM 2 #define MAX_FLOORITEM START_ACCOUNT_NUM -#define MAX_LEVEL 175 #define MAX_IGNORE_LIST 20 // official is 14 #define MAX_VENDING 12 #define MAX_MAP_SIZE (512*512) // Wasn't there something like this already? Can't find it.. [Shinryo] diff --git a/src/map/mapreg_sql.c b/src/map/mapreg_sql.c index 61c25f24e..f026fde00 100644 --- a/src/map/mapreg_sql.c +++ b/src/map/mapreg_sql.c @@ -2,6 +2,15 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "mapreg.h" + +#include +#include + +#include "map.h" // map->mysql_handle +#include "script.h" #include "../common/cbasetypes.h" #include "../common/db.h" #include "../common/ers.h" @@ -10,11 +19,6 @@ #include "../common/sql.h" #include "../common/strlib.h" #include "../common/timer.h" -#include "map.h" // map->mysql_handle -#include "script.h" -#include "mapreg.h" -#include -#include struct mapreg_interface mapreg_s; diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 495621014..26bc8c188 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -2,42 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/malloc.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/mmo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE -#include "log.h" -#include "clif.h" +#include "mercenary.h" + +#include +#include +#include +#include + +#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 "pc.h" -#include "status.h" -#include "skill.h" #include "mob.h" -#include "pet.h" -#include "battle.h" +#include "npc.h" #include "party.h" -#include "guild.h" -#include "atcommand.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "npc.h" +#include "skill.h" +#include "status.h" #include "trade.h" #include "unit.h" -#include "mercenary.h" - -#include -#include -#include -#include +#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; diff --git a/src/map/mercenary.h b/src/map/mercenary.h index dd9266b2e..b998ac006 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -6,6 +6,7 @@ #include "status.h" // struct status_data, struct status_change #include "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 8f12d4b1b..11ac74621 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2,46 +2,49 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/db.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/ers.h" -#include "../common/random.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/socket.h" +#define HERCULES_CORE -#include "map.h" -#include "path.h" -#include "clif.h" -#include "intif.h" -#include "pc.h" -#include "pet.h" -#include "status.h" +#include "../config/core.h" // AUTOLOOT_DISTANCE, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, RENEWAL_DROP, RENEWAL_EXP #include "mob.h" -#include "homunculus.h" -#include "mercenary.h" + +#include +#include +#include +#include +#include + +#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 "skill.h" -#include "battle.h" -#include "party.h" -#include "npc.h" #include "log.h" -#include "script.h" -#include "atcommand.h" -#include "date.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 -#include -#include -#include -#include +#include "script.h" +#include "skill.h" +#include "status.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; diff --git a/src/map/mob.h b/src/map/mob.h index 80175b1db..d07f78c77 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -5,12 +5,11 @@ #ifndef _MAP_MOB_H_ #define _MAP_MOB_H_ -#include "../common/mmo.h" // struct item -#include "guild.h" // struct guardian_data #include "map.h" // struct status_data, struct view_data, struct mob_skill -#include "status.h" // struct status data, struct status_change -#include "unit.h" // unit_stop_walking(), unit_stop_attack() -#include "npc.h" +#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 #define MAX_RANDOMMONSTER 5 diff --git a/src/map/npc.c b/src/map/npc.c index 20b500630..8e5854dbf 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -2,41 +2,44 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/ers.h" -#include "../common/db.h" -#include "../common/socket.h" -#include "../common/HPM.h" +#define HERCULES_CORE -#include "map.h" -#include "log.h" +#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 +#include +#include +#include +#include +#include + +#include "battle.h" +#include "chat.h" #include "clif.h" +#include "instance.h" #include "intif.h" -#include "pc.h" -#include "status.h" #include "itemdb.h" -#include "script.h" +#include "log.h" +#include "map.h" #include "mob.h" +#include "pc.h" #include "pet.h" -#include "instance.h" -#include "battle.h" +#include "script.h" #include "skill.h" +#include "status.h" #include "unit.h" -#include "npc.h" -#include "chat.h" - -#include -#include -#include -#include -#include -#include +#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; diff --git a/src/map/npc.h b/src/map/npc.h index c154b14d0..6e9686d33 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -8,10 +8,10 @@ #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" struct HPluginData; -struct block_list; -struct npc_data; struct view_data; enum npc_parse_options { diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index 9d5639efc..f245ffea5 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -2,25 +2,27 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifdef PCRE_SUPPORT +#define HERCULES_CORE -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" +#ifdef PCRE_SUPPORT -#include "mob.h" // struct mob_data #include "npc.h" // struct npc_data -#include "pc.h" // struct map_session_data -#include "script.h" // set_var() - -#include "../../3rdparty/pcre/include/pcre.h" +#include #include #include #include -#include + +#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/party.c b/src/map/party.c index cf5e7bbe3..7c49e241c 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -2,34 +2,37 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/socket.h" // last_tick -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/utils.h" -#include "../common/strlib.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // GP_BOUND_ITEMS, RENEWAL_EXP #include "party.h" + +#include +#include +#include + #include "atcommand.h" //msg_txt() -#include "pc.h" -#include "map.h" -#include "instance.h" #include "battle.h" -#include "intif.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 "itemdb.h" - -#include -#include -#include - +#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 ed8289af6..3bad22b13 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -5,11 +5,12 @@ #ifndef _MAP_PARTY_H_ #define _MAP_PARTY_H_ -#include "../common/mmo.h" // struct party -#include "../config/core.h" #include -#include "map.h" +#include "map.h" // TBL_PC +#include "../common/cbasetypes.h" +#include "../common/db.h" +#include "../common/mmo.h" // struct party #define PARTY_BOOKING_JOBS 6 #define PARTY_BOOKING_RESULTS 10 diff --git a/src/map/path.c b/src/map/path.c index ae9fc389d..d02e9ee4a 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -2,20 +2,23 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#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 HERCULES_CORE +#include "../config/core.h" // CELL_NOSTACK, CIRCULAR_AREA #include "path.h" -#include "map.h" #include #include #include +#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 0b67a0120..b48ff05fb 100644 --- a/src/map/path.h +++ b/src/map/path.h @@ -6,6 +6,7 @@ #define _MAP_PATH_H_ #include "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 c8fb14e55..45adfe22a 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2,21 +2,16 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/core.h" // get_svn_revision() -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/socket.h" // session[] -#include "../common/strlib.h" // safestrncpy() -#include "../common/timer.h" -#include "../common/utils.h" -#include "../common/conf.h" -#include "../common/mmo.h" //NAME_LENGTH -#include "../common/sysinfo.h" +#define HERCULES_CORE +#include "../config/core.h" // DBPATH, GP_BOUND_ITEMS, MAX_CARTS, MAX_SPIRITBALL, NEW_CARTS, RENEWAL, RENEWAL_ASPD, RENEWAL_CAST, RENEWAL_DROP, RENEWAL_EXP, SECURE_NPCTIMEOUT #include "pc.h" + +#include +#include +#include +#include + #include "atcommand.h" // get_atcommand_level() #include "battle.h" // battle_config #include "battleground.h" @@ -25,32 +20,40 @@ #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 "path.h" -#include "homunculus.h" -#include "instance.h" #include "mercenary.h" -#include "elemental.h" +#include "mob.h" // struct mob_data #include "npc.h" // fake_nd -#include "pet.h" // pet_unlocktarget() #include "party.h" // party->search() -#include "guild.h" // guild->search(), guild_request_info() +#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 "pc_groups.h" -#include "quest.h" - -#include -#include -#include -#include - +#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 +#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; @@ -10651,9 +10654,7 @@ void pc_defaults(void) { memset(pc->exp_table, 0, sizeof(pc->exp_table) + sizeof(pc->max_level) + sizeof(pc->statp) -#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) + sizeof(pc->level_penalty) -#endif + sizeof(pc->skill_tree) + sizeof(pc->smith_fame_list) + sizeof(pc->chemist_fame_list) diff --git a/src/map/pc.h b/src/map/pc.h index 70df9ca56..c4026a48d 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -5,23 +5,23 @@ #ifndef _MAP_PC_H_ #define _MAP_PC_H_ -#include "../common/mmo.h" // JOB_*, MAX_FAME_LIST, struct fame_list, struct mmo_charstatus -#include "../common/ers.h" -#include "../common/timer.h" // INVALID_TIMER -#include "atcommand.h" // AtCommandType +#include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT + #include "battle.h" // battle_config -#include "battleground.h" +#include "battleground.h" // enum bg_queue_types #include "buyingstore.h" // struct s_buyingstore -#include "itemdb.h" -#include "log.h" -#include "map.h" // RC_MAX -#include "mob.h" -#include "pc_groups.h" -#include "script.h" // struct script_reg, struct script_regstr +#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" // OPTION_*, struct weapon_atk -#include "unit.h" // unit_stop_attack(), unit_stop_walking() +#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 /** * Defines @@ -742,9 +742,8 @@ struct pc_interface { unsigned int exp_table[CLASS_COUNT][2][MAX_LEVEL]; unsigned int max_level[CLASS_COUNT][2]; unsigned int statp[MAX_LEVEL+1]; -#if defined(RENEWAL_DROP) || defined(RENEWAL_EXP) unsigned int level_penalty[3][RC_MAX][MAX_LEVEL*2+1]; -#endif + unsigned int equip_pos[EQI_MAX]; /* */ struct skill_tree_entry skill_tree[CLASS_COUNT][MAX_SKILL_TREE]; diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c index 906462c7e..a917ef409 100644 --- a/src/map/pc_groups.c +++ b/src/map/pc_groups.c @@ -2,6 +2,14 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#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" @@ -10,12 +18,6 @@ #include "../common/showmsg.h" #include "../common/strlib.h" // strcmp -#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() - static GroupSettings dummy_group; ///< dummy group used in dummy map sessions @see pc_get_dummy_sd() struct pc_groups_interface pcg_s; diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h index 5c03f999f..7c8cdd82a 100644 --- a/src/map/pc_groups.h +++ b/src/map/pc_groups.h @@ -5,6 +5,10 @@ #ifndef _MAP_PC_GROUPS_H_ #define _MAP_PC_GROUPS_H_ +#include "../common/cbasetypes.h" +#include "../common/conf.h" +#include "../common/db.h" + /// PC permissions enum e_pc_permission { PC_PERM_NONE = 0, // #0 diff --git a/src/map/pet.c b/src/map/pet.c index 993497434..aa2be4473 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -2,37 +2,39 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/db.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/ers.h" +#define HERCULES_CORE -#include "pc.h" -#include "status.h" -#include "map.h" -#include "path.h" -#include "intif.h" -#include "clif.h" -#include "chrif.h" #include "pet.h" -#include "itemdb.h" + +#include +#include +#include + +#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 "atcommand.h" // msg_txt() -#include "log.h" - -#include -#include -#include +#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; diff --git a/src/map/pet.h b/src/map/pet.h index 4ec30b3fb..8dde0fac2 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -5,8 +5,14 @@ #ifndef _MAP_PET_H_ #define _MAP_PET_H_ -#define MAX_PET_DB 300 -#define MAX_PETLOOT_SIZE 30 +#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 + +#define MAX_PET_DB 300 +#define MAX_PETLOOT_SIZE 30 struct s_pet_db { short class_; diff --git a/src/map/quest.c b/src/map/quest.c index bde276f9d..b76d6bc82 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -2,36 +2,37 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/malloc.h" -#include "../common/nullpo.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE -#include "map.h" -#include "pc.h" -#include "npc.h" -#include "itemdb.h" -#include "script.h" -#include "intif.h" -#include "battle.h" -#include "mob.h" -#include "party.h" -#include "unit.h" -#include "log.h" -#include "clif.h" #include "quest.h" -#include "chrif.h" +#include #include #include #include -#include #include +#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/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 quest_interface quest_s; diff --git a/src/map/quest.h b/src/map/quest.h index e01e35619..87894d639 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -5,6 +5,10 @@ #ifndef _MAP_QUEST_H_ #define _MAP_QUEST_H_ +#include "map.h" // TBL_PC +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // MAX_QUEST_OBJECTIVES + #define MAX_QUEST_DB (60355+1) // Highest quest ID + 1 struct quest_db { diff --git a/src/map/script.c b/src/map/script.c index 4d77c506b..068be8524 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2,6 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#define HERCULES_CORE + +#include "../config/core.h" // NEW_CARTS, 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 +#include +#include +#include + +#include "atcommand.h" +#include "battle.h" +#include "battleground.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" @@ -10,47 +50,10 @@ #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/sysinfo.h" - -#include "map.h" -#include "path.h" -#include "clif.h" -#include "chrif.h" -#include "itemdb.h" -#include "pc.h" -#include "status.h" -#include "storage.h" -#include "mob.h" -#include "npc.h" -#include "pet.h" -#include "mapreg.h" -#include "homunculus.h" -#include "instance.h" -#include "mercenary.h" -#include "intif.h" -#include "skill.h" -#include "status.h" -#include "chat.h" -#include "battle.h" -#include "battleground.h" -#include "party.h" -#include "guild.h" -#include "atcommand.h" -#include "log.h" -#include "unit.h" -#include "pet.h" -#include "mail.h" -#include "script.h" -#include "quest.h" -#include "elemental.h" -#include "../config/core.h" -#include -#include -#include -#include #ifndef WIN32 #include #endif diff --git a/src/map/script.h b/src/map/script.h index 90b18d87f..899c745da 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -5,17 +5,19 @@ #ifndef _MAP_SCRIPT_H_ #define _MAP_SCRIPT_H_ -#include "../common/strlib.h" //StringBuf -#include "../common/cbasetypes.h" -#include "map.h" //EVENT_NAME_LENGTH - #include #include +#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 **/ -struct map_session_data; struct eri; /** diff --git a/src/map/searchstore.c b/src/map/searchstore.c index 0144aea93..72b28aacd 100644 --- a/src/map/searchstore.c +++ b/src/map/searchstore.c @@ -2,14 +2,17 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams +#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 "battle.h" // battle_config.* -#include "clif.h" // clif->open_search_store_info, clif->search_store_info_* -#include "pc.h" // struct map_session_data -#include "searchstore.h" // struct s_search_store_info struct searchstore_interface searchstore_s; diff --git a/src/map/searchstore.h b/src/map/searchstore.h index 827e39053..c9b93ba54 100644 --- a/src/map/searchstore.h +++ b/src/map/searchstore.h @@ -5,6 +5,12 @@ #ifndef _MAP_SEARCHSTORE_H_ #define _MAP_SEARCHSTORE_H_ +#include + +#include "map.h" // MESSAGE_SIZE +#include "../common/cbasetypes.h" +#include "../common/mmo.h" // MAX_SLOTS + /** * Defines **/ diff --git a/src/map/skill.c b/src/map/skill.c index c8388770a..b2e94ec79 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2,46 +2,48 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/strlib.h" -#include "../common/utils.h" -#include "../common/ers.h" +#define HERCULES_CORE -#include "map.h" -#include "path.h" -#include "clif.h" -#include "pc.h" -#include "status.h" +#include "../config/core.h" // DBPATH, MAGIC_REFLECTION_TYPE, OFFICIAL_WALKPATH, RENEWAL, RENEWAL_CAST, VARCAST_REDUCTION() #include "skill.h" -#include "pet.h" + +#include +#include +#include +#include +#include + +#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 "elemental.h" #include "mob.h" #include "npc.h" -#include "battle.h" -#include "battleground.h" #include "party.h" -#include "itemdb.h" +#include "path.h" +#include "pc.h" +#include "pet.h" #include "script.h" -#include "intif.h" -#include "log.h" -#include "chrif.h" -#include "guild.h" -#include "date.h" +#include "status.h" #include "unit.h" - -#include -#include -#include -#include -#include - +#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 diff --git a/src/map/skill.h b/src/map/skill.h index dda310bd4..b6dbb1fcb 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -5,19 +5,23 @@ #ifndef _MAP_SKILL_H_ #define _MAP_SKILL_H_ -#include "../common/mmo.h" // MAX_SKILL, struct square -#include "../common/db.h" +#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 /** * Declarations **/ -struct map_session_data; struct homun_data; +struct map_session_data; +struct mercenary_data; struct skill_unit; -struct skill_unit_group; -struct status_change_entry; struct square; +struct status_change_entry; /** * Defines diff --git a/src/map/status.c b/src/map/status.c index 4c2bc6d22..eb06138da 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -2,43 +2,46 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/random.h" -#include "../common/showmsg.h" -#include "../common/malloc.h" -#include "../common/utils.h" -#include "../common/ers.h" -#include "../common/strlib.h" +#define HERCULES_CORE + +#include "../config/core.h" // ANTI_MAYAP_CHEAT, DBPATH, DEFTYPE_MAX, DEFTYPE_MIN, DEVOTION_REFLECT_DAMAGE, RENEWAL, RENEWAL_ASPD, RENEWAL_EDP +#include "status.h" +#include +#include +#include +#include +#include +#include + +#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 "npc.h" -#include "mob.h" -#include "clif.h" -#include "guild.h" +#include "script.h" #include "skill.h" -#include "itemdb.h" -#include "battle.h" -#include "chrif.h" #include "skill.h" -#include "status.h" -#include "script.h" #include "unit.h" -#include "homunculus.h" -#include "mercenary.h" -#include "elemental.h" #include "vending.h" - -#include -#include -#include -#include -#include -#include +#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 e47c2b365..baa586297 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -5,14 +5,18 @@ #ifndef _MAP_STATUS_H_ #define _MAP_STATUS_H_ +#include "../config/core.h" // defType, NEW_CARTS, RENEWAL, RENEWAL_ASPD + +#include "../common/cbasetypes.h" #include "../common/mmo.h" struct block_list; -struct mob_data; -struct pet_data; +struct elemental_data; struct homun_data; struct mercenary_data; -struct status_change; +struct mob_data; +struct npc_data; +struct pet_data; //Change the equation when the values are high enough to discard the //imprecision in exchange of overflow protection [Skotlex] @@ -1878,11 +1882,7 @@ struct status_interface { int hp_coefficient2[CLASS_COUNT]; int hp_sigma_val[CLASS_COUNT][MAX_LEVEL+1]; int sp_coefficient[CLASS_COUNT]; -#ifdef RENEWAL_ASPD - int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; -#else - int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE]; //[blackhole89] -#endif + int aspd_base[CLASS_COUNT][MAX_WEAPON_TYPE+1]; // +1 for RENEWAL_ASPD sc_type Skill2SCTable[MAX_SKILL]; // skill -> status int IconChangeTable[SC_MAX]; // status -> "icon" (icon is a bit of a misnomer, since there exist values with no icon associated) unsigned int ChangeFlagTable[SC_MAX]; // status -> flags diff --git a/src/map/storage.c b/src/map/storage.c index e65ed7b80..2db5fff3d 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -2,28 +2,30 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/cbasetypes.h" -#include "../common/db.h" -#include "../common/nullpo.h" -#include "../common/malloc.h" -#include "../common/showmsg.h" +#define HERCULES_CORE -#include "map.h" // struct map_session_data #include "storage.h" -#include "chrif.h" -#include "itemdb.h" -#include "clif.h" -#include "intif.h" -#include "pc.h" -#include "guild.h" -#include "battle.h" -#include "atcommand.h" -#include "log.h" #include #include #include +#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" +#include "../common/showmsg.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 8f9f904f6..5edb68cfc 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -5,11 +5,12 @@ #ifndef _MAP_STORAGE_H_ #define _MAP_STORAGE_H_ -struct storage_data; +#include "../common/cbasetypes.h" +#include "../common/db.h" + struct guild_storage; struct item; struct map_session_data; -struct DBMap; struct storage_interface { /* */ diff --git a/src/map/trade.c b/src/map/trade.c index 44b669ebd..83426c407 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -2,25 +2,27 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/socket.h" +#define HERCULES_CORE #include "trade.h" + +#include +#include + +#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 "npc.h" -#include "battle.h" -#include "chrif.h" #include "storage.h" -#include "intif.h" -#include "atcommand.h" -#include "log.h" - -#include -#include +#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 151d4bad5..0ad770e80 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -2,45 +2,48 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/showmsg.h" -#include "../common/timer.h" -#include "../common/nullpo.h" -#include "../common/db.h" -#include "../common/malloc.h" -#include "../common/random.h" -#include "../common/HPM.h" +#define HERCULES_CORE +#include "../config/core.h" // RENEWAL_CAST +#include "unit.h" + +#include +#include +#include + +#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 "mob.h" #include "pet.h" -#include "homunculus.h" -#include "instance.h" -#include "mercenary.h" -#include "elemental.h" +#include "script.h" #include "skill.h" -#include "clif.h" -#include "duel.h" -#include "npc.h" -#include "guild.h" #include "status.h" -#include "unit.h" -#include "battle.h" -#include "battleground.h" -#include "chat.h" +#include "storage.h" #include "trade.h" #include "vending.h" -#include "party.h" -#include "intif.h" -#include "chrif.h" -#include "script.h" -#include "storage.h" - -#include -#include -#include - +#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 33fa4e052..9e05647b1 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -5,15 +5,13 @@ #ifndef _MAP_UNIT_H_ #define _MAP_UNIT_H_ -//#include "map.h" -struct block_list; -struct unit_data; -struct map_session_data; - #include "clif.h" // clr_type -#include "map.h" // struct block_list #include "path.h" // struct walkpath_data -#include "skill.h" // struct skill_timerskill, struct skill_unit_group, struct skill_unit_group_tickset +#include "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; struct unit_data { struct block_list *bl; diff --git a/src/map/vending.c b/src/map/vending.c index 9462975b3..c8ac814db 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -2,24 +2,27 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#include "../common/nullpo.h" -#include "../common/strlib.h" -#include "../common/utils.h" +#define HERCULES_CORE + +#include "vending.h" + +#include +#include + +#include "atcommand.h" +#include "battle.h" +#include "chrif.h" #include "clif.h" #include "itemdb.h" -#include "atcommand.h" +#include "log.h" #include "map.h" +#include "npc.h" #include "path.h" -#include "chrif.h" -#include "vending.h" #include "pc.h" -#include "npc.h" #include "skill.h" -#include "battle.h" -#include "log.h" - -#include -#include +#include "../common/nullpo.h" +#include "../common/strlib.h" +#include "../common/utils.h" struct vending_interface vending_s; diff --git a/src/map/vending.h b/src/map/vending.h index a212f8385..a70726374 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -7,6 +7,7 @@ #include "../common/cbasetypes.h" #include "../common/db.h" + struct map_session_data; struct s_search_store_search; diff --git a/src/tool/mapcache.c b/src/tool/mapcache.c index 85d5fb548..96d51aec6 100644 --- a/src/tool/mapcache.c +++ b/src/tool/mapcache.c @@ -1,6 +1,14 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder +#define HERCULES_CORE + +#include "../config/core.h" // RENEWAL + +#include +#include +#include + #include "../common/cbasetypes.h" #include "../common/grfio.h" #include "../common/malloc.h" @@ -8,12 +16,6 @@ #include "../common/showmsg.h" #include "../common/utils.h" -#include "../config/renewal.h" - -#include -#include -#include - #ifndef _WIN32 #include #endif -- cgit v1.2.3-70-g09d2 From 5d67f33135a5305665f78307e03fa9aee7aa544b Mon Sep 17 00:00:00 2001 From: Haru Date: Tue, 13 May 2014 18:17:52 +0200 Subject: Removed trailing whitespace (sources) Signed-off-by: Haru --- src/char/char.c | 12 +- src/char/int_auction.c | 2 +- src/char/int_party.c | 6 +- src/char/int_party.h | 2 +- src/common/HPM.c | 4 +- src/common/atomic.h | 8 +- src/common/cbasetypes.h | 2 +- src/common/db.c | 28 +- src/common/db.h | 40 +- src/common/ers.c | 34 +- src/common/ers.h | 12 +- src/common/malloc.c | 4 +- src/common/mutex.c | 2 +- src/common/mutex.h | 34 +- src/common/nullpo.c | 2 +- src/common/showmsg.c | 34 +- src/common/socket.c | 8 +- src/common/spinlock.h | 4 +- src/common/sql.c | 5 +- src/common/sql.h | 6 +- src/common/strlib.c | 12 +- src/common/thread.c | 41 +- src/common/thread.h | 38 +- src/common/timer.c | 4 +- src/common/timer.h | 4 +- src/common/utils.c | 4 +- src/common/winapi.h | 4 +- src/config/const.h | 2 +- src/login/login.c | 6 +- src/map/atcommand.c | 12 +- src/map/battle.c | 35 +- src/map/battle.h | 4 +- src/map/chat.c | 6 +- src/map/chat.h | 4 +- src/map/chrif.c | 8 +- src/map/chrif.h | 2 +- src/map/clif.c | 32 +- src/map/duel.c | 4 +- src/map/duel.h | 2 +- src/map/elemental.c | 2 +- src/map/elemental.h | 2 +- src/map/guild.c | 6 +- src/map/intif.c | 2 +- src/map/intif.h | 4 +- src/map/itemdb.c | 17 +- src/map/map.c | 4 +- src/map/map.h | 6 +- src/map/mercenary.c | 2 +- src/map/mercenary.h | 2 +- src/map/mob.c | 2 +- src/map/npc.c | 4 +- src/map/npc_chat.c | 27 +- src/map/packets.h | 26 +- src/map/packets_struct.h | 2 +- src/map/party.c | 2 +- src/map/party.h | 2 +- src/map/path.c | 4 +- src/map/pc.c | 10 +- src/map/pc.h | 2 +- src/map/pc_groups.c | 2 +- src/map/pet.c | 28 +- src/map/skill.c | 42 +- src/map/skill.h | 2 +- src/map/sql/CMakeLists.txt | 2 +- src/map/status.c | 24 +- src/map/status.h | 1539 ++++++++++++++++++++++---------------------- src/map/unit.c | 8 +- src/map/vending.c | 2 +- src/plugins/db2sql.c | 2 +- src/plugins/dbghelpplug.c | 23 +- src/test/test_spinlock.c | 15 +- 71 files changed, 1147 insertions(+), 1143 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/char/char.c b/src/char/char.c index 6c0902644..289df62a4 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -797,7 +797,7 @@ int memitemdata_to_sql(const struct item items[], int max, int id, int tableswit StrBuf->Printf(&buf, "UPDATE `%s` SET `amount`='%d', `equip`='%d', `identify`='%d', `refine`='%d',`attribute`='%d', `expire_time`='%u', `bound`='%d'", tablename, items[i].amount, items[i].equip, items[i].identify, items[i].refine, items[i].attribute, items[i].expire_time, items[i].bound); for( j = 0; j < MAX_SLOTS; ++j )for( j = 0; j < MAX_SLOTS; ++j ) - StrBuf->Printf(&buf, ", `card%d`=%d", j, items[i].card[j]); + StrBuf->Printf(&buf, ", `card%d`=%d", j, items[i].card[j]); StrBuf->Printf(&buf, " WHERE `id`='%d' LIMIT 1", item.id); if( SQL_ERROR == SQL->QueryStr(sql_handle, StrBuf->Value(&buf)) ) @@ -1674,7 +1674,7 @@ int make_new_char_sql(struct char_session_data* sd, char* name_, int str, int ag { if( SQL_ERROR == SQL->Query(sql_handle, "INSERT INTO `%s` (`char_id`,`nameid`, `amount`, `identify`) VALUES ('%d', '%d', '%d', '%d')", - inventory_db, char_id, start_items[k], 1, 1) + inventory_db, char_id, start_items[k], 1, 1) ) Sql_ShowDebug(sql_handle); } @@ -2048,7 +2048,7 @@ int mmo_char_send006b(int fd, struct char_session_data* sd) int j, offset = 0; #if PACKETVER >= 20100413 offset += 3; -#endif +#endif if (save_log) ShowInfo("Loading Char Data ("CL_BOLD"%d"CL_RESET")\n",sd->account_id); @@ -3978,7 +3978,7 @@ static void char_delete2_req(int fd, struct char_session_data* sd) // see issue: 7338 if( char_aegis_delete ) { - if( SQL_SUCCESS != SQL->Query(sql_handle, "SELECT `party_id`, `guild_id` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) + if( SQL_SUCCESS != SQL->Query(sql_handle, "SELECT `party_id`, `guild_id` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) || SQL_SUCCESS != SQL->NextRow(sql_handle) ) { @@ -4268,7 +4268,7 @@ int parse_char(int fd) #if PACKETVER >= 20110309 if( *pincode->enabled ){ // hack check - struct online_char_data* character; + struct online_char_data* character; character = (struct online_char_data*)idb_get(online_char_db, sd->account_id); if( character && character->pincode_enable == -1){ WFIFOHEAD(fd,3); @@ -4508,7 +4508,7 @@ int parse_char(int fd) int i; #if PACKETVER >= 20110309 if( *pincode->enabled ){ // hack check - struct online_char_data* character; + struct online_char_data* character; character = (struct online_char_data*)idb_get(online_char_db, sd->account_id); if( character && character->pincode_enable == -1 ){ WFIFOHEAD(fd,3); diff --git a/src/char/int_auction.c b/src/char/int_auction.c index 886b5be26..d246e9851 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -268,7 +268,7 @@ static void mapif_parse_Auction_requestlist(int fd) for( auction = dbi_first(iter); dbi_exists(iter); auction = dbi_next(iter) ) { - if( (type == 0 && auction->type != IT_ARMOR && auction->type != IT_PETARMOR) || + if( (type == 0 && auction->type != IT_ARMOR && auction->type != IT_PETARMOR) || (type == 1 && auction->type != IT_WEAPON) || (type == 2 && auction->type != IT_CARD) || (type == 3 && auction->type != IT_ETC) || diff --git a/src/char/int_party.c b/src/char/int_party.c index 3e4a743d6..5dd64a32b 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -652,7 +652,7 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id if (p == NULL) return 0; - for(i = 0; i < MAX_PARTY && + for(i = 0; i < MAX_PARTY && (p->party.member[i].account_id != account_id || p->party.member[i].char_id != char_id); i++); @@ -666,7 +666,7 @@ int mapif_parse_PartyChangeMap(int fd, int party_id, int account_id, int char_id else p->party.count--; // Even share check situations: Family state (always breaks) - // character logging on/off is max/min level (update level range) + // character logging on/off is max/min level (update level range) // or character logging on/off has a different level (update level range using new level) if (p->family || (p->party.member[i].lv <= p->min_lv || p->party.member[i].lv >= p->max_lv) || @@ -731,7 +731,7 @@ int mapif_parse_PartyLeaderChange(int fd,int party_id,int account_id,int char_id for (i = 0; i < MAX_PARTY; i++) { - if(p->party.member[i].leader) + if(p->party.member[i].leader) p->party.member[i].leader = 0; if(p->party.member[i].account_id == account_id && p->party.member[i].char_id == char_id) diff --git a/src/char/int_party.h b/src/char/int_party.h index 098c1e9a9..33325b46b 100644 --- a/src/char/int_party.h +++ b/src/char/int_party.h @@ -6,7 +6,7 @@ //Party Flags on what to save/delete. enum { - PS_CREATE = 0x01, //Create a new party entry (index holds leader's info) + PS_CREATE = 0x01, //Create a new party entry (index holds leader's info) PS_BASIC = 0x02, //Update basic party info. PS_LEADER = 0x04, //Update party's leader PS_ADDMEMBER = 0x08, //Specify new party member (index specifies which party member) diff --git a/src/common/HPM.c b/src/common/HPM.c index 00b92dc60..d33a4c1aa 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -505,7 +505,7 @@ bool hplugins_addpacket(unsigned short cmd, short length,void (*receive) (int fd return true; } -/* +/* 0 = unknown 1 = OK 2 = incomplete @@ -635,7 +635,7 @@ bool hpm_add_arg(unsigned int pluginID, char *name, bool has_param, void (*func) CREATE(data, struct HPMArgData, 1); - data->pluginID = pluginID; + data->pluginID = pluginID; data->name = aStrdup(name); data->func = func; data->help = help; diff --git a/src/common/atomic.h b/src/common/atomic.h index 8c01943e7..1349d0887 100644 --- a/src/common/atomic.h +++ b/src/common/atomic.h @@ -4,16 +4,16 @@ #ifndef _COMMON_ATOMIC_H_ #define _COMMON_ATOMIC_H_ -// Atomic Operations +// Atomic Operations // (Interlocked CompareExchange, Add .. and so on ..) -// +// // Implementation varies / depends on: // - Architecture // - Compiler // - Operating System // // our Abstraction is fully API-Compatible to Microsofts implementation @ NT5.0+ -// +// #include "../common/cbasetypes.h" #if defined(_MSC_VER) @@ -36,7 +36,7 @@ forceinline int64 InterlockedCompareExchange64(volatile int64 *dest, int64 exch, mov ecx,4[edi]; mov esi,dest; - lock CMPXCHG8B [esi]; + lock CMPXCHG8B [esi]; } } diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index da0d6b307..ac65b08a8 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -313,7 +313,7 @@ typedef char bool; #undef swap #endif // hmm only ints? -//#define swap(a,b) { int temp=a; a=b; b=temp;} +//#define swap(a,b) { int temp=a; a=b; b=temp;} // if using macros then something that is type independent //#define swap(a,b) ((a == b) || ((a ^= b), (b ^= a), (a ^= b))) // Avoid "value computed is not used" warning and generates the same assembly code diff --git a/src/common/db.c b/src/common/db.c index 1781aa96f..bbeaf0b61 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -94,7 +94,7 @@ \*****************************************************************************/ /** - * If defined statistics about database nodes, database creating/destruction + * If defined statistics about database nodes, database creating/destruction * and function usage are keept and displayed when finalizing the database * system. * WARNING: This adds overhead to every database operation (not shure how much). @@ -522,7 +522,7 @@ static void db_rebalance_erase(DBNode node, DBNode *root) x_parent = y->parent; if (x) x->parent = y->parent; y->parent->left = x; - // put the right of 'node' in 'y' + // put the right of 'node' in 'y' y->right = node->right; node->right->parent = y; // 'y' is a direct child of 'node' @@ -1409,7 +1409,7 @@ DBData* dbit_obj_prev(DBIterator* self, DBKey* out_key) /** * Returns true if the fetched entry exists. - * The databases entries might have NULL data, so use this to to test if + * The databases entries might have NULL data, so use this to to test if * the iterator is done. * @param self Iterator * @return true if the entry exists @@ -1426,7 +1426,7 @@ bool dbit_obj_exists(DBIterator* self) /** * Removes the current entry from the database. - * NOTE: {@link DBIterator#exists} will return false until another entry + * NOTE: {@link DBIterator#exists} will return false until another entry * is fetched * Puts data of the removed entry in out_data, if out_data is not NULL. * @param self Iterator @@ -1477,7 +1477,7 @@ void dbit_obj_destroy(DBIterator* self) /** * Returns a new iterator for this database. * The iterator keeps the database locked until it is destroyed. - * The database will keep functioning normally but will only free internal + * The database will keep functioning normally but will only free internal * memory when unlocked, so destroy the iterator as soon as possible. * @param self Database * @return New iterator @@ -1615,7 +1615,7 @@ static DBData* db_obj_get(DBMap* self, DBKey key) * It puts a maximum of max entries into buf. * If buf is NULL, it only counts the matches. * Returns the number of entries that matched. - * NOTE: if the value returned is greater than max, only the + * NOTE: if the value returned is greater than max, only the * first max entries found are put into the buffer. * @param self Interface of the database * @param buf Buffer to put the data of the matched entries @@ -1686,7 +1686,7 @@ static unsigned int db_obj_vgetall(DBMap* self, DBData **buf, unsigned int max, * It puts a maximum of max entries into buf. * If buf is NULL, it only counts the matches. * Returns the number of entries that matched. - * NOTE: if the value returned is greater than max, only the + * NOTE: if the value returned is greater than max, only the * first max entries found are put into the buffer. * @param self Interface of the database * @param buf Buffer to put the data of the matched entries @@ -1714,7 +1714,7 @@ static unsigned int db_obj_getall(DBMap* self, DBData **buf, unsigned int max, D /** * Get the data of the entry identified by the key. - * If the entry does not exist, an entry is added with the data returned by + * If the entry does not exist, an entry is added with the data returned by * create. * @param self Interface of the database * @param key Key that identifies the entry @@ -1813,7 +1813,7 @@ static DBData* db_obj_vensure(DBMap* self, DBKey key, DBCreateData create, va_li /** * Just calls {@link DBMap#vensure}. * Get the data of the entry identified by the key. - * If the entry does not exist, an entry is added with the data returned by + * If the entry does not exist, an entry is added with the data returned by * create. * @param self Interface of the database * @param key Key that identifies the entry @@ -2163,7 +2163,7 @@ static int db_obj_vclear(DBMap* self, DBApply func, va_list args) * Before deleting an entry, func is applied to it. * Releases the key and the data. * Returns the sum of values returned by func, if it exists. - * NOTE: This locks the database globally. Any attempt to insert or remove + * NOTE: This locks the database globally. Any attempt to insert or remove * a database entry will give an error and be aborted (except for clearing). * @param self Interface of the database * @param func Function to be applied to every entry before deleting @@ -2191,7 +2191,7 @@ static int db_obj_clear(DBMap* self, DBApply func, ...) * Finalize the database, feeing all the memory it uses. * Before deleting an entry, func is applied to it. * Returns the sum of values returned by func, if it exists. - * NOTE: This locks the database globally. Any attempt to insert or remove + * NOTE: This locks the database globally. Any attempt to insert or remove * a database entry will give an error and be aborted (except for clearing). * @param self Interface of the database * @param func Function to be applied to every entry before deleting @@ -2246,7 +2246,7 @@ static int db_obj_vdestroy(DBMap* self, DBApply func, va_list args) * Before deleting an entry, func is applied to it. * Releases the key and the data. * Returns the sum of values returned by func, if it exists. - * NOTE: This locks the database globally. Any attempt to insert or remove + * NOTE: This locks the database globally. Any attempt to insert or remove * a database entry will give an error and be aborted. * @param self Database * @param func Function to be applied to every entry before deleting @@ -2448,7 +2448,7 @@ DBHasher db_default_hash(DBType type) } /** - * Returns the default releaser for the specified type of database with the + * Returns the default releaser for the specified type of database with the * specified options. * NOTE: the options are fixed with {@link #db_fix_options(DBType,DBOptions)} * before choosing the releaser. @@ -2509,7 +2509,7 @@ DBReleaser db_custom_release(DBRelease which) * @param line Line of the file where the database is being allocated * @param type Type of database * @param options Options of the database - * @param maxlen Maximum length of the string to be used as key in string + * @param maxlen Maximum length of the string to be used as key in string * databases. If 0, the maximum number of maxlen is used (64K). * @return The interface of the database * @public diff --git a/src/common/db.h b/src/common/db.h index 0d2548806..f5714ceaf 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -79,7 +79,7 @@ typedef enum DBRelease { /** * Supported types of database. - * See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the + * See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the * types of databases. * @param DB_INT Uses int's for keys * @param DB_UINT Uses unsigned int's for keys @@ -107,14 +107,14 @@ typedef enum DBType { /** * Bitfield of options that define the behaviour of the database. - * See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the + * See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the * types of databases. * @param DB_OPT_BASE Base options: does not duplicate keys, releases nothing * and does not allow NULL keys or NULL data. - * @param DB_OPT_DUP_KEY Duplicates the keys internally. If DB_OPT_RELEASE_KEY + * @param DB_OPT_DUP_KEY Duplicates the keys internally. If DB_OPT_RELEASE_KEY * is defined, the real key is freed as soon as the entry is added. * @param DB_OPT_RELEASE_KEY Releases the key. - * @param DB_OPT_RELEASE_DATA Releases the data whenever an entry is removed + * @param DB_OPT_RELEASE_DATA Releases the data whenever an entry is removed * from the database. * WARNING: for funtions that return the data (like DBMap::remove), * a dangling pointer will be returned. @@ -188,7 +188,7 @@ typedef struct DBData { } DBData; /** - * Format of functions that create the data for the key when the entry doesn't + * Format of functions that create the data for the key when the entry doesn't * exist in the database yet. * @param key Key of the database entry * @param args Extra arguments of the function @@ -200,9 +200,9 @@ typedef struct DBData { typedef DBData (*DBCreateData)(DBKey key, va_list args); /** - * Format of functions to be applied to an unspecified quantity of entries of + * Format of functions to be applied to an unspecified quantity of entries of * a database. - * Any function that applies this function to the database will return the sum + * Any function that applies this function to the database will return the sum * of values returned by this function. * @param key Key of the database entry * @param data Data of the database entry @@ -280,7 +280,7 @@ typedef struct DBMap DBMap; * Database iterator. * Supports forward iteration, backward iteration and removing entries from the database. * The iterator is initially positioned before the first entry of the database. - * While the iterator exists the database is locked internally, so invoke + * While the iterator exists the database is locked internally, so invoke * {@link DBIterator#destroy} as soon as possible. * @public * @see #DBMap @@ -334,7 +334,7 @@ struct DBIterator /** * Returns true if the fetched entry exists. - * The databases entries might have NULL data, so use this to to test if + * The databases entries might have NULL data, so use this to to test if * the iterator is done. * @param self Iterator * @return true is the entry exists @@ -344,7 +344,7 @@ struct DBIterator /** * Removes the current entry from the database. - * NOTE: {@link DBIterator#exists} will return false until another entry + * NOTE: {@link DBIterator#exists} will return false until another entry * is fetched * Puts data of the removed entry in out_data, if out_data is not NULL. * @param self Iterator @@ -375,7 +375,7 @@ struct DBMap { /** * Returns a new iterator for this database. * The iterator keeps the database locked until it is destroyed. - * The database will keep functioning normally but will only free internal + * The database will keep functioning normally but will only free internal * memory when unlocked, so destroy the iterator as soon as possible. * @param self Database * @return New iterator @@ -407,7 +407,7 @@ struct DBMap { * It puts a maximum of max entries into buf. * If buf is NULL, it only counts the matches. * Returns the number of entries that matched. - * NOTE: if the value returned is greater than max, only the + * NOTE: if the value returned is greater than max, only the * first max entries found are put into the buffer. * @param self Database * @param buf Buffer to put the data of the matched entries @@ -425,7 +425,7 @@ struct DBMap { * It puts a maximum of max entries into buf. * If buf is NULL, it only counts the matches. * Returns the number of entries that matched. - * NOTE: if the value returned is greater than max, only the + * NOTE: if the value returned is greater than max, only the * first max entries found are put into the buffer. * @param self Database * @param buf Buffer to put the data of the matched entries @@ -441,7 +441,7 @@ struct DBMap { /** * Just calls {@link DBMap#vensure}. * Get the data of the entry identified by the key. - * If the entry does not exist, an entry is added with the data returned by + * If the entry does not exist, an entry is added with the data returned by * create. * @param self Database * @param key Key that identifies the entry @@ -455,7 +455,7 @@ struct DBMap { /** * Get the data of the entry identified by the key. - * If the entry does not exist, an entry is added with the data returned by + * If the entry does not exist, an entry is added with the data returned by * create. * @param self Database * @param key Key that identifies the entry @@ -552,7 +552,7 @@ struct DBMap { * Before deleting an entry, func is applied to it. * Releases the key and the data. * Returns the sum of values returned by func, if it exists. - * NOTE: This locks the database globally. Any attempt to insert or remove + * NOTE: This locks the database globally. Any attempt to insert or remove * a database entry will give an error and be aborted (except for clearing). * @param self Database * @param func Function to be applied to every entry before deleting @@ -567,7 +567,7 @@ struct DBMap { * Finalize the database, feeing all the memory it uses. * Before deleting an entry, func is applied to it. * Returns the sum of values returned by func, if it exists. - * NOTE: This locks the database globally. Any attempt to insert or remove + * NOTE: This locks the database globally. Any attempt to insert or remove * a database entry will give an error and be aborted (except for clearing). * @param self Database * @param func Function to be applied to every entry before deleting @@ -759,7 +759,7 @@ DBComparator (*default_cmp) (DBType type); DBHasher (*default_hash) (DBType type); /** - * Returns the default releaser for the specified type of database with the + * Returns the default releaser for the specified type of database with the * specified options. * NOTE: the options are fixed by {@link #db_fix_options(DBType,DBOptions)} * before choosing the releaser @@ -788,7 +788,7 @@ DBReleaser (*custom_release) (DBRelease which); /** * Allocate a new database of the specified type. - * It uses the default comparator, hasher and releaser of the specified + * It uses the default comparator, hasher and releaser of the specified * database type and fixed options. * NOTE: the options are fixed by {@link #db_fix_options(DBType,DBOptions)} * before creating the database. @@ -796,7 +796,7 @@ DBReleaser (*custom_release) (DBRelease which); * @param line Line of the file where the database is being allocated * @param type Type of database * @param options Options of the database - * @param maxlen Maximum length of the string to be used as key in string + * @param maxlen Maximum length of the string to be used as key in string * databases. If 0, the maximum number of maxlen is used (64K). * @return The interface of the database * @public diff --git a/src/common/ers.c b/src/common/ers.c index d9895e4f2..39e05a14c 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -78,7 +78,7 @@ typedef struct ers_cache // Memory blocks array unsigned char **Blocks; - // Max number of blocks + // Max number of blocks unsigned int Max; // Free objects count @@ -190,26 +190,19 @@ static void *ers_obj_alloc_entry(ERS self) struct ers_instance_t *instance = (struct ers_instance_t *)self; void *ret; - if (instance == NULL) - { + if (instance == NULL) { ShowError("ers_obj_alloc_entry: NULL object, aborting entry freeing.\n"); return NULL; } - if (instance->Cache->ReuseList != NULL) - { + if (instance->Cache->ReuseList != NULL) { ret = (void *)((unsigned char *)instance->Cache->ReuseList + sizeof(struct ers_list)); instance->Cache->ReuseList = instance->Cache->ReuseList->Next; - } - else if (instance->Cache->Free > 0) - { + } else if (instance->Cache->Free > 0) { instance->Cache->Free--; ret = &instance->Cache->Blocks[instance->Cache->Used - 1][instance->Cache->Free * instance->Cache->ObjectSize + sizeof(struct ers_list)]; - } - else - { - if (instance->Cache->Used == instance->Cache->Max) - { + } else { + if (instance->Cache->Used == instance->Cache->Max) { instance->Cache->Max = (instance->Cache->Max * 4) + 3; RECREATE(instance->Cache->Blocks, unsigned char *, instance->Cache->Max); } @@ -237,13 +230,10 @@ static void ers_obj_free_entry(ERS self, void *entry) struct ers_instance_t *instance = (struct ers_instance_t *)self; struct ers_list *reuse = (struct ers_list *)((unsigned char *)entry - sizeof(struct ers_list)); - if (instance == NULL) - { + if (instance == NULL) { ShowError("ers_obj_free_entry: NULL object, aborting entry freeing.\n"); return; - } - else if (entry == NULL) - { + } else if (entry == NULL) { ShowError("ers_obj_free_entry: NULL entry, nothing to free.\n"); return; } @@ -261,11 +251,10 @@ static size_t ers_obj_entry_size(ERS self) { struct ers_instance_t *instance = (struct ers_instance_t *)self; - if (instance == NULL) - { + if (instance == NULL) { ShowError("ers_obj_entry_size: NULL object, aborting entry freeing.\n"); return 0; - } + } return instance->Cache->ObjectSize; } @@ -274,8 +263,7 @@ static void ers_obj_destroy(ERS self) { struct ers_instance_t *instance = (struct ers_instance_t *)self; - if (instance == NULL) - { + if (instance == NULL) { ShowError("ers_obj_destroy: NULL object, aborting entry freeing.\n"); return; } diff --git a/src/common/ers.h b/src/common/ers.h index 23a996923..7eceaf87a 100644 --- a/src/common/ers.h +++ b/src/common/ers.h @@ -55,7 +55,7 @@ /** * Define this to disable the Entry Reusage System. * All code except the typedef of ERInterface will be disabled. - * To allow a smooth transition, + * To allow a smooth transition, */ //#define DISABLE_ERS @@ -63,7 +63,7 @@ * Entries are aligned to ERS_ALIGNED bytes in the blocks of entries. * By default it aligns to one byte, using the "natural order" of the entries. * This should NEVER be set to zero or less. - * If greater than one, some memory can be wasted. This should never be needed + * If greater than one, some memory can be wasted. This should never be needed * but is here just in case some aligment issues arise. */ #ifndef ERS_ALIGNED @@ -118,7 +118,7 @@ typedef struct eri { /** * Destroy this instance of the manager. * The manager is actually only destroyed when all the instances are destroyed. - * When destroying the manager a warning is shown if the manager has + * When destroying the manager a warning is shown if the manager has * missing/extra entries. * @param self Interface of the entry manager */ @@ -140,7 +140,7 @@ typedef struct eri { # define ers_report() # define ers_final() #else /* not DISABLE_ERS */ -// These defines should be used to allow the code to keep working whenever +// These defines should be used to allow the code to keep working whenever // the system is disabled # define ers_alloc(obj,type) ((type *)(obj)->alloc(obj)) # define ers_free(obj,entry) ((obj)->free((obj),(entry))) @@ -151,9 +151,9 @@ typedef struct eri { /** * Get a new instance of the manager that handles the specified entry size. * Size has to greater than 0. - * If the specified size is smaller than a pointer, the size of a pointer is + * If the specified size is smaller than a pointer, the size of a pointer is * used instead. - * It's also aligned to ERS_ALIGNED bytes, so the smallest multiple of + * It's also aligned to ERS_ALIGNED bytes, so the smallest multiple of * ERS_ALIGNED that is greater or equal to size is what's actually used. * @param The requested size of the entry in bytes * @return Interface of the object diff --git a/src/common/malloc.c b/src/common/malloc.c index 13cf0b5ce..74303fa92 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -21,7 +21,7 @@ struct malloc_interface iMalloc_s; #if defined(MEMWATCH) -# include +# include # 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)) @@ -421,7 +421,7 @@ void _mfree(void *ptr, const char *file, int line, const char *func ) struct unit_head *head; if (ptr == NULL) - return; + return; head = (struct unit_head *)((char *)ptr - sizeof(struct unit_head) + sizeof(long)); if(head->size == 0) { diff --git a/src/common/mutex.c b/src/common/mutex.c index 12524c3b7..1de707e95 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -119,7 +119,7 @@ void ramutex_unlock( ramutex m ){ /////////////// // Condition Variables -// +// // Implementation: // diff --git a/src/common/mutex.h b/src/common/mutex.h index 3b83b66d6..f78e31841 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -1,5 +1,5 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL -// For more information, see LICENCE in the main folder +// For more information, see LICENCE in the main folder #ifndef _COMMON_MUTEX_H_ #define _COMMON_MUTEX_H_ @@ -10,36 +10,36 @@ typedef struct ramutex *ramutex; // Mutex typedef struct racond *racond; // Condition Var /** - * Creates a Mutex + * Creates a Mutex * * @return not NULL */ ramutex ramutex_create(); -/** +/** * Destroys a Mutex - * + * * @param m - the mutex to destroy */ void ramutex_destroy( ramutex m ); -/** +/** * Gets a lock * * @param m - the mutex to lock */ void ramutex_lock( ramutex m); -/** +/** * Trys to get the Lock - * + * * @param m - the mutex try to lock - * + * * @return boolean (true = got the lock) */ bool ramutex_trylock( ramutex m ); -/** +/** * Unlocks a mutex * * @param m - the mutex to unlock @@ -47,14 +47,14 @@ bool ramutex_trylock( ramutex m ); void ramutex_unlock( ramutex m); -/** +/** * Creates a Condition variable * * @return not NULL */ racond racond_create(); -/** +/** * Destroy a Condition variable * * @param c - the condition varaible to destroy @@ -63,14 +63,14 @@ void racond_destroy( racond c ); /** * Waits Until state is signalled - * - * @param c - the condition var to wait for signalled state + * + * @param c - the condition var to wait for signalled state * @param m - the mutex used for syncronization * @param timeout_ticks - timeout in ticks ( -1 = INFINITE ) */ void racond_wait( racond c, ramutex m, sysint timeout_ticks); -/** +/** * Sets the given condition var to signalled state * * @param c - condition var to set in signalled state. @@ -80,13 +80,13 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks); */ void racond_signal( racond c ); -/** +/** * Sets notifys all waiting threads thats signalled. * @param c - condition var to set in signalled state - * + * * @note: * All Waiters getting notified. - */ + */ void racond_broadcast( racond c ); diff --git a/src/common/nullpo.c b/src/common/nullpo.c index 1891835f1..a3471b00d 100644 --- a/src/common/nullpo.c +++ b/src/common/nullpo.c @@ -14,7 +14,7 @@ /** * Reports failed assertions or NULL pointers - * + * * @param file Source file where the error was detected * @param line Line * @param func Function diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 1dbcba282..2a8e2d5f8 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -91,7 +91,7 @@ int console_msg_log = 0;//[Ind] msg error logging // ansi compatible printf with control sequence parser for windows // fast hack, handle with care, not everything implemented // -// \033[#;...;#m - Set Graphics Rendition (SGR) +// \033[#;...;#m - Set Graphics Rendition (SGR) // // printf("\x1b[1;31;40m"); // Bright red on black // printf("\x1b[3;33;45m"); // Blinking yellow on magenta (blink not implemented) @@ -110,19 +110,19 @@ int console_msg_log = 0;//[Ind] msg error logging // 8 - Concealed (invisible) // // \033[#A - Cursor Up (CUU) -// Moves the cursor up by the specified number of lines without changing columns. +// Moves the cursor up by the specified number of lines without changing columns. // If the cursor is already on the top line, this sequence is ignored. \e[A is equivalent to \e[1A. // // \033[#B - Cursor Down (CUD) -// Moves the cursor down by the specified number of lines without changing columns. +// Moves the cursor down by the specified number of lines without changing columns. // If the cursor is already on the bottom line, this sequence is ignored. \e[B is equivalent to \e[1B. // // \033[#C - Cursor Forward (CUF) -// Moves the cursor forward by the specified number of columns without changing lines. +// Moves the cursor forward by the specified number of columns without changing lines. // If the cursor is already in the rightmost column, this sequence is ignored. \e[C is equivalent to \e[1C. // // \033[#D - Cursor Backward (CUB) -// Moves the cursor back by the specified number of columns without changing lines. +// Moves the cursor back by the specified number of columns without changing lines. // If the cursor is already in the leftmost column, this sequence is ignored. \e[D is equivalent to \e[1D. // // \033[#E - Cursor Next Line (CNL) @@ -135,15 +135,15 @@ int console_msg_log = 0;//[Ind] msg error logging // Moves the cursor to indicated column in current row. \e[G is equivalent to \e[1G. // // \033[#;#H - Cursor Position (CUP) -// Moves the cursor to the specified position. The first # specifies the line number, -// the second # specifies the column. If you do not specify a position, the cursor moves to the home position: +// Moves the cursor to the specified position. The first # specifies the line number, +// the second # specifies the column. If you do not specify a position, the cursor moves to the home position: // the upper-left corner of the screen (line 1, column 1). // // \033[#;#f - Horizontal & Vertical Position // (same as \033[#;#H) // // \033[s - Save Cursor Position (SCP) -// The current cursor position is saved. +// The current cursor position is saved. // // \033[u - Restore cursor position (RCP) // Restores the cursor position saved with the (SCP) sequence \033[s. @@ -213,7 +213,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) WriteFile(handle, p, (DWORD)(q-p), &written, 0); if( q[1]!='[' ) - { // write the escape char (whatever purpose it has) + { // write the escape char (whatever purpose it has) if(0==WriteConsole(handle, q, 1, &written, 0) ) WriteFile(handle,q, 1, &written, 0); p=q+1; //and start searching again @@ -233,7 +233,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) q=q+2; for(;;) { - if( ISDIGIT(*q) ) + if( ISDIGIT(*q) ) { // add number to number array, only accept 2digits, shift out the rest // so // \033[123456789m will become \033[89m numbers[numpoint] = (numbers[numpoint]<<4) | (*q-'0'); @@ -350,12 +350,12 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) else if(num==2) { // Number of chars on screen. cnt = info.dwSize.X * info.dwSize.Y; - SetConsoleCursorPosition(handle, origin); + SetConsoleCursorPosition(handle, origin); } else// 0 and default { // number of chars from cursor to end origin = info.dwCursorPosition; - cnt = info.dwSize.X * (info.dwSize.Y - info.dwCursorPosition.Y) - info.dwCursorPosition.X; + cnt = info.dwSize.X * (info.dwSize.Y - info.dwCursorPosition.Y) - info.dwCursorPosition.X; } FillConsoleOutputAttribute(handle, info.wAttributes, cnt, origin, &tmp); FillConsoleOutputCharacter(handle, ' ', cnt, origin, &tmp); @@ -389,7 +389,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) else if( *q == 'H' || *q == 'f' ) { // \033[#;#H - Cursor Position (CUP) // \033[#;#f - Horizontal & Vertical Position - // The first # specifies the line number, the second # specifies the column. + // The first # specifies the line number, the second # specifies the column. // The default for both is 1 info.dwCursorPosition.X = (numbers[numpoint])?(numbers[numpoint]>>4)*10+((numbers[numpoint]&0x0F)-1):0; info.dwCursorPosition.Y = (numpoint && numbers[numpoint-1])?(numbers[numpoint-1]>>4)*10+((numbers[numpoint-1]&0x0F)-1):0; @@ -486,7 +486,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) --q; } // skip the sequencer and search again - p = q+1; + p = q+1; break; }// end while } @@ -542,7 +542,7 @@ int VFPRINTF(FILE *file, const char *fmt, va_list argptr) { // find the escape character fprintf(file, "%.*s", (int)(q-p), p); // write up to the escape if( q[1]!='[' ) - { // write the escape char (whatever purpose it has) + { // write the escape char (whatever purpose it has) fprintf(file, "%.*s", 1, q); p=q+1; //and start searching again } @@ -555,7 +555,7 @@ int VFPRINTF(FILE *file, const char *fmt, va_list argptr) q=q+2; while(1) { - if( ISDIGIT(*q) ) + if( ISDIGIT(*q) ) { ++q; // and next character @@ -624,7 +624,7 @@ int VFPRINTF(FILE *file, const char *fmt, va_list argptr) --q; } // skip the sequencer and search again - p = q+1; + p = q+1; break; }// end while } diff --git a/src/common/socket.c b/src/common/socket.c index 3738f2c2a..ac6be68fe 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -64,7 +64,7 @@ struct socket_interface sockt_s; ///////////////////////////////////////////////////////////////////// #if defined(WIN32) ///////////////////////////////////////////////////////////////////// -// windows portability layer +// windows portability layer typedef int socklen_t; @@ -110,7 +110,7 @@ int sock2fd(SOCKET s) /// Inserts the socket into the global array of sockets. /// Returns a new fd associated with the socket. -/// If there are too many sockets it closes the socket, sets an error and +/// If there are too many sockets it closes the socket, sets an error and // returns -1 instead. /// Since fd 0 is reserved, it returns values in the range [1,FD_SETSIZE[. /// @@ -293,8 +293,8 @@ void set_defaultparse(ParseFunc defaultparse) *--------------------------------------*/ void set_nonblocking(int fd, unsigned long yes) { - // FIONBIO Use with a nonzero argp parameter to enable the nonblocking mode of socket s. - // The argp parameter is zero if nonblocking is to be disabled. + // FIONBIO Use with a nonzero argp parameter to enable the nonblocking mode of socket s. + // The argp parameter is zero if nonblocking is to be disabled. if( sIoctl(fd, FIONBIO, &yes) != 0 ) ShowError("set_nonblocking: Failed to set socket #%d to non-blocking mode (%s) - Please report this!!!\n", fd, error_msg()); } diff --git a/src/common/spinlock.h b/src/common/spinlock.h index 0058e1d83..1c0825181 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -57,7 +57,7 @@ static forceinline void FinalizeSpinLock(PSPIN_LOCK lck){ static forceinline void EnterSpinLock(PSPIN_LOCK lck){ int tid = rathread_get_tid(); - // Get Sync Lock && Check if the requester thread already owns the lock. + // Get Sync Lock && Check if the requester thread already owns the lock. // if it owns, increase nesting level getsynclock(&lck->sync_lock); if(InterlockedCompareExchange(&lck->lock, tid, tid) == tid){ @@ -69,7 +69,7 @@ static forceinline void EnterSpinLock(PSPIN_LOCK lck){ dropsynclock(&lck->sync_lock); - // Spin until we've got it ! + // Spin until we've got it ! while(1){ if(InterlockedCompareExchange(&lck->lock, tid, 0) == 0){ diff --git a/src/common/sql.c b/src/common/sql.c index aeb56bff0..ffc4d63ef 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -402,8 +402,7 @@ void Sql_ShowDebug_(Sql* self, const char* debug_file, const unsigned long debug /// Frees a Sql handle returned by Sql_Malloc. -void Sql_Free(Sql* self) -{ +void Sql_Free(Sql* self) { if( self ) { SQL->FreeResult(self); @@ -549,7 +548,7 @@ static void Sql_P_ShowDebugMysqlFieldInfo(const char* prefix, enum enum_field_ty SHOW_DEBUG_OF(MYSQL_TYPE_NULL); #undef SHOW_DEBUG_TYPE_OF } - ShowDebug("%stype=%s%s, length=%d%s\n", prefix, sign, type_string, length, length_postfix); + ShowDebug("%stype=%s%s, length=%d%s\n", prefix, sign, type_string, length, length_postfix); } diff --git a/src/common/sql.h b/src/common/sql.h index 807e0843c..64d8307fc 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -147,10 +147,10 @@ struct sql_interface { /////////////////////////////////////////////////////////////////////////////// // Prepared Statements /////////////////////////////////////////////////////////////////////////////// - // Parameters are placed in the statement by embedding question mark ('?') + // Parameters are placed in the statement by embedding question mark ('?') // characters into the query at the appropriate positions. // The markers are legal only in places where they represent data. - // The markers cannot be inside quotes. Quotes will be added automatically + // The markers cannot be inside quotes. Quotes will be added automatically // when they are required. // // example queries with parameters: @@ -236,7 +236,7 @@ struct sql_interface { /// Binds the result of a column to a buffer. /// The buffer will be filled with data when the next row is fetched. - /// For string/enum buffer types there has to be enough space for the data + /// For string/enum buffer types there has to be enough space for the data /// and the nul-terminator (an extra byte). /// /// @return SQL_SUCCESS or SQL_ERROR diff --git a/src/common/strlib.c b/src/common/strlib.c index e2e802915..10e893c3a 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -192,7 +192,7 @@ char* normalize_name(char* str,const char* delims) return str; } -//stristr: Case insensitive version of strstr, code taken from +//stristr: Case insensitive version of strstr, code taken from //http://www.daniweb.com/code/snippet313.html, Dave Sinkula // const char* stristr(const char* haystack, const char* needle) @@ -618,13 +618,13 @@ int sv_parse_next(struct s_svstate* svstate) /// out_pos[0] and out_pos[1] are the start and end of line. /// Other position pairs are the start and end of fields. /// Returns the number of fields found or -1 if an error occurs. -/// +/// /// out_pos can be NULL. /// If a line terminator is found, the end position is placed there. -/// out_pos[2] and out_pos[3] for the first field, out_pos[4] and out_pos[5] +/// out_pos[2] and out_pos[3] for the first field, out_pos[4] and out_pos[5] /// for the seconds field and so on. /// Unfilled positions are set to -1. -/// +/// /// @param str String to parse /// @param len Length of the string /// @param startoff Where to start parsing @@ -668,11 +668,11 @@ int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, i /// out_fields[0] is the start of the next line. /// Other entries are the start of fields (nul-teminated). /// Returns the number of fields found or -1 if an error occurs. -/// +/// /// out_fields can be NULL. /// Fields that don't fit in out_fields are not nul-terminated. /// Extra entries in out_fields are filled with the end of the last field (empty string). -/// +/// /// @param str String to parse /// @param len Length of the string /// @param startoff Where to start parsing diff --git a/src/common/thread.c b/src/common/thread.c index 4f73aa9b3..bba56e7eb 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -17,7 +17,7 @@ #ifdef WIN32 # include "../common/winapi.h" # define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) -# define __thread __declspec( thread ) +# define __thread __declspec( thread ) #else # include # include @@ -28,8 +28,8 @@ #endif // When Compiling using MSC (on win32..) we know we have support in any case! -#ifdef _MSC_VER -#define HAS_TLS +#ifdef _MSC_VER +#define HAS_TLS #endif @@ -40,7 +40,7 @@ struct rAthread { RATHREAD_PRIO prio; rAthreadProc proc; - void *param; + void *param; #ifdef WIN32 HANDLE hThread; @@ -82,9 +82,9 @@ void rathread_init(){ void rathread_final(){ register unsigned int i; - // Unterminated Threads Left? + // Unterminated Threads Left? // Should'nt happen .. - // Kill 'em all! + // Kill 'em all! // for(i = 1; i < RA_THREADS_MAX; i++){ if(l_threads[i].proc != NULL){ @@ -116,12 +116,12 @@ static void *_raThreadMainRedirector( void *p ){ // Update myID @ TLS to right id. #ifdef HAS_TLS - g_rathread_ID = ((rAthread)p)->myID; + g_rathread_ID = ((rAthread)p)->myID; #endif #ifndef WIN32 // When using posix threads - // the threads inherits the Signal mask from the thread which's spawned + // the threads inherits the Signal mask from the thread which's spawned // this thread // so we've to block everything we dont care about. sigemptyset(&set); @@ -136,7 +136,7 @@ static void *_raThreadMainRedirector( void *p ){ ret = ((rAthread)p)->proc( ((rAthread)p)->param ) ; -#ifdef WIN32 +#ifdef WIN32 CloseHandle( ((rAthread)p)->hThread ); #endif @@ -154,7 +154,7 @@ static void *_raThreadMainRedirector( void *p ){ /// /// API Level -/// +/// rAthread rathread_create( rAthreadProc entryPoint, void *param ){ return rathread_createEx( entryPoint, param, (1<<23) /*8MB*/, RAT_PRIO_NORMAL ); }//end: rathread_create() @@ -175,7 +175,7 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta szStack += tmp; - // Get a free Thread Slot. + // Get a free Thread Slot. for(i = 0; i < RA_THREADS_MAX; i++){ if(l_threads[i].proc == NULL){ handle = &l_threads[i]; @@ -223,7 +223,6 @@ void rathread_destroy ( rAthread handle ){ if( pthread_cancel( handle->hThread ) == 0){ // We have to join it, otherwise pthread wont re-cycle its internal ressources assoc. with this thread. - // pthread_join( handle->hThread, NULL ); // Tell our manager to release ressources ;) @@ -236,10 +235,10 @@ rAthread rathread_self( ){ #ifdef HAS_TLS rAthread handle = &l_threads[g_rathread_ID]; - if(handle->proc != NULL) // entry point set, so its used! + if(handle->proc != NULL) // entry point set, so its used! return handle; #else - // .. so no tls means we have to search the thread by its api-handle .. + // .. so no tls means we have to search the thread by its api-handle .. int i; #ifdef WIN32 @@ -257,13 +256,13 @@ rAthread rathread_self( ){ #endif - return NULL; + return NULL; }//end: rathread_self() int rathread_get_tid(){ -#ifdef HAS_TLS +#ifdef HAS_TLS return g_rathread_ID; #else // todo @@ -286,7 +285,7 @@ bool rathread_wait( rAthread handle, void* *out_exitCode ){ // #ifdef WIN32 WaitForSingleObject(handle->hThread, INFINITE); - return true; + return true; #else if(pthread_join(handle->hThread, out_exitCode) == 0) return true; @@ -297,8 +296,8 @@ bool rathread_wait( rAthread handle, void* *out_exitCode ){ void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio ){ - handle->prio = RAT_PRIO_NORMAL; - //@TODO + handle->prio = RAT_PRIO_NORMAL; + //@TODO }//end: rathread_prio_set() @@ -308,9 +307,9 @@ RATHREAD_PRIO rathread_prio_get( rAthread handle){ void rathread_yield(){ -#ifdef WIN32 +#ifdef WIN32 SwitchToThread(); #else sched_yield(); -#endif +#endif }//end: rathread_yield() diff --git a/src/common/thread.h b/src/common/thread.h index 887c03179..7ad326509 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -12,7 +12,7 @@ typedef void* (*rAthreadProc)(void*); typedef enum RATHREAD_PRIO { RAT_PRIO_LOW = 0, RAT_PRIO_NORMAL, - RAT_PRIO_HIGH + RAT_PRIO_HIGH } RATHREAD_PRIO; @@ -21,18 +21,18 @@ typedef enum RATHREAD_PRIO { * * @param entyPoint - entryProc, * @param param - general purpose parameter, would be given as parameter to the thread's entrypoint. - * + * * @return not NULL if success */ rAthread rathread_create( rAthreadProc entryPoint, void *param ); -/** +/** * Creates a new Thread (with more creation options) * * @param entyPoint - entryProc, * @param param - general purpose parameter, would be given as parameter to the thread's entrypoint - * @param szStack - stack Size in bytes + * @param szStack - stack Size in bytes * @param prio - Priority of the Thread @ OS Scheduler.. * * @return not NULL if success @@ -43,29 +43,29 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta /** * Destroys the given Thread immediatly * - * @note The Handle gets invalid after call! dont use it afterwards. + * @note The Handle gets invalid after call! dont use it afterwards. * * @param handle - thread to destroy. */ void rathread_destroy ( rAthread handle ); -/** +/** * Returns the thread handle of the thread calling this function - * + * * @note this wont work @ programms main thread - * @note the underlying implementation might not perform very well, cache the value received! - * + * @note the underlying implementation might not perform very well, cache the value received! + * * @return not NULL if success */ rAthread rathread_self( ); /** - * Returns own thrad id (TID) + * Returns own thrad id (TID) * - * @note this is an unique identifier for the calling thread, and - * depends on platfrom / compiler, and may not be the systems Thread ID! + * @note this is an unique identifier for the calling thread, and + * depends on platfrom / compiler, and may not be the systems Thread ID! * * @return -1 when fails, otherwise >= 0 */ @@ -73,26 +73,26 @@ int rathread_get_tid(); /** - * Waits for the given thread to terminate + * Waits for the given thread to terminate * * @param handle - thread to wait (join) for * @param out_Exitcode - [OPTIONAL] - if given => Exitcode (value) of the given thread - if it's terminated - * + * * @return true - if the given thread has been terminated. */ bool rathread_wait( rAthread handle, void* *out_exitCode ); -/** +/** * Sets the given PRIORITY @ OS Task Scheduler - * + * * @param handle - thread to set prio for * @param rio - the priority (RAT_PRIO_LOW ... ) */ void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio ); -/** +/** * Gets the current Prio of the given trhead * * @param handle - the thread to get the prio for. @@ -102,9 +102,9 @@ RATHREAD_PRIO rathread_prio_get( rAthread handle); /** * Tells the OS scheduler to yield the execution of the calling thread - * + * * @note: this will not "pause" the thread, - * it just allows the OS to spent the remaining time + * it just allows the OS to spent the remaining time * of the slice to another thread. */ void rathread_yield(); diff --git a/src/common/timer.c b/src/common/timer.c index 5d67455dc..5240ec202 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -130,7 +130,7 @@ static void rdtsc_calibrate(){ t1 = _rdtsc(); usleep(1000000); //1000 MS t2 = _rdtsc(); - RDTSC_CLOCK += (t2 - t1) / 1000; + RDTSC_CLOCK += (t2 - t1) / 1000; } RDTSC_CLOCK /= 5; @@ -453,7 +453,7 @@ void timer_final(void) { if (free_timer_list) aFree(free_timer_list); } /*===================================== -* Default Functions : timer.h +* Default Functions : timer.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/common/timer.h b/src/common/timer.h index 1ce8cf203..a07f81612 100644 --- a/src/common/timer.h +++ b/src/common/timer.h @@ -30,13 +30,13 @@ struct TimerData { int interval; // general-purpose storage - int id; + int id; intptr_t data; }; /*===================================== -* Interface : timer.h +* Interface : timer.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/common/utils.c b/src/common/utils.c index 84925f707..80954f848 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -265,9 +265,9 @@ uint32 MakeDWord(uint16 word0, uint16 word1) ( (uint32)(word0 ) )| ( (uint32)(word1 << 0x10) ); } + /************************************* -* Big-endian compatibility functions * -* From mapcache.c * +* Big-endian compatibility functions * *************************************/ // Converts an int16 from current machine order to little-endian diff --git a/src/common/winapi.h b/src/common/winapi.h index 7ce555049..b7c2bea1e 100644 --- a/src/common/winapi.h +++ b/src/common/winapi.h @@ -7,7 +7,7 @@ #define WINVER 0x0500 #define _WIN32_IE 0x0600 #define WIN32_LEAN_AND_MEAN -#define NOCOMM +#define NOCOMM #define NOKANJI #define NOHELP #define NOMCX @@ -32,5 +32,3 @@ #include #include #include - - diff --git a/src/config/const.h b/src/config/const.h index ba06d70cb..23467bfa6 100644 --- a/src/config/const.h +++ b/src/config/const.h @@ -15,7 +15,7 @@ */ /** - * "Sane Checks" to save you from compiling with cool bugs + * "Sane Checks" to save you from compiling with cool bugs **/ #if SECURE_NPCTIMEOUT_INTERVAL <= 0 #error SECURE_NPCTIMEOUT_INTERVAL should be at least 1 (1s) diff --git a/src/login/login.c b/src/login/login.c index cb46e0226..43883c6ce 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -173,7 +173,7 @@ static int online_data_cleanup_sub(DBKey key, DBData *data, va_list ap) static int online_data_cleanup(int tid, int64 tick, int id, intptr_t data) { online_db->foreach(online_db, online_data_cleanup_sub); return 0; -} +} //-------------------------------------------------------------------- @@ -1109,7 +1109,7 @@ void login_auth_ok(struct login_session_data* sd) WFIFOW(fd,0) = 0x81; WFIFOB(fd,2) = 1; // 01 = Server closed WFIFOSET(fd,3); - return; + return; } server_num = 0; @@ -1827,7 +1827,7 @@ int do_init(int argc, char** argv) HPM->config_read(NULL, 0); HPM->event(HPET_INIT); - // server port open & binding + // server port open & binding if( (login_fd = make_listen_bind(login_config.login_ip,login_config.login_port)) == -1 ) { ShowFatalError("Failed to bind to port '"CL_WHITE"%d"CL_RESET"'\n",login_config.login_port); exit(EXIT_FAILURE); diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 7a6ad84e4..96fa9c350 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1123,14 +1123,14 @@ ACMD(item) memset(item_name, '\0', sizeof(item_name)); if (!strcmpi(info->command,"itembound") && (!message || !*message || ( - sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound) < 2 && - sscanf(message, "%99s %d %d", item_name, &number, &bound) < 2 + sscanf(message, "\"%99[^\"]\" %d %d", item_name, &number, &bound) < 2 && + sscanf(message, "%99s %d %d", item_name, &number, &bound) < 2 ))) { clif->message(fd, msg_txt(295)); // Please enter an item name or ID (usage: @itembound ). return false; } else if (!message || !*message || ( - sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && - sscanf(message, "%99s %d", item_name, &number) < 1 )) + sscanf(message, "\"%99[^\"]\" %d", item_name, &number) < 1 && + sscanf(message, "%99s %d", item_name, &number) < 1 )) { clif->message(fd, msg_txt(983)); // Please enter an item name or ID (usage: @item ). return false; @@ -10088,7 +10088,7 @@ void atcommand_config_read(const char* config_filename) { } commandinfo->log = false; } - } + } // Commands help // We only check if all commands exist @@ -10135,7 +10135,7 @@ static inline int AtCommandType2idx(AtCommandType type) { return (type-1); } /** * Loads permissions for groups to use commands. - * + * */ void atcommand_db_load_groups(GroupSettings **groups, config_setting_t **commands_, size_t sz) { diff --git a/src/map/battle.c b/src/map/battle.c index 0865ee4ba..fc2f4d3cf 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -446,7 +446,7 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u if( sc && sc->count ){ if( sc->data[SC_ZENKAI] && watk->ele == sc->data[SC_ZENKAI]->val2 ) eatk += 200; - #ifdef RENEWAL_EDP + #ifdef RENEWAL_EDP if( sc->data[SC_EDP] && skill_id != AS_GRIMTOOTH && skill_id != AS_VENOMKNIFE && skill_id != ASC_BREAKER ){ eatk = eatk * (sc->data[SC_EDP]->val4 / 100 - 1); damage = damage * (sc->data[SC_EDP]->val4 / 100); @@ -655,7 +655,7 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in damage += (skill_lv * 10); else if(pc_isriding(sd)) damage += (skill_lv * 5); - else + else damage += (skill_lv * 4); } break; @@ -737,7 +737,7 @@ int64 battle_calc_masteryfix(struct block_list *src, struct block_list *target, #endif ) damage += 3 * skill2_lv; - break; + break; #ifndef RENEWAL case NJ_KUNAI: if( weapon ) @@ -748,7 +748,7 @@ int64 battle_calc_masteryfix(struct block_list *src, struct block_list *target, if( sd->weight ) damage += sd->weight / 8 ; case RA_WUGSTRIKE: - case RA_WUGBITE: + case RA_WUGBITE: damage += 30*pc->checkskill(sd, RA_TOOTHOFWUG); break; case HT_FREEZINGTRAP: @@ -999,7 +999,7 @@ int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct block_ cardfix = cardfix * (100 + sd->right_weapon.addrace[RC_NONDEMIHUMAN]+sd->arrow_addrace[RC_NONDEMIHUMAN]) / 100; }else{ // Melee attack if( !battle_config.left_cardfix_to_right ){ - cardfix=cardfix*(100+sd->right_weapon.addrace[tstatus->race])/100; + cardfix=cardfix*(100+sd->right_weapon.addrace[tstatus->race])/100; if( !(nk&NK_NO_ELEFIX) ){ int ele_fix = sd->right_weapon.addele[tstatus->def_ele]; for (i = 0; ARRAYLENGTH(sd->right_weapon.addele2) > i && sd->right_weapon.addele2[i].rate != 0; i++) { @@ -1019,9 +1019,9 @@ int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct block_ cardfix = cardfix * (100 + sd->right_weapon.addrace[RC_NONDEMIHUMAN]) / 100; if( cflag&1 ){ - cardfix_ = cardfix_*(100+sd->left_weapon.addrace[tstatus->race])/100; + cardfix_ = cardfix_*(100+sd->left_weapon.addrace[tstatus->race])/100; if (!(nk&NK_NO_ELEFIX)){ - int ele_fix_lh = sd->left_weapon.addele[tstatus->def_ele]; + int ele_fix_lh = sd->left_weapon.addele[tstatus->def_ele]; for (i = 0; ARRAYLENGTH(sd->left_weapon.addele2) > i && sd->left_weapon.addele2[i].rate != 0; i++) { if (sd->left_weapon.addele2[i].ele != tstatus->def_ele) continue; if(!(sd->left_weapon.addele2[i].flag&wflag&BF_WEAPONMASK && @@ -1221,7 +1221,7 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_ **/ defType def1 = status->get_def(target); //Don't use tstatus->def1 due to skill timer reductions. short def2 = tstatus->def2, vit_def; -#ifdef RENEWAL +#ifdef RENEWAL def1 = status->calc_def2(target, tsc, def1, false); // equip def(RE) def2 = status->calc_def(target, tsc, def2, false); // status def(RE) #else @@ -1301,7 +1301,7 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_ if( def1 < -399 ) // it stops at -399 def1 = 399; // in aegis it set to 1 but in our case it may lead to exploitation so limit it to 399 - //return 1; + //return 1; if( flag&2 ) damage += def1 >> 1; @@ -1357,7 +1357,7 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_ **/ if( mdef < -99 ) // it stops at -99 mdef = 99; // in aegis it set to 1 but in our case it may lead to exploitation so limit it to 99 - //return 1; + //return 1; damage = (int)((100.0f - mdef / (mdef + 100.0f) * 90.0f) / 100.0f * damage - mdef2); #else @@ -2538,7 +2538,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block skillratio += sc->data[SC_LKCONCENTRATION]->val2; if( sd && sd->status.weapon == W_KATAR && (i=pc->checkskill(sd,ASC_KATAR)) > 0 ) skillratio += skillratio * (10 + 2 * i) / 100; -#endif +#endif if( sc && sc->data[SC_CRUSHSTRIKE] ){ if( sd ) {//ATK [{Weapon Level * (Weapon Upgrade Level + 6) * 100} + (Weapon ATK) + (Weapon Weight)]% @@ -2985,7 +2985,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam rnd()%100 < sce->val3) status->heal(src, damage*sce->val4/100, 0, 3); - if( (sce = sc->data[SC_FORCEOFVANGUARD]) && flag&BF_WEAPON + if( (sce = sc->data[SC_FORCEOFVANGUARD]) && flag&BF_WEAPON && rnd()%100 < sce->val2 && sc->fv_counter <= sce->val3 ) clif->millenniumshield(bl, sc->fv_counter++); @@ -4517,7 +4517,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list ATK_RATE(50); RE_SKILL_REDUCTION(); } - break; + break; case NJ_SYURIKEN: // [malufett] GET_NORMAL_ATTACK( (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0) ); wd.damage += battle->calc_masteryfix(src, target, skill_id, skill_lv, 4 * skill_lv + (sd ? sd->bonus.arrow_atk : 0), wd.div_, 0, flag.weapon) - status->get_total_def(target); @@ -4886,7 +4886,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list ATK_ADDRATE(sd->bonus.long_attack_atk_rate); if( sc && sc->data[SC_MTF_RANGEATK] ) ATK_ADDRATE(25);// temporary it should be 'bonus.long_attack_atk_rate' - #endif + #endif if( (i=pc->checkskill(sd,AB_EUCHARISTICA)) > 0 && (tstatus->race == RC_DEMON || tstatus->def_ele == ELE_DARK) ) ATK_ADDRATE(-i); @@ -5124,12 +5124,13 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list temp = pc->checkskill(sd,TF_DOUBLE); wd.damage2 = wd.damage * (1 + (temp * 2))/100; - if(wd.damage && !wd.damage2) wd.damage2 = + if(wd.damage && !wd.damage2) { #ifdef RENEWAL - 0; + wd.damage2 = 0; #else - 1; + wd.damage2 = 1; #endif + } flag.lh = 1; } } diff --git a/src/map/battle.h b/src/map/battle.h index fbe097c78..8d7e4183a 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -537,9 +537,9 @@ struct battle_interface { int64 (*attr_fix) (struct block_list *src, struct block_list *target, int64 damage, int atk_elem, int def_type, int def_lv); /* applies card modifiers */ int64 (*calc_cardfix) (int attack_type, struct block_list *src, struct block_list *target, int nk, int s_ele, int s_ele_, int64 damage, int left, int flag); - /* applies element modifiers */ + /* applies element modifiers */ int64 (*calc_elefix) (struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int nk, int n_ele, int s_ele, int s_ele_, bool left, int flag); - /* applies mastery modifiers */ + /* applies mastery modifiers */ int64 (*calc_masteryfix) (struct block_list *src, struct block_list *target, uint16 skill_id, uint16 skill_lv, int64 damage, int div, bool left, bool weapon); /* calculates chorus bonus */ int (*calc_chorusbonus) (struct map_session_data *sd); diff --git a/src/map/chat.c b/src/map/chat.c index c9d3e6d46..40a9d2348 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -157,8 +157,8 @@ bool chat_joinchat(struct map_session_data* sd, int chatid, const char* pass) { pc_setchatid(sd,cd->bl.id); clif->joinchatok(sd, cd); //To the person who newly joined the list of all - clif->addchat(cd, sd); //Reports To the person who already in the chat - clif->dispchat(cd, 0); //Reported number of changes to the people around + clif->addchat(cd, sd); //Reports To the person who already in the chat + clif->dispchat(cd, 0); //Reported number of changes to the people around chat->trigger_event(cd); //Event @@ -446,7 +446,7 @@ bool chat_npckickall(struct chat_data* cd) } /*===================================== -* Default Functions : chat.h +* Default Functions : chat.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/chat.h b/src/map/chat.h index cbc2a391e..6e4fae1c0 100644 --- a/src/map/chat.h +++ b/src/map/chat.h @@ -17,7 +17,7 @@ struct npc_data; struct chat_data { struct block_list bl; // data for this map object - char title[CHATROOM_TITLE_SIZE]; // room title + char title[CHATROOM_TITLE_SIZE]; // room title char pass[CHATROOM_PASS_SIZE]; // password bool pub; // private/public flag uint8 users; // current user count @@ -34,7 +34,7 @@ struct chat_data { }; /*===================================== -* Interface : chat.h +* Interface : chat.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/chrif.c b/src/map/chrif.c index 81e2d387c..a69cca573 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -271,7 +271,7 @@ bool chrif_save(struct map_session_data *sd, int flag) { if (flag) sd->state.storage_flag = 0; //Force close it. - //Saving of registry values. + //Saving of registry values. if (sd->vars_dirty) intif->saveregistry(sd); @@ -291,7 +291,7 @@ bool chrif_save(struct map_session_data *sd, int flag) { if( sd->md && mercenary->get_lifetime(sd->md) > 0 ) mercenary->save(sd->md); if( sd->ed && elemental->get_lifetime(sd->ed) > 0 ) - elemental->save(sd->ed); + elemental->save(sd->ed); if( sd->save_quest ) intif->quest_save(sd); @@ -1367,7 +1367,7 @@ int chrif_parse(int fd) { if (cmd < 0x2af8 || cmd >= 0x2af8 + ARRAYLENGTH(chrif->packet_len_table) || chrif->packet_len_table[cmd-0x2af8] == 0) { r = intif->parse(fd); // Passed on to the intif - if (r == 1) continue; // Treated in intif + if (r == 1) continue; // Treated in intif if (r == 2) return 0; // Didn't have enough data (len==-1) ShowWarning("chrif_parse: session #%d, intif->parse failed (unrecognized command 0x%.4x).\n", fd, cmd); @@ -1638,7 +1638,7 @@ void do_init_chrif(bool minimal) { /*===================================== -* Default Functions : chrif.h +* Default Functions : chrif.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/chrif.h b/src/map/chrif.h index 84efc66d3..661ba8f84 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -41,7 +41,7 @@ struct auth_node { }; /*===================================== -* Interface : chrif.h +* Interface : chrif.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/clif.c b/src/map/clif.c index 068cb1e07..d1ae2eb07 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -1105,7 +1105,7 @@ void clif_spawn_unit(struct block_list* bl, enum send_target target) { p.accessory = status->get_emblem_id(bl); p.accessory2 = GetWord(g_id, 1); p.accessory3 = GetWord(g_id, 0); - } + } p.headpalette = vd->hair_color; p.bodypalette = vd->cloth_color; p.headDir = (sd)? sd->head_dir : 0; @@ -1225,7 +1225,7 @@ void clif_set_unit_walking(struct block_list* bl, struct map_session_data *tsd, p.GID = -bl->id; #else p.GID = -bl->id; -#endif +#endif clif->send(&p,sizeof(p),bl,SELF); } } @@ -5639,7 +5639,7 @@ void clif_displaymessage2(const int fd, const char* mes) { } line = strtok(NULL, "\n"); } - aFree(message); + aFree(message); } } /* oh noo! another version of 0x8e! */ @@ -6170,7 +6170,7 @@ void clif_item_refine_list(struct map_session_data *sd) WFIFOHEAD(fd, MAX_INVENTORY * 13 + 4); WFIFOW(fd,0)=0x221; for(i=c=0;istatus.inventory[i].nameid > 0 && sd->status.inventory[i].identify + if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify && (wlv=itemdb_wlv(sd->status.inventory[i].nameid)) >=1 && !sd->inventory_data[i]->flag.no_refine && !(sd->status.inventory[i].equip&EQP_ARMS)){ @@ -8429,7 +8429,7 @@ void clif_message(struct block_list* bl, const char* msg) { /** * Notifies the client that the storage window is still open * - * Should only be used in cases where the client closed the + * Should only be used in cases where the client closed the * storage window without server's consent **/ void clif_refresh_storagewindow( struct map_session_data *sd ) { @@ -10312,7 +10312,7 @@ void clif_hercules_chsys_quit(struct map_session_data *sd) { sd->channel_count = 0; aFree(sd->channels); - sd->channels = NULL; + sd->channels = NULL; } /// Request for an action. @@ -11163,8 +11163,8 @@ void clif_parse_GetItemFromCart(int fd,struct map_session_data *sd) /// 012a void clif_parse_RemoveOption(int fd,struct map_session_data *sd) { - if( !(sd->sc.option&(OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR)) -#ifdef NEW_CARTS + if( !(sd->sc.option&(OPTION_RIDING|OPTION_FALCON|OPTION_DRAGON|OPTION_MADOGEAR)) +#ifdef NEW_CARTS && sd->sc.data[SC_PUSH_CART] ){ pc->setcart(sd,0); #else @@ -13716,7 +13716,7 @@ void clif_parse_GMReqNoChat(int fd,struct map_session_data *sd) { return; value = battle_config.client_accept_chatdori; - dstsd = sd; + dstsd = sd; } else { dstsd = map->id2sd(id); if( dstsd == NULL ) @@ -17557,7 +17557,7 @@ void clif_parse_CashShopOpen(int fd, struct map_session_data *sd) { WFIFOW(fd, 0) = 0x845; WFIFOL(fd, 2) = sd->cashPoints; //[Ryuuzaki] - switched positions to reflect proper values WFIFOL(fd, 6) = sd->kafraPoints; - WFIFOSET(fd, 10); + WFIFOSET(fd, 10); } void clif_parse_CashShopClose(int fd, struct map_session_data *sd) { @@ -17792,7 +17792,7 @@ void clif_bgqueue_ack(struct map_session_data *sd, enum BATTLEGROUNDS_QUEUE_ACK clif->send(&p,sizeof(p), &sd->bl, SELF); } break; - } + } } @@ -17824,7 +17824,7 @@ void clif_parse_bgqueue_register(int fd, struct map_session_data *sd) { default: clif->bgqueue_ack(sd,BGQA_FAIL_TYPE_INVALID, arena->id); return; - } + } bg->queue_add(sd, arena, (enum bg_queue_types)p->type); } @@ -19024,7 +19024,7 @@ void clif_defaults(void) { clif->search_store_info_failed = clif_search_store_info_failed; clif->open_search_store_info = clif_open_search_store_info; clif->search_store_info_click_ack = clif_search_store_info_click_ack; - /* elemental-related */ + /* elemental-related */ clif->elemental_info = clif_elemental_info; clif->elemental_updatestatus = clif_elemental_updatestatus; /* bgqueue */ @@ -19034,7 +19034,7 @@ void clif_defaults(void) { clif->bgqueue_joined = clif_bgqueue_joined; clif->bgqueue_pcleft = clif_bgqueue_pcleft; clif->bgqueue_battlebegins = clif_bgqueue_battlebegins; - /* misc-handling */ + /* misc-handling */ clif->adopt_reply = clif_Adopt_reply; clif->adopt_request = clif_Adopt_request; clif->readbook = clif_readbook; @@ -19071,7 +19071,7 @@ void clif_defaults(void) { clif->npc_market_purchase_ack = clif_npc_market_purchase_ack; /*------------------------ *- Parse Incoming Packet - *------------------------*/ + *------------------------*/ clif->pWantToConnection = clif_parse_WantToConnection; clif->pLoadEndAck = clif_parse_LoadEndAck; clif->pTickSend = clif_parse_TickSend; @@ -19125,7 +19125,7 @@ void clif_defaults(void) { clif->pUseSkillToPos = clif_parse_UseSkillToPos; clif->pUseSkillToPosSub = clif_parse_UseSkillToPosSub; clif->pUseSkillToPos_homun = clif_parse_UseSkillToPos_homun; - clif->pUseSkillToPos_mercenary = clif_parse_UseSkillToPos_mercenary; + clif->pUseSkillToPos_mercenary = clif_parse_UseSkillToPos_mercenary; clif->pUseSkillToPosMoreInfo = clif_parse_UseSkillToPosMoreInfo; clif->pUseSkillMap = clif_parse_UseSkillMap; clif->pRequestMemo = clif_parse_RequestMemo; diff --git a/src/map/duel.c b/src/map/duel.c index a423ef240..4e4eeef1f 100644 --- a/src/map/duel.c +++ b/src/map/duel.c @@ -128,7 +128,7 @@ void duel_leave(const unsigned int did, struct map_session_data* sd) { duel->list[did].members_count--; if(duel->list[did].members_count == 0) { - map->foreachpc(duel_leave_sub, did); + map->foreachpc(duel_leave_sub, did); duel->count--; } @@ -176,7 +176,7 @@ void do_init_duel(bool minimal) { } /*===================================== -* Default Functions : duel.h +* Default Functions : duel.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/duel.h b/src/map/duel.h index 956aed36d..91dfa8f83 100644 --- a/src/map/duel.h +++ b/src/map/duel.h @@ -18,7 +18,7 @@ struct duel { #define MAX_DUEL 1024 /*===================================== -* Interface : duel.h +* Interface : duel.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/elemental.c b/src/map/elemental.c index 323df41e1..b414d5b9f 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -951,7 +951,7 @@ void do_final_elemental(void) { } /*===================================== -* Default Functions : elemental.h +* Default Functions : elemental.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/elemental.h b/src/map/elemental.h index aa27aadc9..beddd3ea1 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -64,7 +64,7 @@ struct elemental_data { }; /*===================================== -* Interface : elemental.h +* Interface : elemental.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/guild.c b/src/map/guild.c index 69f67238d..935cac8c0 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -1004,7 +1004,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin //Ensure validity of pointer (ie: player logs in/out, changes map-server) g->member[idx].sd = guild->sd_check(guild_id, account_id, char_id); - if(oldonline!=online) + if(oldonline!=online) clif->guild_memberlogin_notice(g, idx, online); if(!g->member[idx].sd) @@ -2008,7 +2008,7 @@ void guild_castle_reconnect_sub(void *key, void *data, va_list ap) } /** - * Saves pending guild castle data changes when char-server is + * Saves pending guild castle data changes when char-server is * disconnected. * On reconnect pushes all changes to char-server for saving. */ @@ -2363,7 +2363,7 @@ void guild_defaults(void) { guild->flag_add = guild_flag_add; guild->flag_remove = guild_flag_remove; guild->flags_clear = guild_flags_clear; - /* guild aura */ + /* guild aura */ guild->aura_refresh = guild_guildaura_refresh; /* */ guild->payexp_timer = guild_payexp_timer; diff --git a/src/map/intif.c b/src/map/intif.c index 383150fbc..75379f6c0 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -2305,7 +2305,7 @@ int intif_parse(int fd) } /*===================================== -* Default Functions : intif.h +* Default Functions : intif.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/intif.h b/src/map/intif.h index b6ee727f3..d0eeccc6d 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -32,7 +32,7 @@ struct s_pet; /*===================================== -* Interface : intif.h +* Interface : intif.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ @@ -42,7 +42,7 @@ struct intif_interface { /* funcs */ int (*parse) (int fd); int (*create_pet)(int account_id, int char_id, short pet_type, short pet_lv, short pet_egg_id, - short pet_equip, short intimate, short hungry, char rename_flag, char incuvate, char *pet_name); + short pet_equip, short intimate, short hungry, char rename_flag, char incuvate, char *pet_name); int (*broadcast) (const char* mes, size_t len, int type); int (*broadcast2) (const char* mes, size_t len, unsigned int fontColor, short fontType, short fontSize, short fontAlign, short fontY); int (*main_message) (struct map_session_data* sd, const char* message); diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 1981f435c..9bc352276 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -27,7 +27,7 @@ struct itemdb_interface itemdb_s; /** - * Search for item name + * Search for item name * name = item alias, so we should find items aliases first. if not found then look for "jname" (full name) * @see DBApply */ @@ -55,7 +55,7 @@ int itemdb_searchname_sub(DBKey key, DBData *data, va_list ap) } /*========================================== - * Return item data from item name. (lookup) + * Return item data from item name. (lookup) *------------------------------------------*/ struct item_data* itemdb_searchname(const char *str) { struct item_data* item; @@ -256,7 +256,7 @@ void itemdb_package_item(struct map_session_data *sd, struct item_package *packa return; } /*========================================== - * Return a random item id from group. (takes into account % chance giving/tot group) + * Return a random item id from group. (takes into account % chance giving/tot group) *------------------------------------------*/ int itemdb_searchrandomid(struct item_group *group) { @@ -312,7 +312,7 @@ const char* itemdb_typename(int type) } /*========================================== - * Converts the jobid from the format in itemdb + * Converts the jobid from the format in itemdb * to the format used by the map server. [Skotlex] *------------------------------------------*/ void itemdb_jobid2mapid(unsigned int *bclass, unsigned int jobmask) @@ -470,8 +470,7 @@ int itemdb_isequip(int nameid) /*========================================== * Alternate version of itemdb_isequip *------------------------------------------*/ -int itemdb_isequip2(struct item_data *data) -{ +int itemdb_isequip2(struct item_data *data) { nullpo_ret(data); switch(data->type) { case IT_WEAPON: @@ -937,7 +936,7 @@ void itemdb_read_packages(void) { if( HCache->check(config_filename) ) { if( itemdb->read_cached_packages(config_filename) ) return; - } + } if (libconfig->read_file(&item_packages_conf, config_filename)) { ShowError("can't read %s\n", config_filename); @@ -1445,7 +1444,7 @@ void itemdb_read_combos() { p++; str[1] = p; - p = strchr(p,','); + p = strchr(p,','); p++; if (str[1][0] != '{') { @@ -2217,7 +2216,7 @@ void itemdb_name_constants(void) { script->parser_current_file = NULL; #endif // ENABLE_CASE_CHECK - dbi_destroy(iter); + dbi_destroy(iter); } void do_final_itemdb(void) { itemdb->clear(true); diff --git a/src/map/map.c b/src/map/map.c index 01d3dbb9f..e37e902f6 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -494,7 +494,7 @@ static int bl_vforeach(int (*func)(struct block_list*, va_list), int blockcount, static int map_vforeachinmap(int (*func)(struct block_list*, va_list), int16 m, int type, va_list args) { int i; int returnCount = 0; - int bsize; + int bsize; va_list argscopy; struct block_list *bl; int blockcount = map->bl_list_count; @@ -5861,7 +5861,7 @@ int do_init(int argc, char *argv[]) } /*===================================== -* Default Functions : map.h +* Default Functions : map.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/map.h b/src/map/map.h index 539b02ed8..73ef4bb41 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -579,9 +579,9 @@ struct map_data { "Algorithms in Java, Parts 1-4" 3.18, Robert Sedgewick Map is divided into squares, called blocks (side length = BLOCK_SIZE). For each block there is a linked list of objects in that block (block_list). - Array provides capability to access immediately the set of objects close + Array provides capability to access immediately the set of objects close to a given object. - The linked lists provide the flexibility to store the objects without + The linked lists provide the flexibility to store the objects without knowing ahead how many objects fall into each block. */ struct block_list **block; // Grid array of block_lists containing only non-BL_MOB objects @@ -796,7 +796,7 @@ struct map_cache_map_info { /*===================================== -* Interface : map.h +* Interface : map.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/mercenary.c b/src/map/mercenary.c index 26bc8c188..80bcfdf05 100644 --- a/src/map/mercenary.c +++ b/src/map/mercenary.c @@ -503,7 +503,7 @@ void do_init_mercenary(bool minimal) { } /*===================================== -* Default Functions : mercenary.h +* Default Functions : mercenary.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/mercenary.h b/src/map/mercenary.h index b998ac006..22399e289 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -48,7 +48,7 @@ struct mercenary_data { }; /*===================================== -* Interface : mercenary.h +* Interface : mercenary.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/mob.c b/src/map/mob.c index 11ac74621..784bb5a07 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -3880,7 +3880,7 @@ bool mob_parse_dbrow(char** str) { mob->db_data[class_] = (struct mob_db*)aMalloc(sizeof(struct mob_db)); else //Copy over spawn data - memcpy(&db->spawn, mob->db_data[class_]->spawn, sizeof(db->spawn)); + memcpy(&db->spawn, mob->db_data[class_]->spawn, sizeof(db->spawn)); memcpy(mob->db_data[class_], db, sizeof(struct mob_db)); return true; diff --git a/src/map/npc.c b/src/map/npc.c index cf509e11f..0817313e2 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1154,10 +1154,10 @@ int npc_click(struct map_session_data* sd, struct npc_data* nd) // This usually happens when the player clicked on a NPC that has the view id // of a mob, to activate this kind of npc it's needed to be in a 2,2 range - // from it. If the OnTouch area of a npc, coincides with the 2,2 range of + // from it. If the OnTouch area of a npc, coincides with the 2,2 range of // another it's expected that the OnTouch event be put first in stack, because // unit_walktoxy_timer is executed before any other function in this case. - // So it's best practice to put an 'end;' before OnTouch events in npcs that + // So it's best practice to put an 'end;' before OnTouch events in npcs that // have view ids of mobs to avoid this "issue" [Panikon] if (sd->npc_id != 0) { // The player clicked a npc after entering an OnTouch area diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index f245ffea5..2182e1da2 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -49,7 +49,7 @@ struct pcre_interface libpcre_s; * * defpattern 1, "[^:]+: (.*) loves (.*)", "label"; * - * this defines a new pattern in set 1 using perl syntax + * this defines a new pattern in set 1 using perl syntax * (http://www.troubleshooters.com/codecorn/littperl/perlreg.htm) * and tells it to jump to the supplied label when the pattern * is matched. @@ -59,7 +59,7 @@ struct pcre_interface libpcre_s; * before the script gets executed. * * activatepset 1; - * + * * This activates a set of patterns.. You can have many pattern * sets defined and many active all at once. This feature allows * you to set up "conversations" and ever changing expectations of @@ -95,11 +95,10 @@ void finalize_pcrematch_entry(struct pcrematch_entry* e) /** * Lookup (and possibly create) a new set of patterns by the set id */ -struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) -{ +struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) { struct pcrematch_set *pcreset; struct npc_parse *npcParse = nd->chatdb; - if (npcParse == NULL) + if (npcParse == NULL) nd->chatdb = npcParse = (struct npc_parse *)aCalloc(sizeof(struct npc_parse), 1); pcreset = npcParse->active; @@ -109,7 +108,7 @@ struct pcrematch_set* lookup_pcreset(struct npc_data* nd, int setid) break; pcreset = pcreset->next; } - if (pcreset == NULL) + if (pcreset == NULL) pcreset = npcParse->inactive; while (pcreset != NULL) { @@ -140,7 +139,7 @@ void activate_pcreset(struct npc_data* nd, int setid) { struct pcrematch_set *pcreset; struct npc_parse *npcParse = nd->chatdb; - if (npcParse == NULL) + if (npcParse == NULL) return; // Nothing to activate... pcreset = npcParse->inactive; while (pcreset != NULL) { @@ -154,7 +153,7 @@ void activate_pcreset(struct npc_data* nd, int setid) pcreset->next->prev = pcreset->prev; if (pcreset->prev != NULL) pcreset->prev->next = pcreset->next; - else + else npcParse->inactive = pcreset->next; pcreset->prev = NULL; @@ -173,7 +172,7 @@ void deactivate_pcreset(struct npc_data* nd, int setid) { struct pcrematch_set *pcreset; struct npc_parse *npcParse = nd->chatdb; - if (npcParse == NULL) + if (npcParse == NULL) return; // Nothing to deactivate... if (setid == -1) { while(npcParse->active != NULL) @@ -192,7 +191,7 @@ void deactivate_pcreset(struct npc_data* nd, int setid) pcreset->next->prev = pcreset->prev; if (pcreset->prev != NULL) pcreset->prev->next = pcreset->next; - else + else npcParse->active = pcreset->next; pcreset->prev = NULL; @@ -210,7 +209,7 @@ void delete_pcreset(struct npc_data* nd, int setid) int active = 1; struct pcrematch_set *pcreset; struct npc_parse *npcParse = nd->chatdb; - if (npcParse == NULL) + if (npcParse == NULL) return; // Nothing to deactivate... pcreset = npcParse->active; while (pcreset != NULL) { @@ -227,7 +226,7 @@ void delete_pcreset(struct npc_data* nd, int setid) pcreset = pcreset->next; } } - if (pcreset == NULL) + if (pcreset == NULL) return; if (pcreset->next != NULL) @@ -254,7 +253,7 @@ void delete_pcreset(struct npc_data* nd, int setid) } /** - * create a new pattern entry + * create a new pattern entry */ struct pcrematch_entry* create_pcrematch_entry(struct pcrematch_set* set) { @@ -300,7 +299,7 @@ void npc_chat_def_pattern(struct npc_data* nd, int setid, const char* pattern, c /** * Delete everything associated with a NPC concerning the pattern - * matching code + * matching code * * this could be more efficent but.. how often do you do this? */ diff --git a/src/map/packets.h b/src/map/packets.h index da1f176ff..fe323965c 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -2600,19 +2600,19 @@ packet(0x020d,-1); // 2014-01-15eRagexe - YomRawr #if PACKETVER >= 20140115 - packet(0x0369,7,clif->pActionRequest,2,6); - packet(0x083C,10,clif->pUseSkillToId,2,4,6); - packet(0x0437,5,clif->pWalkToXY,2); - packet(0x035F,6,clif->pTickSend,2); - packet(0x08A7,5,clif->pChangeDir,2,4); - packet(0x0940,6,clif->pTakeItem,2); - packet(0x0361,6,clif->pDropItem,2,4); - packet(0x088E,8,clif->pMoveToKafra,2,4); - packet(0x0367,8,clif->pMoveFromKafra,2,4); - packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); - packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); - packet(0x0802,6,clif->pGetCharNameRequest,2); - packet(0x0368,6,clif->pSolveCharName,2); + packet(0x0369,7,clif->pActionRequest,2,6); + packet(0x083C,10,clif->pUseSkillToId,2,4,6); + packet(0x0437,5,clif->pWalkToXY,2); + packet(0x035F,6,clif->pTickSend,2); + packet(0x08A7,5,clif->pChangeDir,2,4); + packet(0x0940,6,clif->pTakeItem,2); + packet(0x0361,6,clif->pDropItem,2,4); + packet(0x088E,8,clif->pMoveToKafra,2,4); + packet(0x0367,8,clif->pMoveFromKafra,2,4); + packet(0x0438,10,clif->pUseSkillToPos,2,4,6,8); + packet(0x0366,90,clif->pUseSkillToPosMoreInfo,2,4,6,8,10); + packet(0x0802,6,clif->pGetCharNameRequest,2); + packet(0x0368,6,clif->pSolveCharName,2); packet(0x0360,12,clif->pSearchStoreInfoListItemClick,2,6,10); packet(0x0817,2,clif->pSearchStoreInfoNextPage,0); packet(0x0815,-1,clif->pSearchStoreInfo,2,4,5,9,13,14,15); diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 55006db64..3d49944d1 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -596,7 +596,7 @@ struct packet_status_change { #if PACKETVER >= 20120618 unsigned int Total; #endif -#if PACKETVER >= 20090121 +#if PACKETVER >= 20090121 unsigned int Left; int val1; int val2; diff --git a/src/map/party.c b/src/map/party.c index 7c49e241c..678b2cd54 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -1364,7 +1364,7 @@ void do_init_party(bool minimal) { timer->add_interval(timer->gettick()+battle_config.party_update_interval, party->send_xy_timer, 0, 0, battle_config.party_update_interval); } /*===================================== -* Default Functions : party.h +* Default Functions : party.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/party.h b/src/map/party.h index 3bad22b13..1c58301d1 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -71,7 +71,7 @@ struct party_booking_ad_info { #endif /* PARTY_RECRUIT */ /*===================================== -* Interface : party.h +* Interface : party.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/path.c b/src/map/path.c index d02e9ee4a..e90b26db5 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -205,7 +205,7 @@ static int add_path(struct node_heap *heap, struct path_node *tp, int16 x, int16 if (g_cost < tp[i].g_cost) { // New path to this node is better than old one // Update costs and parent tp[i].g_cost = g_cost; - tp[i].parent = parent; + tp[i].parent = parent; tp[i].f_cost = g_cost + h_cost; if (tp[i].flag == SET_CLOSED) { heap_push_node(heap, &tp[i]); // Put it in open set again @@ -299,7 +299,7 @@ bool path_search(struct walkpath_data *wpd, int16 m, int16 x0, int16 y0, int16 x return true; } - return false; // easy path unsuccessful + return false; // easy path unsuccessful } else { // !(flag&1) // A* (A-star) pathfinding diff --git a/src/map/pc.c b/src/map/pc.c index 08ff8baf9..ce2b8040e 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -1156,7 +1156,7 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim clif->message(sd->fd, buf); } - if (expiration_time != 0) { + if (expiration_time != 0) { sd->expiration_time = expiration_time; } @@ -4448,7 +4448,7 @@ int pc_useitem(struct map_session_data *sd,int n) { } } - /* on restricted maps the item is consumed but the effect is not used */ + /* on restricted maps the item is consumed but the effect is not used */ for(i = 0; i < map->list[sd->bl.m].zone->disabled_items_count; i++) { if( map->list[sd->bl.m].zone->disabled_items[i] == nameid ) { clif->msg(sd, ITEM_CANT_USE_AREA); // This item cannot be used within this area @@ -7264,7 +7264,7 @@ int pc_readparam(struct map_session_data* sd,int type) case SP_DEFELE: val = sd->battle_status.def_ele; break; #ifndef RENEWAL_CAST case SP_VARCASTRATE: -#endif +#endif case SP_CASTRATE: val = sd->castrate+=val; break; @@ -10329,7 +10329,7 @@ int pc_global_expiration_timer(int tid, int64 tick, int id, intptr_t data) { return 0; } -void pc_expire_check(struct map_session_data *sd) { +void pc_expire_check(struct map_session_data *sd) { /* ongoing timer */ if( sd->expiration_tid != INVALID_TIMER ) return; @@ -10630,7 +10630,7 @@ void do_init_pc(bool minimal) { ers_chunk_size(pc->str_reg_ers, 50); } /*===================================== -* Default Functions : pc.h +* Default Functions : pc.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/pc.h b/src/map/pc.h index 5d723fcf8..90f227cee 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -725,7 +725,7 @@ struct autotrade_vending { }; /*===================================== -* Interface : pc.h +* Interface : pc.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c index a917ef409..e577c642f 100644 --- a/src/map/pc_groups.c +++ b/src/map/pc_groups.c @@ -183,7 +183,7 @@ static void read_config(void) { int j, inherit_count = 0, done = 0; if (group_settings->inheritance_done) // group already processed - continue; + continue; if ((inherit = group_settings->inherit) == NULL || (inherit_count = libconfig->setting_length(inherit)) <= 0) { // this group does not inherit from others diff --git a/src/map/pet.c b/src/map/pet.c index aa2be4473..6a458eae6 100644 --- a/src/map/pet.c +++ b/src/map/pet.c @@ -99,7 +99,7 @@ int pet_unlocktarget(struct pet_data *pd) * Pet Attack Skill [Skotlex] *------------------------------------------*/ int pet_attackskill(struct pet_data *pd, int target_id) { - if (!battle_config.pet_status_support || !pd->a_skill || + if (!battle_config.pet_status_support || !pd->a_skill || (battle_config.pet_equip_required && !pd->pet.equip)) return 0; @@ -107,7 +107,7 @@ int pet_attackskill(struct pet_data *pd, int target_id) { return 0; if (rnd()%100 < (pd->a_skill->rate +pd->pet.intimate*pd->a_skill->bonusrate/1000)) { - //Skotlex: Use pet's skill + //Skotlex: Use pet's skill int inf; struct block_list *bl; @@ -158,7 +158,7 @@ int pet_target_check(struct map_session_data *sd,struct block_list *bl,int type) if(pd->petDB->defence_attack_rate > 0 && rate <= 0) rate = 1; } - if(rnd()%10000 < rate) + if(rnd()%10000 < rate) { if(pd->target_id == 0 || rnd()%10000 < pd->petDB->change_target_rate) pd->target_id = bl->id; @@ -319,7 +319,7 @@ int pet_data_init(struct map_session_data *sd, struct s_pet *petinfo) nullpo_retr(1, sd); - Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd); + Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd); if(sd->status.account_id != petinfo->account_id || sd->status.char_id != petinfo->char_id) { sd->status.pet_id = 0; @@ -390,7 +390,7 @@ int pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo) { nullpo_retr(1, sd); - Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd); + Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd); if(sd->status.pet_id && petinfo->incuvate == 1) { sd->status.pet_id = 0; @@ -418,7 +418,7 @@ int pet_birth_process(struct map_session_data *sd, struct s_pet *petinfo) clif->send_petdata(NULL, sd->pd, 3, sd->pd->vd.head_bottom); clif->send_petstatus(sd); } - Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd); + Assert((sd->status.pet_id == 0 || sd->pd == 0) || sd->pd->msd == sd); return 0; } @@ -912,7 +912,7 @@ int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick (pd->ud.attacktimer != INVALID_TIMER || pd->ud.walktimer != INVALID_TIMER)) return 0; //Target already locked. - if (target->type != BL_ITEM) + if (target->type != BL_ITEM) { //enemy targetted if(!battle->check_range(&pd->bl,target,pd->status.rhw.range)) { //Chase @@ -934,7 +934,7 @@ int pet_ai_sub_hard(struct pet_data *pd, struct map_session_data *sd, int64 tick memcpy(&pd->loot->item[pd->loot->count++],&fitem->item_data,sizeof(pd->loot->item[0])); pd->loot->weight += itemdb_weight(fitem->item_data.nameid)*fitem->item_data.amount; map->clearflooritem(target); - } + } //Target is unlocked regardless of whether it was picked or not. pet->unlocktarget(pd); } @@ -1050,7 +1050,7 @@ int pet_lootitem_drop(struct pet_data *pd,struct map_session_data *sd) /*========================================== * pet bonus giving skills [Valaris] / Rewritten by [Skotlex] - *------------------------------------------*/ + *------------------------------------------*/ int pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) { struct map_session_data *sd=map->id2sd(id); struct pet_data *pd; @@ -1091,7 +1091,7 @@ int pet_skill_bonus_timer(int tid, int64 tick, int id, intptr_t data) { /*========================================== * pet recovery skills [Valaris] / Rewritten by [Skotlex] - *------------------------------------------*/ + *------------------------------------------*/ int pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) { struct map_session_data *sd=map->id2sd(id); struct pet_data *pd; @@ -1107,7 +1107,7 @@ int pet_recovery_timer(int tid, int64 tick, int id, intptr_t data) { } if(sd->sc.data[pd->recovery->type]) - { //Display a heal animation? + { //Display a heal animation? //Detoxify is chosen for now. clif->skill_nodamage(&pd->bl,&sd->bl,TF_DETOXIFY,1,1); status_change_end(&sd->bl, pd->recovery->type, INVALID_TIMER); @@ -1155,7 +1155,7 @@ int pet_heal_timer(int tid, int64 tick, int id, intptr_t data) { /*========================================== * pet support skills [Skotlex] - *------------------------------------------*/ + *------------------------------------------*/ int pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) { struct map_session_data *sd=map->id2sd(id); struct pet_data *pd; @@ -1202,12 +1202,12 @@ int pet_skill_support_timer(int tid, int64 tick, int id, intptr_t data) { * Pet read db data * pet->db.txt * pet->db2.txt - *------------------------------------------*/ + *------------------------------------------*/ int read_petdb() { char* filename[] = {"pet_db.txt","pet_db2.txt"}; FILE *fp; - int nameid,i,j,k; + int nameid,i,j,k; // Remove any previous scripts in case reloaddb was invoked. for( j = 0; j < MAX_PET_DB; j++ ) diff --git a/src/map/skill.c b/src/map/skill.c index b2e94ec79..94bcd1d1b 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2234,7 +2234,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr status_change_end(bl, SC_ENERGYCOAT, INVALID_TIMER); //Reduction: 6% + 6% every 20% dmg.damage -= dmg.damage * (6 * (1+per)) / 100; - } + } } #endif /* MAGIC_REFLECTION_TYPE */ } @@ -2647,7 +2647,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr //blown-specific handling switch( skill_id ) { case LG_OVERBRAND_BRANDISH: - if( skill->blown(dsrc,bl,dmg.blewcount,dir,0) < dmg.blewcount ) + if( skill->blown(dsrc,bl,dmg.blewcount,dir,0) < dmg.blewcount ) skill->addtimerskill(src, tick + status_get_amotion(src), bl->id, 0, 0, LG_OVERBRAND_PLUSATK, skill_lv, BF_WEAPON, flag|SD_ANIMATION); break; case SR_KNUCKLEARROW: @@ -3165,7 +3165,7 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { BL_CHAR|BL_SKILL, target->id); // Search for a new Target around current one... if( nbl == NULL) skl->x++; - else + else skl->x = 0; skill->addtimerskill(src, tick + 651, (nbl?nbl:target)->id, skl->x, 0, WL_CHAINLIGHTNING_ATK, skl->skill_lv, skl->type + 1, skl->flag); @@ -3177,9 +3177,9 @@ int skill_timerskill(int tid, int64 tick, int id, intptr_t data) { case WL_TETRAVORTEX_WIND: case WL_TETRAVORTEX_GROUND: clif->skill_nodamage(src, target, skl->skill_id, skl->skill_lv, 1); - skill->attack(BF_MAGIC, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag); + skill->attack(BF_MAGIC, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag); skill->toggle_magicpower(src, skl->skill_id); // only the first hit will be amplify - if( skl->type == 4 ){ + if( skl->type == 4 ){ const enum sc_type scs[] = { SC_BURNING, SC_BLOODING, SC_FROSTMISTY, SC_STUN }; // status inflicts are depend on what summoned element is used. int rate = skl->y, index = skl->x-1; sc_start2(src,target, scs[index], rate, skl->skill_lv, src->id, skill->get_time(WL_TETRAVORTEX,index+1)); @@ -4196,7 +4196,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 case WL_TETRAVORTEX: if( sc ){ int i = SC_SUMMON5, x = 0; - int types[][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}}; + int types[][2] = {{0, 0}, {0, 0}, {0, 0}, {0, 0}}; for(; i >= SC_SUMMON1; i--){ if( sc->data[i] ){ int skillid = WL_TETRAVORTEX_FIRE + (sc->data[i]->val1 - WLS_FIRE) + (sc->data[i]->val1 == WLS_WIND) - (sc->data[i]->val1 == WLS_WATER), sc_index = 0, rate = 0; @@ -4272,7 +4272,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 if (sd->skillcooldown[i].id == spell_skill_id){ cooldown += sd->skillcooldown[i].val; break; - } + } } if(cooldown) skill->blockpc_start(sd, spell_skill_id, cooldown); @@ -4769,10 +4769,10 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) { inf &= ~BCT_NEUTRAL; } - if( sd && (inf2&INF2_CHORUS_SKILL) && skill->check_pc_partner(sd, ud->skill_id, &ud->skill_lv, 1, 0) < 1 ) { - clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_NEED_HELPER, 0); - break; - } + if( sd && (inf2&INF2_CHORUS_SKILL) && skill->check_pc_partner(sd, ud->skill_id, &ud->skill_lv, 1, 0) < 1 ) { + clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_NEED_HELPER, 0); + break; + } if( ud->skill_id >= SL_SKE && ud->skill_id <= SL_SKA && target->type == BL_MOB ) { @@ -5036,7 +5036,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin **/ case AB_RENOVATIO: case AB_HIGHNESSHEAL: - case AL_INCAGI: + case AL_INCAGI: if( sd && dstsd && pc_ismadogear(dstsd) ){ clif->skill_fail(sd,skill_id,USESKILL_FAIL_TOTARGET,0); return 0; @@ -5674,7 +5674,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case KN_AUTOCOUNTER: sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)); - skill->addtimerskill(src, tick + 100, bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag); + skill->addtimerskill(src, tick + 100, bl->id, 0, 0, skill_id, skill_lv, BF_WEAPON, flag); break; case SO_STRIKING: @@ -10315,7 +10315,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case WM_SOUND_OF_DESTRUCTION: r = skill->get_splash(skill_id,skill_lv); map->foreachinarea(skill->area_sub,src->m,x-r,y-r,x+r,y+r,BL_CHAR,src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill->castend_damage_id); - break; + break; case WM_LULLABY_DEEPSLEEP: r = skill->get_splash(skill_id,skill_lv); @@ -11669,7 +11669,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 case UNT_FIREPILLAR_ACTIVE: case UNT_CLAYMORETRAP: if( sg->unit_id == UNT_FIRINGTRAP || sg->unit_id == UNT_ICEBOUNDTRAP || sg->unit_id == UNT_CLAYMORETRAP ) - map->foreachinrange(skill->trap_splash,&src->bl, skill->get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag|BL_SKILL|~BCT_SELF, &src->bl,tick); + map->foreachinrange(skill->trap_splash,&src->bl, skill->get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag|BL_SKILL|~BCT_SELF, &src->bl,tick); else map->foreachinrange(skill->trap_splash,&src->bl, skill->get_splash(sg->skill_id, sg->skill_lv), sg->bl_flag, &src->bl,tick); if (sg->unit_id != UNT_FIREPILLAR_ACTIVE) @@ -13054,7 +13054,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id { int j, i = 0; for(j = SC_SUMMON1; j <= SC_SUMMON5; j++) - if( sc && sc->data[j] ) + if( sc && sc->data[j] ) i++; switch(skill_id){ @@ -14124,9 +14124,9 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 if( sd->bonus.varcastrate < 0 ) VARCAST_REDUCTION(sd->bonus.varcastrate); if( sd->bonus.add_varcast != 0 ) // bonus bVariableCast - time += sd->bonus.add_varcast; + time += sd->bonus.add_varcast; if( sd->bonus.add_fixcast != 0 ) // bonus bFixedCast - fixed += sd->bonus.add_fixcast; + fixed += sd->bonus.add_fixcast; for (i = 0; i < ARRAYLENGTH(sd->skillfixcast) && sd->skillfixcast[i].id; i++) if (sd->skillfixcast[i].id == skill_id){ // bonus2 bSkillFixedCast fixed += sd->skillfixcast[i].val; @@ -14197,7 +14197,7 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16 fixcast_r = max(fixcast_r, sc->data[SC_DANCE_WITH_WUG]->val4); if( sc->data[SC_SECRAMENT] ) fixcast_r = max(fixcast_r, sc->data[SC_SECRAMENT]->val2); - if( sd && ( skill_lv = pc->checkskill(sd, WL_RADIUS) ) && (skill_id >= WL_WHITEIMPRISON && skill_id < WL_FREEZE_SP) ) + if( sd && ( skill_lv = pc->checkskill(sd, WL_RADIUS) ) && (skill_id >= WL_WHITEIMPRISON && skill_id < WL_FREEZE_SP) ) fixcast_r = max(fixcast_r, (status_get_int(bl) + status->get_lv(bl)) / 15 + skill_lv * 5); // [{(Caster?s INT / 15) + (Caster?s Base Level / 15) + (Radius Skill Level x 5)}] % // Fixed cast non percentage bonuses if( sc->data[SC_MANDRAGORA] ) @@ -15323,7 +15323,7 @@ bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit){ if( sc && sc->data[SC__SHADOWFORM] && damage ) { src = map->id2bl(sc->data[SC__SHADOWFORM]->val2); - if( !src || src->m != bl->m ) { + if( !src || src->m != bl->m ) { status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER); return false; } @@ -18515,7 +18515,7 @@ void skill_defaults(void) { skill->unit_onplace = skill_unit_onplace; skill->unit_ondamaged = skill_unit_ondamaged; skill->cast_fix = skill_castfix; - skill->cast_fix_sc = skill_castfix_sc; + skill->cast_fix_sc = skill_castfix_sc; skill->vf_cast_fix = skill_vfcastfix; skill->delay_fix = skill_delay_fix; skill->check_condition_castbegin = skill_check_condition_castbegin; diff --git a/src/map/skill.h b/src/map/skill.h index b6dbb1fcb..66d6dc39e 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -1597,7 +1597,7 @@ enum { UNT_ZENKAI_WIND, UNT_MAKIBISHI, UNT_VENOMFOG, - UNT_ICEMINE, + UNT_ICEMINE, UNT_FLAMECROSS, UNT_HELLBURNING, UNT_MAGMA_ERUPTION, diff --git a/src/map/sql/CMakeLists.txt b/src/map/sql/CMakeLists.txt index 11751a1a5..1629b2a8b 100644 --- a/src/map/sql/CMakeLists.txt +++ b/src/map/sql/CMakeLists.txt @@ -18,7 +18,7 @@ set( SQL_MAP_HEADERS "${SQL_MAP_SOURCE_DIR}/guild.h" "${SQL_MAP_SOURCE_DIR}/homunculus.h" "${SQL_MAP_SOURCE_DIR}/HPMmap.h" - "${SQL_MAP_SOURCE_DIR}/instance.h" + "${SQL_MAP_SOURCE_DIR}/instance.h" "${SQL_MAP_SOURCE_DIR}/intif.h" "${SQL_MAP_SOURCE_DIR}/irc-bot.h" "${SQL_MAP_SOURCE_DIR}/itemdb.h" diff --git a/src/map/status.c b/src/map/status.c index eb06138da..316dce8e6 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -180,7 +180,7 @@ void initChangeTables(void) { add_sc( TF_POISON , SC_POISON ); set_sc( KN_TWOHANDQUICKEN , SC_TWOHANDQUICKEN , SI_TWOHANDQUICKEN , SCB_ASPD ); add_sc( KN_AUTOCOUNTER , SC_AUTOCOUNTER ); - set_sc( PR_IMPOSITIO , SC_IMPOSITIO , SI_IMPOSITIO , + set_sc( PR_IMPOSITIO , SC_IMPOSITIO , SI_IMPOSITIO , #ifdef RENEWAL SCB_NONE ); #else @@ -204,7 +204,7 @@ void initChangeTables(void) { set_sc( BS_WEAPONPERFECT , SC_WEAPONPERFECT , SI_WEAPONPERFECT, SCB_NONE ); set_sc( BS_OVERTHRUST , SC_OVERTHRUST , SI_OVERTHRUST , SCB_NONE ); set_sc( BS_MAXIMIZE , SC_MAXIMIZEPOWER , SI_MAXIMIZE , SCB_REGEN ); - add_sc( HT_LANDMINE , SC_STUN ); + add_sc( HT_LANDMINE , SC_STUN ); set_sc( HT_ANKLESNARE , SC_ANKLESNARE , SI_ANKLESNARE , SCB_NONE ); add_sc( HT_SANDMAN , SC_SLEEP ); add_sc( HT_FLASHER , SC_BLIND ); @@ -3672,7 +3672,7 @@ void status_calc_bl_main(struct block_list *bl, /*enum scb_flag*/int flag) { st->batk = status->calc_batk(bl, sc, st->batk, true); } - if(flag&SCB_WATK) { + if(flag&SCB_WATK) { st->rhw.atk = status->calc_watk(bl, sc, bst->rhw.atk, true); if (!sd) //Should not affect weapon refine bonus st->rhw.atk2 = status->calc_watk(bl, sc, bst->rhw.atk2, true); @@ -5016,7 +5016,7 @@ signed short status_calc_def2(struct block_list *bl, struct status_change *sc, i #ifdef RENEWAL if( sc && sc->data[SC_ASSUMPTIO] ) def2 <<= 1; -#endif +#endif if( sc && sc->data[SC_CAMOUFLAGE] ) def2 -= def2 * 5 * (10-sc->data[SC_CAMOUFLAGE]->val4) / 100; #ifdef RENEWAL @@ -5912,7 +5912,7 @@ struct status_data *status_get_base_status(struct block_list *bl) case BL_HOM: return &((TBL_HOM*)bl)->base_status; case BL_MER: return &((TBL_MER*)bl)->base_status; case BL_ELEM: return &((TBL_ELEM*)bl)->base_status; - case BL_NPC: return ((mob->db_checkid(((TBL_NPC*)bl)->class_) == 0) ? &((TBL_NPC*)bl)->status : NULL); + case BL_NPC: return ((mob->db_checkid(((TBL_NPC*)bl)->class_) == 0) ? &((TBL_NPC*)bl)->status : NULL); default: return NULL; } @@ -5929,8 +5929,8 @@ defType status_get_def(struct block_list *bl) { } unsigned short status_get_speed(struct block_list *bl) { - if(bl->type==BL_NPC)//Only BL with speed data but no status_data [Skotlex] - return ((struct npc_data *)bl)->speed; + if(bl->type==BL_NPC)//Only BL with speed data but no status_data [Skotlex] + return ((struct npc_data *)bl)->speed; return status->get_status_data(bl)->speed; } @@ -6939,9 +6939,9 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_ASSNCROS: if(sc->option&OPTION_MADOGEAR) return 0;//Mado is immune to wind walk, cart boost, etc (others above) [Ind] - case SC_INC_AGI: + case SC_INC_AGI: if (sc->data[SC_QUAGMIRE]) - return 0; + return 0; break; case SC_CLOAKING: //Avoid cloaking with no wall and low skill level. [Skotlex] @@ -7143,7 +7143,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t case SC_ROKISWEIL: case SC_FOGWALL: case SC_FROSTMISTY: - case SC_BURNING: + case SC_BURNING: case SC_MARSHOFABYSS: case SC_ADORAMUS: case SC_NEEDLE_OF_PARALYZE: @@ -9401,7 +9401,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t } //On Aegis, when turning on a status change, first goes the option packet, then the sc packet. - if(opt_flag) { + if(opt_flag) { clif->changeoption(bl); if( sd && opt_flag&0x4 ) { clif->changelook(bl,LOOK_BASE,vd->class_); @@ -11958,7 +11958,7 @@ void do_final_status(void) { } /*===================================== -* Default Functions : status.h +* Default Functions : status.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/status.h b/src/map/status.h index 6bb563b0b..3bdd59041 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -711,766 +711,787 @@ typedef enum sc_type { SC_MAX, //Automatically updated max, used in for's to check we are within bounds. } sc_type; -// Official status change ids, used to display status icons on the client. + +/// Official status change ids, used to display status icons in the client. enum si_type { - SI_BLANK = -1, - SI_PROVOKE = 0, - SI_ENDURE = 1, - SI_TWOHANDQUICKEN = 2, - SI_CONCENTRATION = 3, - SI_HIDING = 4, - SI_CLOAKING = 5, - SI_ENCHANTPOISON = 6, - SI_POISONREACT = 7, - SI_QUAGMIRE = 8, - SI_ANGELUS = 9, - SI_BLESSING = 10, - SI_CRUCIS = 11, - SI_INC_AGI = 12, - SI_DEC_AGI = 13, - SI_SLOWPOISON = 14, - SI_IMPOSITIO = 15, - SI_SUFFRAGIUM = 16, - SI_ASPERSIO = 17, - SI_BENEDICTIO = 18, - SI_KYRIE = 19, - SI_MAGNIFICAT = 20, - SI_GLORIA = 21, - SI_LEXAETERNA = 22, - SI_ADRENALINE = 23, - SI_WEAPONPERFECT = 24, - SI_OVERTHRUST = 25, - SI_MAXIMIZE = 26, - SI_RIDING = 27, - SI_FALCON = 28, - SI_TRICKDEAD = 29, - SI_SHOUT = 30, - SI_ENERGYCOAT = 31, - SI_BROKENARMOR = 32, - SI_BROKENWEAPON = 33, - SI_ILLUSION = 34, - SI_WEIGHTOVER50 = 35, - SI_WEIGHTOVER90 = 36, - SI_ATTHASTE_POTION1 = 37, - SI_ATTHASTE_POTION2 = 38, - SI_ATTHASTE_POTION3 = 39, - SI_ATTHASTE_INFINITY = 40, - SI_MOVHASTE_POTION = 41, - SI_MOVHASTE_INFINITY = 42, -// SI_AUTOCOUNTER = 43, -// SI_SPLASHER = 44, - SI_ANKLESNARE = 45, - SI_POSTDELAY = 46, -// SI_NOACTION = 47, -// SI_IMPOSSIBLEPICKUP = 48, -// SI_BARRIER = 49, - SI_NOEQUIPWEAPON = 50, - SI_NOEQUIPSHIELD = 51, - SI_NOEQUIPARMOR = 52, - SI_NOEQUIPHELM = 53, - SI_PROTECTWEAPON = 54, - SI_PROTECTSHIELD = 55, - SI_PROTECTARMOR = 56, - SI_PROTECTHELM = 57, - SI_AUTOGUARD = 58, - SI_REFLECTSHIELD = 59, -// SI_DEVOTION = 60, - SI_PROVIDENCE = 61, - SI_DEFENDER = 62, -// SI_MAGICROD = 63, -// SI_WEAPONPROPERTY = 64, - SI_AUTOSPELL = 65, -// SI_SPECIALZONE = 66, -// SI_MASK = 67, - SI_SPEARQUICKEN = 68, -// SI_BDPLAYING = 69, -// SI_WHISTLE = 70, -// SI_ASSASSINCROSS = 71, -// SI_POEMBRAGI = 72, -// SI_APPLEIDUN = 73, -// SI_HUMMING = 74, -// SI_DONTFORGETME = 75, -// SI_FORTUNEKISS = 76, -// SI_SERVICEFORYOU = 77, -// SI_RICHMANKIM = 78, -// SI_ETERNALCHAOS = 79, -// SI_DRUMBATTLEFIELD = 80, -// SI_RINGNIBELUNGEN = 81, -// SI_ROKISWEIL = 82, -// SI_INTOABYSS = 83, -// SI_SIEGFRIED = 84, -// SI_BLADESTOP = 85, - SI_EXPLOSIONSPIRITS = 86, - SI_STEELBODY = 87, - SI_EXTREMITYFIST = 88, -// SI_COMBOATTACK = 89, - SI_PROPERTYFIRE = 90, - SI_PROPERTYWATER = 91, - SI_PROPERTYWIND = 92, - SI_PROPERTYGROUND = 93, -// SI_MAGICATTACK = 94, - SI_STOP = 95, -// SI_WEAPONBRAKER = 96, - SI_PROPERTYUNDEAD = 97, -// SI_POWERUP = 98, -// SI_AGIUP = 99, -// SI_SIEGEMODE = 100, -// SI_INVISIBLE = 101, -// SI_STATUSONE = 102, - SI_AURABLADE = 103, - SI_PARRYING = 104, - SI_LKCONCENTRATION = 105, - SI_TENSIONRELAX = 106, - SI_BERSERK = 107, -// SI_SACRIFICE = 108, -// SI_GOSPEL = 109, - SI_ASSUMPTIO = 110, -// SI_BASILICA = 111, - SI_GROUNDMAGIC = 112, - SI_MAGICPOWER = 113, - SI_EDP = 114, - SI_TRUESIGHT = 115, - SI_WINDWALK = 116, - SI_MELTDOWN = 117, - SI_CARTBOOST = 118, -// SI_CHASEWALK = 119, - SI_SWORDREJECT = 120, - SI_MARIONETTE_MASTER = 121, - SI_MARIONETTE = 122, - SI_MOON = 123, - SI_BLOODING = 124, - SI_JOINTBEAT = 125, -// SI_MINDBREAKER = 126, -// SI_MEMORIZE = 127, -// SI_FOGWALL = 128, -// SI_SPIDERWEB = 129, - SI_PROTECTEXP = 130, -// SI_SUB_WEAPONPROPERTY = 131, - SI_AUTOBERSERK = 132, - SI_RUN = 133, - SI_TING = 134, - SI_STORMKICK_ON = 135, - SI_STORMKICK_READY = 136, - SI_DOWNKICK_ON = 137, - SI_DOWNKICK_READY = 138, - SI_TURNKICK_ON = 139, - SI_TURNKICK_READY = 140, - SI_COUNTER_ON = 141, - SI_COUNTER_READY = 142, - SI_DODGE_ON = 143, - SI_DODGE_READY = 144, - SI_STRUP = 145, - SI_PROPERTYDARK = 146, - SI_ADRENALINE2 = 147, - SI_PROPERTYTELEKINESIS = 148, - SI_SOULLINK = 149, - SI_PLUSATTACKPOWER = 150, - SI_PLUSMAGICPOWER = 151, - SI_DEVIL1 = 152, - SI_KAITE = 153, -// SI_SWOO = 154, -// SI_STAR2 = 155, - SI_KAIZEL = 156, - SI_KAAHI = 157, - SI_KAUPE = 158, - SI_SMA_READY = 159, - SI_SKE = 160, - SI_ONEHANDQUICKEN = 161, -// SI_FRIEND = 162, -// SI_FRIENDUP = 163, -// SI_SG_WARM = 164, - SI_SG_SUN_WARM = 165, -// 166 | The three show the exact same display: ultra red character (165, 166, 167) -// 167 | Their names would be SI_SG_SUN_WARM, SI_SG_MOON_WARM, SI_SG_STAR_WARM -// SI_EMOTION = 168, - SI_SUN_COMFORT = 169, - SI_MOON_COMFORT = 170, - SI_STAR_COMFORT = 171, -// SI_EXPUP = 172, -// SI_GDSKILL_BATTLEORDER = 173, -// SI_GDSKILL_REGENERATION = 174, -// SI_GDSKILL_POSTDELAY = 175, -// SI_RESISTHANDICAP = 176, -// SI_MAXHPPERCENT = 177, -// SI_MAXSPPERCENT = 178, -// SI_DEFENCE = 179, -// SI_SLOWDOWN = 180, - SI_PRESERVE = 181, - SI_INCSTR = 182, -// SI_NOT_EXTREMITYFIST = 183, - SI_CLAIRVOYANCE = 184, -// SI_MOVESLOW_POTION = 185, - SI_DOUBLECASTING = 186, -// SI_GRAVITATION = 187, - SI_OVERTHRUSTMAX = 188, -// SI_LONGING = 189, -// SI_HERMODE = 190, - SI_TAROTCARD = 191, // the icon allows no doubt... but what is it really used for ?? [DracoRPG] -// SI_HLIF_AVOID = 192, -// SI_HFLI_FLEET = 193, -// SI_HFLI_SPEED = 194, -// SI_HLIF_CHANGE = 195, -// SI_HAMI_BLOODLUST = 196, - SI_CR_SHRINK = 197, - SI_WZ_SIGHTBLASTER = 198, - SI_DC_WINKCHARM = 199, - SI_RG_CCONFINE_M = 200, - SI_RG_CCONFINE_S = 201, -// SI_DISABLEMOVE = 202, - SI_GS_MADNESSCANCEL = 203, //[blackhole89] - SI_GS_GATLINGFEVER = 204, - SI_EARTHSCROLL = 205, - SI_NJ_UTSUSEMI = 206, - SI_NJ_BUNSINJYUTSU = 207, - SI_NJ_NEN = 208, - SI_GS_ADJUSTMENT = 209, - SI_GS_ACCURACY = 210, - SI_NJ_SUITON = 211, -// SI_PET = 212, -// SI_MENTAL = 213, -// SI_EXPMEMORY = 214, -// SI_PERFORMANCE = 215, -// SI_GAIN = 216, -// SI_GRIFFON = 217, -// SI_DRIFT = 218, -// SI_WALLSHIFT = 219, -// SI_REINCARNATION = 220, -// SI_PATTACK = 221, -// SI_PSPEED = 222, -// SI_PDEFENSE = 223, -// SI_PCRITICAL = 224, -// SI_RANKING = 225, -// SI_PTRIPLE = 226, -// SI_DENERGY = 227, -// SI_WAVE1 = 228, -// SI_WAVE2 = 229, -// SI_WAVE3 = 230, -// SI_WAVE4 = 231, -// SI_DAURA = 232, -// SI_DFREEZER = 233, -// SI_DPUNISH = 234, -// SI_DBARRIER = 235, -// SI_DWARNING = 236, -// SI_MOUSEWHEEL = 237, -// SI_DGAUGE = 238, -// SI_DACCEL = 239, -// SI_DBLOCK = 240, - SI_FOOD_STR = 241, - SI_FOOD_AGI = 242, - SI_FOOD_VIT = 243, - SI_FOOD_DEX = 244, - SI_FOOD_INT = 245, - SI_FOOD_LUK = 246, - SI_FOOD_BASICAVOIDANCE = 247, - SI_FOOD_BASICHIT = 248, - SI_FOOD_CRITICALSUCCESSVALUE = 249, - SI_CASH_PLUSEXP = 250, - SI_CASH_DEATHPENALTY = 251, - SI_CASH_RECEIVEITEM = 252, - SI_CASH_BOSS_ALARM = 253, -// SI_DA_ENERGY = 254, -// SI_DA_FIRSTSLOT = 255, -// SI_DA_HEADDEF = 256, -// SI_DA_SPACE = 257, -// SI_DA_TRANSFORM = 258, -// SI_DA_ITEMREBUILD = 259, -// SI_DA_ILLUSION = 260, //All mobs display as Turtle General -// SI_DA_DARKPOWER = 261, -// SI_DA_EARPLUG = 262, -// SI_DA_CONTRACT = 263, //Bio Mob effect on you and SI_TRICKDEAD icon -// SI_DA_BLACK = 264, //For short time blurry screen -// SI_DA_MAGICCART = 265, -// SI_CRYSTAL = 266, -// SI_DA_REBUILD = 267, -// SI_DA_EDARKNESS = 268, -// SI_DA_EGUARDIAN = 269, -// SI_DA_TIMEOUT = 270, - SI_FOOD_STR_CASH = 271, - SI_FOOD_AGI_CASH = 272, - SI_FOOD_VIT_CASH = 273, - SI_FOOD_DEX_CASH = 274, - SI_FOOD_INT_CASH = 275, - SI_FOOD_LUK_CASH = 276, - SI_MER_FLEE = 277, - SI_MER_ATK = 278, - SI_MER_HP = 279, - SI_MER_SP = 280, - SI_MER_HIT = 281, - SI_SLOWCAST = 282, -// SI_MAGICMIRROR = 283, -// SI_STONESKIN = 284, -// SI_ANTIMAGIC = 285, - SI_CRITICALWOUND = 286, -// SI_NPC_DEFENDER = 287, -// SI_NOACTION_WAIT = 288, - SI_MOVHASTE_HORSE = 289, - SI_PROTECT_DEF = 290, - SI_PROTECT_MDEF = 291, - SI_HEALPLUS = 292, - SI_S_LIFEPOTION = 293, - SI_L_LIFEPOTION = 294, - SI_CRITICALPERCENT = 295, - SI_PLUSAVOIDVALUE = 296, -// SI_ATKER_ASPD = 297, -// SI_TARGET_ASPD = 298, -// SI_ATKER_MOVESPEED = 299, - SI_ATKER_BLOOD = 300, - SI_TARGET_BLOOD = 301, - SI_ARMOR_PROPERTY = 302, -// SI_REUSE_LIMIT_A = 303, - SI_HELLPOWER = 304, -// SI_STEAMPACK = 305, -// SI_REUSE_LIMIT_B = 306, -// SI_REUSE_LIMIT_C = 307, -// SI_REUSE_LIMIT_D = 308, -// SI_REUSE_LIMIT_E = 309, -// SI_REUSE_LIMIT_F = 310, - SI_INVINCIBLE = 311, - SI_CASH_PLUSONLYJOBEXP = 312, - SI_PARTYFLEE = 313, - SI_ANGEL_PROTECT = 314, -// SI_ENDURE_MDEF = 315, - SI_ENCHANTBLADE = 316, - SI_DEATHBOUND = 317, - SI_REFRESH = 318, - SI_GIANTGROWTH = 319, - SI_STONEHARDSKIN = 320, - SI_VITALITYACTIVATION = 321, - SI_FIGHTINGSPIRIT = 322, - SI_ABUNDANCE = 323, - SI_REUSE_MILLENNIUMSHIELD = 324, - SI_REUSE_CRUSHSTRIKE = 325, - SI_REUSE_REFRESH = 326, - SI_REUSE_STORMBLAST = 327, - SI_VENOMIMPRESS = 328, - SI_EPICLESIS = 329, - SI_ORATIO = 330, - SI_LAUDAAGNUS = 331, - SI_LAUDARAMUS = 332, - SI_CLOAKINGEXCEED = 333, - SI_HALLUCINATIONWALK = 334, - SI_HALLUCINATIONWALK_POSTDELAY = 335, - SI_RENOVATIO = 336, - SI_WEAPONBLOCKING = 337, - SI_WEAPONBLOCKING_POSTDELAY = 338, - SI_ROLLINGCUTTER = 339, - SI_EXPIATIO = 340, - SI_POISONINGWEAPON = 341, - SI_TOXIN = 342, - SI_PARALYSE = 343, - SI_VENOMBLEED = 344, - SI_MAGICMUSHROOM = 345, - SI_DEATHHURT = 346, - SI_PYREXIA = 347, - SI_OBLIVIONCURSE = 348, - SI_LEECHESEND = 349, - SI_DUPLELIGHT = 350, - SI_FROSTMISTY = 351, - SI_FEARBREEZE = 352, - SI_ELECTRICSHOCKER = 353, - SI_MARSHOFABYSS = 354, - SI_RECOGNIZEDSPELL = 355, - SI_STASIS = 356, - SI_WUGRIDER = 357, - SI_WUGDASH = 358, - SI_WUGBITE = 359, - SI_CAMOUFLAGE = 360, - SI_ACCELERATION = 361, - SI_HOVERING = 362, - SI_SPHERE_1 = 363, - SI_SPHERE_2 = 364, - SI_SPHERE_3 = 365, - SI_SPHERE_4 = 366, - SI_SPHERE_5 = 367, - SI_MVPCARD_TAOGUNKA = 368, - SI_MVPCARD_MISTRESS = 369, - SI_MVPCARD_ORCHERO = 370, - SI_MVPCARD_ORCLORD = 371, - SI_OVERHEAT_LIMITPOINT = 372, - SI_OVERHEAT = 373, - SI_SHAPESHIFT = 374, - SI_INFRAREDSCAN = 375, - SI_MAGNETICFIELD = 376, - SI_NEUTRALBARRIER = 377, - SI_NEUTRALBARRIER_MASTER = 378, - SI_STEALTHFIELD = 379, - SI_STEALTHFIELD_MASTER = 380, - SI_MANU_ATK = 381, - SI_MANU_DEF = 382, - SI_SPL_ATK = 383, - SI_SPL_DEF = 384, - SI_REPRODUCE = 385, - SI_MANU_MATK = 386, - SI_SPL_MATK = 387, - SI_STR_SCROLL = 388, - SI_INT_SCROLL = 389, - SI_LG_REFLECTDAMAGE = 390, - SI_FORCEOFVANGUARD = 391, - SI_BUCHEDENOEL = 392, - SI_AUTOSHADOWSPELL = 393, - SI_SHADOWFORM = 394, - SI_RAID = 395, - SI_SHIELDSPELL_DEF = 396, - SI_SHIELDSPELL_MDEF = 397, - SI_SHIELDSPELL_REF = 398, - SI_BODYPAINT = 399, - SI_EXEEDBREAK = 400, - SI_ADORAMUS = 401, - SI_PRESTIGE = 402, - SI_INVISIBILITY = 403, - SI_DEADLYINFECT = 404, - SI_BANDING = 405, - SI_EARTHDRIVE = 406, - SI_INSPIRATION = 407, - SI_ENERVATION = 408, - SI_GROOMY = 409, - SI_RAISINGDRAGON = 410, - SI_IGNORANCE = 411, - SI_LAZINESS = 412, - SI_LIGHTNINGWALK = 413, - SI_ACARAJE = 414, - SI_UNLUCKY = 415, - SI_CURSEDCIRCLE_ATKER = 416, - SI_CURSEDCIRCLE_TARGET = 417, - SI_WEAKNESS = 418, - SI_CRESCENTELBOW = 419, - SI_NOEQUIPACCESSARY = 420, - SI_STRIPACCESSARY = 421, - SI_MANHOLE = 422, - SI_POPECOOKIE = 423, - SI_FALLENEMPIRE = 424, - SI_GENTLETOUCH_ENERGYGAIN = 425, - SI_GENTLETOUCH_CHANGE = 426, - SI_GENTLETOUCH_REVITALIZE = 427, - SI_BLOODYLUST = 428, - SI_SWINGDANCE = 429, - SI_SYMPHONYOFLOVERS = 430, - SI_PROPERTYWALK = 431, - SI_SPELLFIST = 432, - SI_NETHERWORLD = 433, - SI_SIREN = 434, - SI_DEEPSLEEP = 435, - SI_SIRCLEOFNATURE = 436, - SI_COLD = 437, - SI_GLOOMYDAY = 438, - SI_SONG_OF_MANA = 439, - SI_CLOUDKILL = 440, - SI_DANCEWITHWUG = 441, - SI_RUSHWINDMILL = 442, - SI_ECHOSONG = 443, - SI_HARMONIZE = 444, - SI_STRIKING = 445, - SI_WARMER = 446, - SI_MOONLITSERENADE = 447, - SI_SATURDAYNIGHTFEVER = 448, - SI_SITDOWN_FORCE = 449, - SI_ANALYZE = 450, - SI_LERADSDEW = 451, - SI_MELODYOFSINK = 452, - SI_WARCRYOFBEYOND = 453, - SI_UNLIMITEDHUMMINGVOICE = 454, - SI_SPELLBOOK1 = 455, - SI_SPELLBOOK2 = 456, - SI_SPELLBOOK3 = 457, - SI_FREEZE_SP = 458, - SI_GN_TRAINING_SWORD = 459, - SI_GN_REMODELING_CART = 460, - SI_CARTSBOOST = 461, - SI_FIXEDCASTINGTM_REDUCE = 462, - SI_THORNTRAP = 463, - SI_BLOODSUCKER = 464, - SI_SPORE_EXPLOSION = 465, - SI_DEMONIC_FIRE = 466, - SI_FIRE_EXPANSION_SMOKE_POWDER = 467, - SI_FIRE_EXPANSION_TEAR_GAS = 468, - SI_BLOCKING_PLAY = 469, - SI_MANDRAGORA = 470, - SI_ACTIVATE = 471, - SI_SECRAMENT = 472, - SI_ASSUMPTIO2 = 473, - SI_TK_SEVENWIND = 474, - SI_LIMIT_ODINS_RECALL = 475, - SI_STOMACHACHE = 476, - SI_MYSTERIOUS_POWDER = 477, - SI_MELON_BOMB = 478, - SI_BANANA_BOMB_SITDOWN_POSTDELAY = 479, - SI_PROMOTE_HEALTH_RESERCH = 480, - SI_ENERGY_DRINK_RESERCH = 481, - SI_EXTRACT_WHITE_POTION_Z = 482, - SI_VITATA_500 = 483, - SI_EXTRACT_SALAMINE_JUICE = 484, - SI_BOOST500 = 485, - SI_FULL_SWING_K = 486, - SI_MANA_PLUS = 487, - SI_MUSTLE_M = 488, - SI_LIFE_FORCE_F = 489, - SI_VACUUM_EXTREME = 490, - SI_SAVAGE_STEAK = 491, - SI_COCKTAIL_WARG_BLOOD = 492, - SI_MINOR_BBQ = 493, - SI_SIROMA_ICE_TEA = 494, - SI_DROCERA_HERB_STEAMED = 495, - SI_PUTTI_TAILS_NOODLES = 496, - SI_BANANA_BOMB = 497, - SI_SUMMON_AGNI = 498, - SI_SPELLBOOK4 = 499, - SI_SPELLBOOK5 = 500, - SI_SPELLBOOK6 = 501, - SI_SPELLBOOK7 = 502, - SI_ELEMENTAL_AGGRESSIVE = 503, - SI_RETURN_TO_ELDICASTES = 504, - SI_BANDING_DEFENCE = 505, - SI_SKELSCROLL = 506, - SI_DISTRUCTIONSCROLL = 507, - SI_ROYALSCROLL = 508, - SI_IMMUNITYSCROLL = 509, - SI_MYSTICSCROLL = 510, - SI_BATTLESCROLL = 511, - SI_ARMORSCROLL = 512, - SI_FREYJASCROLL = 513, - SI_SOULSCROLL = 514, - SI_CIRCLE_OF_FIRE = 515, - SI_CIRCLE_OF_FIRE_OPTION = 516, - SI_FIRE_CLOAK = 517, - SI_FIRE_CLOAK_OPTION = 518, - SI_WATER_SCREEN = 519, - SI_WATER_SCREEN_OPTION = 520, - SI_WATER_DROP = 521, - SI_WATER_DROP_OPTION = 522, - SI_WIND_STEP = 523, - SI_WIND_STEP_OPTION = 524, - SI_WIND_CURTAIN = 525, - SI_WIND_CURTAIN_OPTION = 526, - SI_WATER_BARRIER = 527, - SI_ZEPHYR = 528, - SI_SOLID_SKIN = 529, - SI_SOLID_SKIN_OPTION = 530, - SI_STONE_SHIELD = 531, - SI_STONE_SHIELD_OPTION = 532, - SI_POWER_OF_GAIA = 533, - // SI_EL_WAIT = 534, - // SI_EL_PASSIVE = 535, - // SI_EL_DEFENSIVE = 536, - // SI_EL_OFFENSIVE = 537, - // SI_EL_COST = 538, - SI_PYROTECHNIC = 539, - SI_PYROTECHNIC_OPTION = 540, - SI_HEATER = 541, - SI_HEATER_OPTION = 542, - SI_TROPIC = 543, - SI_TROPIC_OPTION = 544, - SI_AQUAPLAY = 545, - SI_AQUAPLAY_OPTION = 546, - SI_COOLER = 547, - SI_COOLER_OPTION = 548, - SI_CHILLY_AIR = 549, - SI_CHILLY_AIR_OPTION = 550, - SI_GUST = 551, - SI_GUST_OPTION = 552, - SI_BLAST = 553, - SI_BLAST_OPTION = 554, - SI_WILD_STORM = 555, - SI_WILD_STORM_OPTION = 556, - SI_PETROLOGY = 557, - SI_PETROLOGY_OPTION = 558, - SI_CURSED_SOIL = 559, - SI_CURSED_SOIL_OPTION = 560, - SI_UPHEAVAL = 561, - SI_UPHEAVAL_OPTION = 562, - SI_TIDAL_WEAPON = 563, - SI_TIDAL_WEAPON_OPTION = 564, - SI_ROCK_CRUSHER = 565, - SI_ROCK_CRUSHER_ATK = 566, - SI_FIRE_INSIGNIA = 567, - SI_WATER_INSIGNIA = 568, - SI_WIND_INSIGNIA = 569, - SI_EARTH_INSIGNIA = 570, - SI_EQUIPED_FLOOR = 571, - SI_GUARDIAN_RECALL = 572, - SI_MORA_BUFF = 573, - SI_REUSE_LIMIT_G = 574, - SI_REUSE_LIMIT_H = 575, - SI_NEEDLE_OF_PARALYZE = 576, - SI_PAIN_KILLER = 577, - SI_G_LIFEPOTION = 578, - SI_VITALIZE_POTION = 579, - SI_LIGHT_OF_REGENE = 580, - SI_OVERED_BOOST = 581, - SI_SILENT_BREEZE = 582, - SI_ODINS_POWER = 583, - SI_STYLE_CHANGE = 584, - SI_SONIC_CLAW_POSTDELAY = 585, + SI_BLANK = -1, + + SI_PROVOKE = 0, + SI_ENDURE = 1, + SI_TWOHANDQUICKEN = 2, + SI_CONCENTRATION = 3, + SI_HIDING = 4, + SI_CLOAKING = 5, + SI_ENCHANTPOISON = 6, + SI_POISONREACT = 7, + SI_QUAGMIRE = 8, + SI_ANGELUS = 9, + SI_BLESSING = 10, + SI_CRUCIS = 11, + SI_INC_AGI = 12, + SI_DEC_AGI = 13, + SI_SLOWPOISON = 14, + SI_IMPOSITIO = 15, + SI_SUFFRAGIUM = 16, + SI_ASPERSIO = 17, + SI_BENEDICTIO = 18, + SI_KYRIE = 19, + SI_MAGNIFICAT = 20, + SI_GLORIA = 21, + SI_LEXAETERNA = 22, + SI_ADRENALINE = 23, + SI_WEAPONPERFECT = 24, + SI_OVERTHRUST = 25, + SI_MAXIMIZE = 26, + SI_RIDING = 27, + SI_FALCON = 28, + SI_TRICKDEAD = 29, + SI_SHOUT = 30, + SI_ENERGYCOAT = 31, + SI_BROKENARMOR = 32, + SI_BROKENWEAPON = 33, + SI_ILLUSION = 34, + SI_WEIGHTOVER50 = 35, + SI_WEIGHTOVER90 = 36, + SI_ATTHASTE_POTION1 = 37, + SI_ATTHASTE_POTION2 = 38, + SI_ATTHASTE_POTION3 = 39, + SI_ATTHASTE_INFINITY = 40, + SI_MOVHASTE_POTION = 41, + SI_MOVHASTE_INFINITY = 42, + //SI_AUTOCOUNTER = 43, + //SI_SPLASHER = 44, + SI_ANKLESNARE = 45, + SI_POSTDELAY = 46, + //SI_NOACTION = 47, + //SI_IMPOSSIBLEPICKUP = 48, + //SI_BARRIER = 49, + + SI_NOEQUIPWEAPON = 50, + SI_NOEQUIPSHIELD = 51, + SI_NOEQUIPARMOR = 52, + SI_NOEQUIPHELM = 53, + SI_PROTECTWEAPON = 54, + SI_PROTECTSHIELD = 55, + SI_PROTECTARMOR = 56, + SI_PROTECTHELM = 57, + SI_AUTOGUARD = 58, + SI_REFLECTSHIELD = 59, + //SI_DEVOTION = 60, + SI_PROVIDENCE = 61, + SI_DEFENDER = 62, + //SI_MAGICROD = 63, + //SI_WEAPONPROPERTY = 64, + SI_AUTOSPELL = 65, + //SI_SPECIALZONE = 66, + //SI_MASK = 67, + SI_SPEARQUICKEN = 68, + //SI_BDPLAYING = 69, + //SI_WHISTLE = 70, + //SI_ASSASSINCROSS = 71, + //SI_POEMBRAGI = 72, + //SI_APPLEIDUN = 73, + //SI_HUMMING = 74, + //SI_DONTFORGETME = 75, + //SI_FORTUNEKISS = 76, + //SI_SERVICEFORYOU = 77, + //SI_RICHMANKIM = 78, + //SI_ETERNALCHAOS = 79, + //SI_DRUMBATTLEFIELD = 80, + //SI_RINGNIBELUNGEN = 81, + //SI_ROKISWEIL = 82, + //SI_INTOABYSS = 83, + //SI_SIEGFRIED = 84, + //SI_BLADESTOP = 85, + SI_EXPLOSIONSPIRITS = 86, + SI_STEELBODY = 87, + SI_EXTREMITYFIST = 88, + //SI_COMBOATTACK = 89, + SI_PROPERTYFIRE = 90, + SI_PROPERTYWATER = 91, + SI_PROPERTYWIND = 92, + SI_PROPERTYGROUND = 93, + //SI_MAGICATTACK = 94, + SI_STOP = 95, + //SI_WEAPONBRAKER = 96, + SI_PROPERTYUNDEAD = 97, + //SI_POWERUP = 98, + //SI_AGIUP = 99, + + //SI_SIEGEMODE = 100, + //SI_INVISIBLE = 101, + //SI_STATUSONE = 102, + SI_AURABLADE = 103, + SI_PARRYING = 104, + SI_LKCONCENTRATION = 105, + SI_TENSIONRELAX = 106, + SI_BERSERK = 107, + //SI_SACRIFICE = 108, + //SI_GOSPEL = 109, + SI_ASSUMPTIO = 110, + //SI_BASILICA = 111, + SI_GROUNDMAGIC = 112, + SI_MAGICPOWER = 113, + SI_EDP = 114, + SI_TRUESIGHT = 115, + SI_WINDWALK = 116, + SI_MELTDOWN = 117, + SI_CARTBOOST = 118, + //SI_CHASEWALK = 119, + SI_SWORDREJECT = 120, + SI_MARIONETTE_MASTER = 121, + SI_MARIONETTE = 122, + SI_MOON = 123, + SI_BLOODING = 124, + SI_JOINTBEAT = 125, + //SI_MINDBREAKER = 126, + //SI_MEMORIZE = 127, + //SI_FOGWALL = 128, + //SI_SPIDERWEB = 129, + SI_PROTECTEXP = 130, + //SI_SUB_WEAPONPROPERTY = 131, + SI_AUTOBERSERK = 132, + SI_RUN = 133, + SI_TING = 134, + SI_STORMKICK_ON = 135, + SI_STORMKICK_READY = 136, + SI_DOWNKICK_ON = 137, + SI_DOWNKICK_READY = 138, + SI_TURNKICK_ON = 139, + SI_TURNKICK_READY = 140, + SI_COUNTER_ON = 141, + SI_COUNTER_READY = 142, + SI_DODGE_ON = 143, + SI_DODGE_READY = 144, + SI_STRUP = 145, + SI_PROPERTYDARK = 146, + SI_ADRENALINE2 = 147, + SI_PROPERTYTELEKINESIS = 148, + SI_SOULLINK = 149, + + SI_PLUSATTACKPOWER = 150, + SI_PLUSMAGICPOWER = 151, + SI_DEVIL1 = 152, + SI_KAITE = 153, + //SI_SWOO = 154, + //SI_STAR2 = 155, + SI_KAIZEL = 156, + SI_KAAHI = 157, + SI_KAUPE = 158, + SI_SMA_READY = 159, + SI_SKE = 160, + SI_ONEHANDQUICKEN = 161, + //SI_FRIEND = 162, + //SI_FRIENDUP = 163, + //SI_SG_WARM = 164, + SI_SG_SUN_WARM = 165, + //SI_SG_MOON_WARM = 166 | The three show the exact same display: ultra red character (165, 166, 167) + //SI_SG_STAR_WARM = 167 | Their names would be SI_SG_SUN_WARM, SI_SG_MOON_WARM, SI_SG_STAR_WARM + //SI_EMOTION = 168, + SI_SUN_COMFORT = 169, + SI_MOON_COMFORT = 170, + SI_STAR_COMFORT = 171, + //SI_EXPUP = 172, + //SI_GDSKILL_BATTLEORDER = 173, + //SI_GDSKILL_REGENERATION = 174, + //SI_GDSKILL_POSTDELAY = 175, + //SI_RESISTHANDICAP = 176, + //SI_MAXHPPERCENT = 177, + //SI_MAXSPPERCENT = 178, + //SI_DEFENCE = 179, + //SI_SLOWDOWN = 180, + SI_PRESERVE = 181, + SI_INCSTR = 182, + //SI_NOT_EXTREMITYFIST = 183, + SI_CLAIRVOYANCE = 184, + //SI_MOVESLOW_POTION = 185, + SI_DOUBLECASTING = 186, + //SI_GRAVITATION = 187, + SI_OVERTHRUSTMAX = 188, + //SI_LONGING = 189, + //SI_HERMODE = 190, + SI_TAROTCARD = 191, // the icon allows no doubt... but what is it really used for ?? [DracoRPG] + //SI_HLIF_AVOID = 192, + //SI_HFLI_FLEET = 193, + //SI_HFLI_SPEED = 194, + //SI_HLIF_CHANGE = 195, + //SI_HAMI_BLOODLUST = 196, + SI_CR_SHRINK = 197, + SI_WZ_SIGHTBLASTER = 198, + SI_DC_WINKCHARM = 199, + + SI_RG_CCONFINE_M = 200, + SI_RG_CCONFINE_S = 201, + //SI_DISABLEMOVE = 202, + SI_GS_MADNESSCANCEL = 203, //[blackhole89] + SI_GS_GATLINGFEVER = 204, + SI_EARTHSCROLL = 205, + SI_NJ_UTSUSEMI = 206, + SI_NJ_BUNSINJYUTSU = 207, + SI_NJ_NEN = 208, + SI_GS_ADJUSTMENT = 209, + SI_GS_ACCURACY = 210, + SI_NJ_SUITON = 211, + //SI_PET = 212, + //SI_MENTAL = 213, + //SI_EXPMEMORY = 214, + //SI_PERFORMANCE = 215, + //SI_GAIN = 216, + //SI_GRIFFON = 217, + //SI_DRIFT = 218, + //SI_WALLSHIFT = 219, + //SI_REINCARNATION = 220, + //SI_PATTACK = 221, + //SI_PSPEED = 222, + //SI_PDEFENSE = 223, + //SI_PCRITICAL = 224, + //SI_RANKING = 225, + //SI_PTRIPLE = 226, + //SI_DENERGY = 227, + //SI_WAVE1 = 228, + //SI_WAVE2 = 229, + //SI_WAVE3 = 230, + //SI_WAVE4 = 231, + //SI_DAURA = 232, + //SI_DFREEZER = 233, + //SI_DPUNISH = 234, + //SI_DBARRIER = 235, + //SI_DWARNING = 236, + //SI_MOUSEWHEEL = 237, + //SI_DGAUGE = 238, + //SI_DACCEL = 239, + //SI_DBLOCK = 240, + SI_FOOD_STR = 241, + SI_FOOD_AGI = 242, + SI_FOOD_VIT = 243, + SI_FOOD_DEX = 244, + SI_FOOD_INT = 245, + SI_FOOD_LUK = 246, + SI_FOOD_BASICAVOIDANCE = 247, + SI_FOOD_BASICHIT = 248, + SI_FOOD_CRITICALSUCCESSVALUE = 249, + + SI_CASH_PLUSEXP = 250, + SI_CASH_DEATHPENALTY = 251, + SI_CASH_RECEIVEITEM = 252, + SI_CASH_BOSS_ALARM = 253, + //SI_DA_ENERGY = 254, + //SI_DA_FIRSTSLOT = 255, + //SI_DA_HEADDEF = 256, + //SI_DA_SPACE = 257, + //SI_DA_TRANSFORM = 258, + //SI_DA_ITEMREBUILD = 259, + //SI_DA_ILLUSION = 260, //All mobs display as Turtle General + //SI_DA_DARKPOWER = 261, + //SI_DA_EARPLUG = 262, + //SI_DA_CONTRACT = 263, //Bio Mob effect on you and SI_TRICKDEAD icon + //SI_DA_BLACK = 264, //For short time blurry screen + //SI_DA_MAGICCART = 265, + //SI_CRYSTAL = 266, + //SI_DA_REBUILD = 267, + //SI_DA_EDARKNESS = 268, + //SI_DA_EGUARDIAN = 269, + //SI_DA_TIMEOUT = 270, + SI_FOOD_STR_CASH = 271, + SI_FOOD_AGI_CASH = 272, + SI_FOOD_VIT_CASH = 273, + SI_FOOD_DEX_CASH = 274, + SI_FOOD_INT_CASH = 275, + SI_FOOD_LUK_CASH = 276, + SI_MER_FLEE = 277, + SI_MER_ATK = 278, + SI_MER_HP = 279, + SI_MER_SP = 280, + SI_MER_HIT = 281, + SI_SLOWCAST = 282, + //SI_MAGICMIRROR = 283, + //SI_STONESKIN = 284, + //SI_ANTIMAGIC = 285, + SI_CRITICALWOUND = 286, + //SI_NPC_DEFENDER = 287, + //SI_NOACTION_WAIT = 288, + SI_MOVHASTE_HORSE = 289, + SI_PROTECT_DEF = 290, + SI_PROTECT_MDEF = 291, + SI_HEALPLUS = 292, + SI_S_LIFEPOTION = 293, + SI_L_LIFEPOTION = 294, + SI_CRITICALPERCENT = 295, + SI_PLUSAVOIDVALUE = 296, + //SI_ATKER_ASPD = 297, + //SI_TARGET_ASPD = 298, + //SI_ATKER_MOVESPEED = 299, + + SI_ATKER_BLOOD = 300, + SI_TARGET_BLOOD = 301, + SI_ARMOR_PROPERTY = 302, + //SI_REUSE_LIMIT_A = 303, + SI_HELLPOWER = 304, + //SI_STEAMPACK = 305, + //SI_REUSE_LIMIT_B = 306, + //SI_REUSE_LIMIT_C = 307, + //SI_REUSE_LIMIT_D = 308, + //SI_REUSE_LIMIT_E = 309, + //SI_REUSE_LIMIT_F = 310, + SI_INVINCIBLE = 311, + SI_CASH_PLUSONLYJOBEXP = 312, + SI_PARTYFLEE = 313, + SI_ANGEL_PROTECT = 314, + //SI_ENDURE_MDEF = 315, + SI_ENCHANTBLADE = 316, + SI_DEATHBOUND = 317, + SI_REFRESH = 318, + SI_GIANTGROWTH = 319, + SI_STONEHARDSKIN = 320, + SI_VITALITYACTIVATION = 321, + SI_FIGHTINGSPIRIT = 322, + SI_ABUNDANCE = 323, + SI_REUSE_MILLENNIUMSHIELD = 324, + SI_REUSE_CRUSHSTRIKE = 325, + SI_REUSE_REFRESH = 326, + SI_REUSE_STORMBLAST = 327, + SI_VENOMIMPRESS = 328, + SI_EPICLESIS = 329, + SI_ORATIO = 330, + SI_LAUDAAGNUS = 331, + SI_LAUDARAMUS = 332, + SI_CLOAKINGEXCEED = 333, + SI_HALLUCINATIONWALK = 334, + SI_HALLUCINATIONWALK_POSTDELAY = 335, + SI_RENOVATIO = 336, + SI_WEAPONBLOCKING = 337, + SI_WEAPONBLOCKING_POSTDELAY = 338, + SI_ROLLINGCUTTER = 339, + SI_EXPIATIO = 340, + SI_POISONINGWEAPON = 341, + SI_TOXIN = 342, + SI_PARALYSE = 343, + SI_VENOMBLEED = 344, + SI_MAGICMUSHROOM = 345, + SI_DEATHHURT = 346, + SI_PYREXIA = 347, + SI_OBLIVIONCURSE = 348, + SI_LEECHESEND = 349, + + SI_DUPLELIGHT = 350, + SI_FROSTMISTY = 351, + SI_FEARBREEZE = 352, + SI_ELECTRICSHOCKER = 353, + SI_MARSHOFABYSS = 354, + SI_RECOGNIZEDSPELL = 355, + SI_STASIS = 356, + SI_WUGRIDER = 357, + SI_WUGDASH = 358, + SI_WUGBITE = 359, + SI_CAMOUFLAGE = 360, + SI_ACCELERATION = 361, + SI_HOVERING = 362, + SI_SPHERE_1 = 363, + SI_SPHERE_2 = 364, + SI_SPHERE_3 = 365, + SI_SPHERE_4 = 366, + SI_SPHERE_5 = 367, + SI_MVPCARD_TAOGUNKA = 368, + SI_MVPCARD_MISTRESS = 369, + SI_MVPCARD_ORCHERO = 370, + SI_MVPCARD_ORCLORD = 371, + SI_OVERHEAT_LIMITPOINT = 372, + SI_OVERHEAT = 373, + SI_SHAPESHIFT = 374, + SI_INFRAREDSCAN = 375, + SI_MAGNETICFIELD = 376, + SI_NEUTRALBARRIER = 377, + SI_NEUTRALBARRIER_MASTER = 378, + SI_STEALTHFIELD = 379, + SI_STEALTHFIELD_MASTER = 380, + SI_MANU_ATK = 381, + SI_MANU_DEF = 382, + SI_SPL_ATK = 383, + SI_SPL_DEF = 384, + SI_REPRODUCE = 385, + SI_MANU_MATK = 386, + SI_SPL_MATK = 387, + SI_STR_SCROLL = 388, + SI_INT_SCROLL = 389, + SI_LG_REFLECTDAMAGE = 390, + SI_FORCEOFVANGUARD = 391, + SI_BUCHEDENOEL = 392, + SI_AUTOSHADOWSPELL = 393, + SI_SHADOWFORM = 394, + SI_RAID = 395, + SI_SHIELDSPELL_DEF = 396, + SI_SHIELDSPELL_MDEF = 397, + SI_SHIELDSPELL_REF = 398, + SI_BODYPAINT = 399, + + SI_EXEEDBREAK = 400, + SI_ADORAMUS = 401, + SI_PRESTIGE = 402, + SI_INVISIBILITY = 403, + SI_DEADLYINFECT = 404, + SI_BANDING = 405, + SI_EARTHDRIVE = 406, + SI_INSPIRATION = 407, + SI_ENERVATION = 408, + SI_GROOMY = 409, + SI_RAISINGDRAGON = 410, + SI_IGNORANCE = 411, + SI_LAZINESS = 412, + SI_LIGHTNINGWALK = 413, + SI_ACARAJE = 414, + SI_UNLUCKY = 415, + SI_CURSEDCIRCLE_ATKER = 416, + SI_CURSEDCIRCLE_TARGET = 417, + SI_WEAKNESS = 418, + SI_CRESCENTELBOW = 419, + SI_NOEQUIPACCESSARY = 420, + SI_STRIPACCESSARY = 421, + SI_MANHOLE = 422, + SI_POPECOOKIE = 423, + SI_FALLENEMPIRE = 424, + SI_GENTLETOUCH_ENERGYGAIN = 425, + SI_GENTLETOUCH_CHANGE = 426, + SI_GENTLETOUCH_REVITALIZE = 427, + SI_BLOODYLUST = 428, + SI_SWINGDANCE = 429, + SI_SYMPHONYOFLOVERS = 430, + SI_PROPERTYWALK = 431, + SI_SPELLFIST = 432, + SI_NETHERWORLD = 433, + SI_SIREN = 434, + SI_DEEPSLEEP = 435, + SI_SIRCLEOFNATURE = 436, + SI_COLD = 437, + SI_GLOOMYDAY = 438, + SI_SONG_OF_MANA = 439, + SI_CLOUDKILL = 440, + SI_DANCEWITHWUG = 441, + SI_RUSHWINDMILL = 442, + SI_ECHOSONG = 443, + SI_HARMONIZE = 444, + SI_STRIKING = 445, + SI_WARMER = 446, + SI_MOONLITSERENADE = 447, + SI_SATURDAYNIGHTFEVER = 448, + SI_SITDOWN_FORCE = 449, + + SI_ANALYZE = 450, + SI_LERADSDEW = 451, + SI_MELODYOFSINK = 452, + SI_WARCRYOFBEYOND = 453, + SI_UNLIMITEDHUMMINGVOICE = 454, + SI_SPELLBOOK1 = 455, + SI_SPELLBOOK2 = 456, + SI_SPELLBOOK3 = 457, + SI_FREEZE_SP = 458, + SI_GN_TRAINING_SWORD = 459, + SI_GN_REMODELING_CART = 460, + SI_CARTSBOOST = 461, + SI_FIXEDCASTINGTM_REDUCE = 462, + SI_THORNTRAP = 463, + SI_BLOODSUCKER = 464, + SI_SPORE_EXPLOSION = 465, + SI_DEMONIC_FIRE = 466, + SI_FIRE_EXPANSION_SMOKE_POWDER = 467, + SI_FIRE_EXPANSION_TEAR_GAS = 468, + SI_BLOCKING_PLAY = 469, + SI_MANDRAGORA = 470, + SI_ACTIVATE = 471, + SI_SECRAMENT = 472, + SI_ASSUMPTIO2 = 473, + SI_TK_SEVENWIND = 474, + SI_LIMIT_ODINS_RECALL = 475, + SI_STOMACHACHE = 476, + SI_MYSTERIOUS_POWDER = 477, + SI_MELON_BOMB = 478, + SI_BANANA_BOMB_SITDOWN_POSTDELAY = 479, + SI_PROMOTE_HEALTH_RESERCH = 480, + SI_ENERGY_DRINK_RESERCH = 481, + SI_EXTRACT_WHITE_POTION_Z = 482, + SI_VITATA_500 = 483, + SI_EXTRACT_SALAMINE_JUICE = 484, + SI_BOOST500 = 485, + SI_FULL_SWING_K = 486, + SI_MANA_PLUS = 487, + SI_MUSTLE_M = 488, + SI_LIFE_FORCE_F = 489, + SI_VACUUM_EXTREME = 490, + SI_SAVAGE_STEAK = 491, + SI_COCKTAIL_WARG_BLOOD = 492, + SI_MINOR_BBQ = 493, + SI_SIROMA_ICE_TEA = 494, + SI_DROCERA_HERB_STEAMED = 495, + SI_PUTTI_TAILS_NOODLES = 496, + SI_BANANA_BOMB = 497, + SI_SUMMON_AGNI = 498, + SI_SPELLBOOK4 = 499, + + SI_SPELLBOOK5 = 500, + SI_SPELLBOOK6 = 501, + SI_SPELLBOOK7 = 502, + SI_ELEMENTAL_AGGRESSIVE = 503, + SI_RETURN_TO_ELDICASTES = 504, + SI_BANDING_DEFENCE = 505, + SI_SKELSCROLL = 506, + SI_DISTRUCTIONSCROLL = 507, + SI_ROYALSCROLL = 508, + SI_IMMUNITYSCROLL = 509, + SI_MYSTICSCROLL = 510, + SI_BATTLESCROLL = 511, + SI_ARMORSCROLL = 512, + SI_FREYJASCROLL = 513, + SI_SOULSCROLL = 514, + SI_CIRCLE_OF_FIRE = 515, + SI_CIRCLE_OF_FIRE_OPTION = 516, + SI_FIRE_CLOAK = 517, + SI_FIRE_CLOAK_OPTION = 518, + SI_WATER_SCREEN = 519, + SI_WATER_SCREEN_OPTION = 520, + SI_WATER_DROP = 521, + SI_WATER_DROP_OPTION = 522, + SI_WIND_STEP = 523, + SI_WIND_STEP_OPTION = 524, + SI_WIND_CURTAIN = 525, + SI_WIND_CURTAIN_OPTION = 526, + SI_WATER_BARRIER = 527, + SI_ZEPHYR = 528, + SI_SOLID_SKIN = 529, + SI_SOLID_SKIN_OPTION = 530, + SI_STONE_SHIELD = 531, + SI_STONE_SHIELD_OPTION = 532, + SI_POWER_OF_GAIA = 533, + //SI_EL_WAIT = 534, + //SI_EL_PASSIVE = 535, + //SI_EL_DEFENSIVE = 536, + //SI_EL_OFFENSIVE = 537, + //SI_EL_COST = 538, + SI_PYROTECHNIC = 539, + SI_PYROTECHNIC_OPTION = 540, + SI_HEATER = 541, + SI_HEATER_OPTION = 542, + SI_TROPIC = 543, + SI_TROPIC_OPTION = 544, + SI_AQUAPLAY = 545, + SI_AQUAPLAY_OPTION = 546, + SI_COOLER = 547, + SI_COOLER_OPTION = 548, + SI_CHILLY_AIR = 549, + + SI_CHILLY_AIR_OPTION = 550, + SI_GUST = 551, + SI_GUST_OPTION = 552, + SI_BLAST = 553, + SI_BLAST_OPTION = 554, + SI_WILD_STORM = 555, + SI_WILD_STORM_OPTION = 556, + SI_PETROLOGY = 557, + SI_PETROLOGY_OPTION = 558, + SI_CURSED_SOIL = 559, + SI_CURSED_SOIL_OPTION = 560, + SI_UPHEAVAL = 561, + SI_UPHEAVAL_OPTION = 562, + SI_TIDAL_WEAPON = 563, + SI_TIDAL_WEAPON_OPTION = 564, + SI_ROCK_CRUSHER = 565, + SI_ROCK_CRUSHER_ATK = 566, + SI_FIRE_INSIGNIA = 567, + SI_WATER_INSIGNIA = 568, + SI_WIND_INSIGNIA = 569, + SI_EARTH_INSIGNIA = 570, + SI_EQUIPED_FLOOR = 571, + SI_GUARDIAN_RECALL = 572, + SI_MORA_BUFF = 573, + SI_REUSE_LIMIT_G = 574, + SI_REUSE_LIMIT_H = 575, + SI_NEEDLE_OF_PARALYZE = 576, + SI_PAIN_KILLER = 577, + SI_G_LIFEPOTION = 578, + SI_VITALIZE_POTION = 579, + SI_LIGHT_OF_REGENE = 580, + SI_OVERED_BOOST = 581, + SI_SILENT_BREEZE = 582, + SI_ODINS_POWER = 583, + SI_STYLE_CHANGE = 584, + SI_SONIC_CLAW_POSTDELAY = 585, // ID's 586 - 595 Currently Unused - SI_SILVERVEIN_RUSH_POSTDELAY = 596, - SI_MIDNIGHT_FRENZY_POSTDELAY = 597, - SI_GOLDENE_FERSE = 598, - SI_ANGRIFFS_MODUS = 599, - SI_TINDER_BREAKER = 600, - SI_TINDER_BREAKER_POSTDELAY = 601, - SI_CBC = 602, - SI_CBC_POSTDELAY = 603, - SI_EQC = 604, - SI_MAGMA_FLOW = 605, - SI_GRANITIC_ARMOR = 606, - SI_PYROCLASTIC = 607, - SI_VOLCANIC_ASH = 608, - SI_SPIRITS_SAVEINFO1 = 609, - SI_SPIRITS_SAVEINFO2 = 610, - SI_MAGIC_CANDY = 611, - SI_SEARCH_STORE_INFO = 612, - SI_ALL_RIDING = 613, - SI_ALL_RIDING_REUSE_LIMIT = 614, - SI_MACRO = 615, - SI_MACRO_POSTDELAY = 616, - SI_BEER_BOTTLE_CAP = 617, - SI_OVERLAPEXPUP = 618, - SI_PC_IZ_DUN05 = 619, - SI_CRUSHSTRIKE = 620, - SI_MONSTER_TRANSFORM = 621, - SI_SIT = 622, - SI_ONAIR = 623, - SI_MTF_ASPD = 624, - SI_MTF_RANGEATK = 625, - SI_MTF_MATK = 626, - SI_MTF_MLEATKED = 627, - SI_MTF_CRIDAMAGE = 628, - SI_REUSE_LIMIT_MTF = 629, - SI_MACRO_PERMIT = 630, - SI_MACRO_PLAY = 631, - SI_SKF_CAST = 632, - SI_SKF_ASPD = 633, - SI_SKF_ATK = 634, - SI_SKF_MATK = 635, - SI_REWARD_PLUSONLYJOBEXP = 636, - SI_HANDICAPSTATE_NORECOVER = 637, - SI_SET_NUM_DEF = 638, - SI_SET_NUM_MDEF = 639, - SI_SET_PER_DEF = 640, - SI_SET_PER_MDEF = 641, - SI_PARTYBOOKING_SEARCH_DEALY = 642, - SI_PARTYBOOKING_REGISTER_DEALY = 643, - SI_PERIOD_TIME_CHECK_DETECT_SKILL = 644, - SI_KO_JYUMONJIKIRI = 645, - SI_MEIKYOUSISUI = 646, - SI_ATTHASTE_CASH = 647, - SI_EQUIPPED_DIVINE_ARMOR = 648, - SI_EQUIPPED_HOLY_ARMOR = 649, - SI_2011RWC = 650, - SI_KYOUGAKU = 651, - SI_IZAYOI = 652, - SI_ZENKAI = 653, - SI_KG_KAGEHUMI = 654, - SI_KYOMU = 655, - SI_KAGEMUSYA = 656, - SI_ZANGETSU = 657, - SI_PHI_DEMON = 658, - SI_GENSOU = 659, - SI_AKAITSUKI = 660, - SI_TETANY = 661, - SI_GM_BATTLE = 662, - SI_GM_BATTLE2 = 663, - SI_2011RWC_SCROLL = 664, - SI_ACTIVE_MONSTER_TRANSFORM = 665, - SI_MYSTICPOWDER = 666, - SI_ECLAGE_RECALL = 667, - SI_ENTRY_QUEUE_APPLY_DELAY = 668, - SI_REUSE_LIMIT_ECL = 669, - SI_M_LIFEPOTION = 670, + SI_SILVERVEIN_RUSH_POSTDELAY = 596, + SI_MIDNIGHT_FRENZY_POSTDELAY = 597, + SI_GOLDENE_FERSE = 598, + SI_ANGRIFFS_MODUS = 599, + + SI_TINDER_BREAKER = 600, + SI_TINDER_BREAKER_POSTDELAY = 601, + SI_CBC = 602, + SI_CBC_POSTDELAY = 603, + SI_EQC = 604, + SI_MAGMA_FLOW = 605, + SI_GRANITIC_ARMOR = 606, + SI_PYROCLASTIC = 607, + SI_VOLCANIC_ASH = 608, + SI_SPIRITS_SAVEINFO1 = 609, + SI_SPIRITS_SAVEINFO2 = 610, + SI_MAGIC_CANDY = 611, + SI_SEARCH_STORE_INFO = 612, + SI_ALL_RIDING = 613, + SI_ALL_RIDING_REUSE_LIMIT = 614, + SI_MACRO = 615, + SI_MACRO_POSTDELAY = 616, + SI_BEER_BOTTLE_CAP = 617, + SI_OVERLAPEXPUP = 618, + SI_PC_IZ_DUN05 = 619, + SI_CRUSHSTRIKE = 620, + SI_MONSTER_TRANSFORM = 621, + SI_SIT = 622, + SI_ONAIR = 623, + SI_MTF_ASPD = 624, + SI_MTF_RANGEATK = 625, + SI_MTF_MATK = 626, + SI_MTF_MLEATKED = 627, + SI_MTF_CRIDAMAGE = 628, + SI_REUSE_LIMIT_MTF = 629, + SI_MACRO_PERMIT = 630, + SI_MACRO_PLAY = 631, + SI_SKF_CAST = 632, + SI_SKF_ASPD = 633, + SI_SKF_ATK = 634, + SI_SKF_MATK = 635, + SI_REWARD_PLUSONLYJOBEXP = 636, + SI_HANDICAPSTATE_NORECOVER = 637, + SI_SET_NUM_DEF = 638, + SI_SET_NUM_MDEF = 639, + SI_SET_PER_DEF = 640, + SI_SET_PER_MDEF = 641, + SI_PARTYBOOKING_SEARCH_DEALY = 642, + SI_PARTYBOOKING_REGISTER_DEALY = 643, + SI_PERIOD_TIME_CHECK_DETECT_SKILL = 644, + SI_KO_JYUMONJIKIRI = 645, + SI_MEIKYOUSISUI = 646, + SI_ATTHASTE_CASH = 647, + SI_EQUIPPED_DIVINE_ARMOR = 648, + SI_EQUIPPED_HOLY_ARMOR = 649, + + SI_2011RWC = 650, + SI_KYOUGAKU = 651, + SI_IZAYOI = 652, + SI_ZENKAI = 653, + SI_KG_KAGEHUMI = 654, + SI_KYOMU = 655, + SI_KAGEMUSYA = 656, + SI_ZANGETSU = 657, + SI_PHI_DEMON = 658, + SI_GENSOU = 659, + SI_AKAITSUKI = 660, + SI_TETANY = 661, + SI_GM_BATTLE = 662, + SI_GM_BATTLE2 = 663, + SI_2011RWC_SCROLL = 664, + SI_ACTIVE_MONSTER_TRANSFORM = 665, + SI_MYSTICPOWDER = 666, + SI_ECLAGE_RECALL = 667, + SI_ENTRY_QUEUE_APPLY_DELAY = 668, + SI_REUSE_LIMIT_ECL = 669, + SI_M_LIFEPOTION = 670, SI_ENTRY_QUEUE_NOTIFY_ADMISSION_TIME_OUT = 671, - SI_UNKNOWN_NAME = 672, - SI_ON_PUSH_CART = 673, - SI_HAT_EFFECT = 674, - SI_FLOWER_LEAF = 675, - SI_RAY_OF_PROTECTION = 676, - SI_GLASTHEIM_ATK = 677, - SI_GLASTHEIM_DEF = 678, - SI_GLASTHEIM_HEAL = 679, - SI_GLASTHEIM_HIDDEN = 680, - SI_GLASTHEIM_STATE = 681, - SI_GLASTHEIM_ITEMDEF = 682, - SI_GLASTHEIM_HPSP = 683, - SI_HOMUN_SKILL_POSTDELAY = 684, - SI_ALMIGHTY = 685, - SI_GVG_GIANT = 686, - SI_GVG_GOLEM = 687, - SI_GVG_STUN = 688, - SI_GVG_STONE = 689, - SI_GVG_FREEZ = 690, - SI_GVG_SLEEP = 691, - SI_GVG_CURSE = 692, - SI_GVG_SILENCE = 693, - SI_GVG_BLIND = 694, - SI_CLIENT_ONLY_EQUIP_ARROW = 695, - SI_CLAN_INFO = 696, - SI_JP_EVENT01 = 697, - SI_JP_EVENT02 = 698, - SI_JP_EVENT03 = 699, - SI_JP_EVENT04 = 700, - SI_TELEPORT_FIXEDCASTINGDELAY = 701, - SI_GEFFEN_MAGIC1 = 702, - SI_GEFFEN_MAGIC2 = 703, - SI_GEFFEN_MAGIC3 = 704, - SI_QUEST_BUFF1 = 705, - SI_QUEST_BUFF2 = 706, - SI_QUEST_BUFF3 = 707, - SI_REUSE_LIMIT_RECALL = 708, - SI_SAVEPOSITION = 709, - SI_HANDICAPSTATE_ICEEXPLO = 710, - SI_FENRIR_CARD = 711, - SI_REUSE_LIMIT_ASPD_POTION = 712, - SI_MAXPAIN = 713, - SI_PC_STOP = 714, - SI_FRIGG_SONG = 715, - SI_OFFERTORIUM = 716, - SI_TELEKINESIS_INTENSE = 717, - SI_MOONSTAR = 718, - SI_STRANGELIGHTS = 719, - SI_FULL_THROTTLE = 720, - SI_REBOUND = 721, - SI_UNLIMIT = 722, - SI_KINGS_GRACE = 723, - SI_ITEM_ATKMAX = 724, - SI_ITEM_ATKMIN = 725, - SI_ITEM_MATKMAX = 726, - SI_ITEM_MATKMIN = 727, - SI_SUPER_STAR = 728, - SI_HIGH_RANKER = 729, - SI_DARKCROW = 730, - SI_2013_VALENTINE1 = 731, - SI_2013_VALENTINE2 = 732, - SI_2013_VALENTINE3 = 733, - SI_ILLUSIONDOPING = 734, - //SI_ = 735, - SI_CHILL = 736, - SI_BURNT = 737, - SI_FLASHCOMBO = 740, - SI_B_TRAP = 752, - SI_E_CHAIN = 753, - SI_E_QD_SHOT_READY = 754, - SI_C_MARKER = 755, - SI_H_MINE = 756, - SI_H_MINE_SPLASH = 757, - SI_P_ALTER = 758, - SI_HEAT_BARREL = 759, - SI_ANTI_M_BLAST = 760, - SI_SLUGSHOT = 761, - SI_SWORDCLAN = 762, - SI_ARCWANDCLAN = 763, - SI_GOLDENMACECLAN = 764, - SI_CROSSBOWCLAN = 765, - SI_PACKING_ENVELOPE1 = 766, - SI_PACKING_ENVELOPE2 = 767, - SI_PACKING_ENVELOPE3 = 768, - SI_PACKING_ENVELOPE4 = 769, - SI_PACKING_ENVELOPE5 = 770, - SI_PACKING_ENVELOPE6 = 771, - SI_PACKING_ENVELOPE7 = 772, - SI_PACKING_ENVELOPE8 = 773, - SI_PACKING_ENVELOPE9 = 774, - SI_PACKING_ENVELOPE10 = 775, - SI_GLASTHEIM_TRANS = 776, - SI_HEAT_BARREL_AFTER = 778, - SI_DECORATION_OF_MUSIC = 779, + SI_UNKNOWN_NAME = 672, + SI_ON_PUSH_CART = 673, + SI_HAT_EFFECT = 674, + SI_FLOWER_LEAF = 675, + SI_RAY_OF_PROTECTION = 676, + SI_GLASTHEIM_ATK = 677, + SI_GLASTHEIM_DEF = 678, + SI_GLASTHEIM_HEAL = 679, + SI_GLASTHEIM_HIDDEN = 680, + SI_GLASTHEIM_STATE = 681, + SI_GLASTHEIM_ITEMDEF = 682, + SI_GLASTHEIM_HPSP = 683, + SI_HOMUN_SKILL_POSTDELAY = 684, + SI_ALMIGHTY = 685, + SI_GVG_GIANT = 686, + SI_GVG_GOLEM = 687, + SI_GVG_STUN = 688, + SI_GVG_STONE = 689, + SI_GVG_FREEZ = 690, + SI_GVG_SLEEP = 691, + SI_GVG_CURSE = 692, + SI_GVG_SILENCE = 693, + SI_GVG_BLIND = 694, + SI_CLIENT_ONLY_EQUIP_ARROW = 695, + SI_CLAN_INFO = 696, + SI_JP_EVENT01 = 697, + SI_JP_EVENT02 = 698, + SI_JP_EVENT03 = 699, + + SI_JP_EVENT04 = 700, + SI_TELEPORT_FIXEDCASTINGDELAY = 701, + SI_GEFFEN_MAGIC1 = 702, + SI_GEFFEN_MAGIC2 = 703, + SI_GEFFEN_MAGIC3 = 704, + SI_QUEST_BUFF1 = 705, + SI_QUEST_BUFF2 = 706, + SI_QUEST_BUFF3 = 707, + SI_REUSE_LIMIT_RECALL = 708, + SI_SAVEPOSITION = 709, + SI_HANDICAPSTATE_ICEEXPLO = 710, + SI_FENRIR_CARD = 711, + SI_REUSE_LIMIT_ASPD_POTION = 712, + SI_MAXPAIN = 713, + SI_PC_STOP = 714, + SI_FRIGG_SONG = 715, + SI_OFFERTORIUM = 716, + SI_TELEKINESIS_INTENSE = 717, + SI_MOONSTAR = 718, + SI_STRANGELIGHTS = 719, + SI_FULL_THROTTLE = 720, + SI_REBOUND = 721, + SI_UNLIMIT = 722, + SI_KINGS_GRACE = 723, + SI_ITEM_ATKMAX = 724, + SI_ITEM_ATKMIN = 725, + SI_ITEM_MATKMAX = 726, + SI_ITEM_MATKMIN = 727, + SI_SUPER_STAR = 728, + SI_HIGH_RANKER = 729, + SI_DARKCROW = 730, + SI_2013_VALENTINE1 = 731, + SI_2013_VALENTINE2 = 732, + SI_2013_VALENTINE3 = 733, + SI_ILLUSIONDOPING = 734, + //SI_ = 735, + SI_CHILL = 736, + SI_BURNT = 737, + //... + SI_FLASHCOMBO = 740, + + //... + SI_B_TRAP = 752, + SI_E_CHAIN = 753, + SI_E_QD_SHOT_READY = 754, + SI_C_MARKER = 755, + SI_H_MINE = 756, + SI_H_MINE_SPLASH = 757, + SI_P_ALTER = 758, + SI_HEAT_BARREL = 759, + SI_ANTI_M_BLAST = 760, + SI_SLUGSHOT = 761, + SI_SWORDCLAN = 762, + SI_ARCWANDCLAN = 763, + SI_GOLDENMACECLAN = 764, + SI_CROSSBOWCLAN = 765, + SI_PACKING_ENVELOPE1 = 766, + SI_PACKING_ENVELOPE2 = 767, + SI_PACKING_ENVELOPE3 = 768, + SI_PACKING_ENVELOPE4 = 769, + SI_PACKING_ENVELOPE5 = 770, + SI_PACKING_ENVELOPE6 = 771, + SI_PACKING_ENVELOPE7 = 772, + SI_PACKING_ENVELOPE8 = 773, + SI_PACKING_ENVELOPE9 = 774, + SI_PACKING_ENVELOPE10 = 775, + SI_GLASTHEIM_TRANS = 776, + //... + SI_HEAT_BARREL_AFTER = 778, + SI_DECORATION_OF_MUSIC = 779, + SI_MAX, }; // JOINTBEAT stackable ailments @@ -1698,7 +1719,7 @@ struct status_data { speed, amotion, adelay, dmotion, mode; - short + short hit, flee, cri, flee2, def2, mdef2, #ifdef RENEWAL_ASPD @@ -1867,7 +1888,7 @@ struct s_refine_info { }; /*===================================== -* Interface : status.h +* Interface : status.h * Generated by HerculesInterfaceMaker * created by Susu *-------------------------------------*/ diff --git a/src/map/unit.c b/src/map/unit.c index 0ad770e80..e22d6f697 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1180,8 +1180,8 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui if( (skill->get_inf2(skill_id)&INF2_ENSEMBLE_SKILL) && skill->check_pc_partner(sd, skill_id, &skill_lv, 1, 0) < 1 ) { clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); - return 0; - } + return 0; + } switch(skill_id){ case SA_CASTCANCEL: @@ -1371,7 +1371,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui // in official this is triggered even if no cast time. clif->skillcasting(src, src->id, target_id, 0,0, skill_id, skill->get_ele(skill_id, skill_lv), casttime); if( casttime > 0 || temp ) - { + { if (sd && target->type == BL_MOB) { TBL_MOB *md = (TBL_MOB*)target; @@ -1555,7 +1555,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui if( casttime > 0 ) { ud->skilltimer = timer->add( tick+casttime, skill->castend_pos, src->id, 0 ); if( (sd && pc->checkskill(sd,SA_FREECAST) > 0) || skill_id == LG_EXEEDBREAK) - status_calc_bl(&sd->bl, SCB_SPEED); + status_calc_bl(&sd->bl, SCB_SPEED); } else { ud->skilltimer = INVALID_TIMER; skill->castend_pos(ud->skilltimer,tick,src->id,0); diff --git a/src/map/vending.c b/src/map/vending.c index c8ac814db..7e9393bf2 100644 --- a/src/map/vending.c +++ b/src/map/vending.c @@ -60,7 +60,7 @@ void vending_vendinglistreq(struct map_session_data* sd, unsigned int id) { // GM is not allowed to trade clif->message(sd->fd, msg_txt(246)); return; - } + } sd->vended_id = vsd->vender_id; // register vending uid diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index 46d654e0d..b8f21407e 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -198,7 +198,7 @@ HPExport void server_preinit (void) { libconfig = GET_SYMBOL("libconfig"); - addArg("--db2sql",false,db2sql_arg,NULL); + addArg("--db2sql",false,db2sql_arg,NULL); } HPExport void plugin_init (void) { addCPCommand("server:tools:db2sql",db2sql); diff --git a/src/plugins/dbghelpplug.c b/src/plugins/dbghelpplug.c index 32b30d69a..0f1690f4b 100644 --- a/src/plugins/dbghelpplug.c +++ b/src/plugins/dbghelpplug.c @@ -17,7 +17,7 @@ HPExport struct hplugin_info pinfo = { #ifdef _WIN32 ///////////////////////////////////////////////////////////////////// -// Include files +// Include files // #include @@ -32,13 +32,12 @@ HPExport struct hplugin_info pinfo = { #include ///////////////////////////////////////////////////////////////////// -// Types from Cvconst.h (DIA SDK) +// Types from Cvconst.h (DIA SDK) // #ifdef _NO_CVCONST_H -typedef enum _BasicType -{ +typedef enum _BasicType { btNoType = 0, btVoid = 1, btChar = 2, @@ -66,7 +65,7 @@ typedef enum _UdtKind UdtUnion } UdtKind; /* -typedef enum _SymTag { +typedef enum _SymTag { SymTagNull = 0, SymTagExe = 1, SymTagCompiland = 2, @@ -235,7 +234,7 @@ SYMGETMODULEBASE SymGetModuleBase_ = NULL; ///////////////////////////////////////////////////////////////////// // Code -/// Writes the minidump to file. The callback function will at the +/// Writes the minidump to file. The callback function will at the /// same time write the list of modules to the log file. /// /// @param file Filename of the minidump @@ -324,7 +323,7 @@ Dhp__PrintModuleInfoCallback( return TRUE; } -/// Prints details about the current process, platform and exception +/// Prints details about the current process, platform and exception /// information to the log file. /// /// @param exception Exception info @@ -418,7 +417,7 @@ Dhp__PrintProcessInfo( { fprintf(log_file, "eip=%08x esp=%08x ebp=%08x iopl=%1x %s %s %s %s %s %s %s %s %s %s\n", - context->Eip, context->Esp, context->Ebp, + context->Eip, context->Esp, context->Ebp, (context->EFlags >> 12) & 3, // IOPL level value context->EFlags & 0x00100000 ? "vip" : " ", // VIP (virtual interrupt pending) context->EFlags & 0x00080000 ? "vif" : " ", // VIF (virtual interrupt flag) @@ -487,7 +486,7 @@ Dhp__PrintTypeName( switch( symtag ) { case SymTagEnum: - { + { WCHAR* pwszTypeName; if( SymGetTypeInfo_(hProcess, modBase, typeIndex, TI_GET_SYMNAME, &pwszTypeName) ) @@ -1007,7 +1006,7 @@ Dhp__PrintDataValue( fprintf(log_file, "0x%p", *(void**)pVariable); if( SymGetTypeInfo_(hProcess, modBase, typeIndex, TI_GET_TYPE, &childTypeIndex) && - SymGetTypeInfo_(hProcess, modBase, childTypeIndex, TI_GET_SYMTAG, &childSymtag) && + SymGetTypeInfo_(hProcess, modBase, childTypeIndex, TI_GET_SYMTAG, &childSymtag) && childSymtag != SymTagPointerType ) { DWORD childBasetype; @@ -1277,9 +1276,9 @@ Dhp__PrintSymbolInfo( assert( pSymInfo != NULL ); assert( pInterData != NULL ); - switch( pSymInfo->Tag ) + switch( pSymInfo->Tag ) { - case SymTagData: Dhp__PrintDataInfo( pSymInfo, pInterData ); break; + case SymTagData: Dhp__PrintDataInfo( pSymInfo, pInterData ); break; default: /*fprintf(pInterData->log_file, "", pSymInfo->Tag);*/ break; } } diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c index 878ee8bab..0c0e3e2ae 100644 --- a/src/test/test_spinlock.c +++ b/src/test/test_spinlock.c @@ -8,13 +8,13 @@ #include #include -// -// Simple test for the spinlock implementation to see if it works properly.. +// +// Simple test for the spinlock implementation to see if it works properly.. // -#define THRC 32 //thread Count +#define THRC 32 //thread Count #define PERINC 100000 #define LOOPS 47 @@ -66,7 +66,7 @@ int do_init(int argc, char **argv){ while(1){ - if(InterlockedCompareExchange(&done_threads, THRC, THRC) == THRC) + if(InterlockedCompareExchange(&done_threads, THRC, THRC) == THRC) break; rathread_yield(); @@ -86,7 +86,7 @@ int do_init(int argc, char **argv){ if(ok != LOOPS){ - ShowFatalError("Test failed.\n"); + ShowFatalError("Test failed.\n"); exit(1); }else{ ShowStatus("Test passed.\n"); @@ -103,11 +103,12 @@ void do_abort(){ void set_server_type(){ - SERVER_TYPE = ATHENA_SERVER_NONE; + SERVER_TYPE = SERVER_TYPE_UNKNOWN; }//end: set_server_type() -void do_final(){ +int do_final(){ + return EXIT_SUCCESS; }//end: do_final() -- cgit v1.2.3-70-g09d2 From bc1d286cc71a7ae82d9639f4a832970a287c0d71 Mon Sep 17 00:00:00 2001 From: Haru Date: Fri, 16 May 2014 17:34:16 +0200 Subject: Follow-up to b6b3f58795288701d0e162d43fa6f0a47af913b3 - Includes in some files weren't sorted alphabetically. Special thanks to KeiKun. Signed-off-by: Haru --- src/common/core.c | 9 ++++---- src/common/mutex.c | 3 ++- src/common/random.c | 1 + src/common/thread.c | 8 ++++---- src/map/atcommand.c | 2 +- src/map/battleground.c | 2 +- src/map/map.h | 4 ++-- src/map/script.c | 2 +- src/map/script.h | 2 +- src/plugins/HPMHooking.c | 53 ++++++++++++++++++++++++------------------------ src/plugins/db2sql.c | 20 ++++++++++-------- src/plugins/sample.c | 10 ++++----- 12 files changed, 60 insertions(+), 56 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/common/core.c b/src/common/core.c index 85f824866..d74e5a451 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -7,6 +7,11 @@ #include "../config/core.h" #include "core.h" +#include +#include +#include +#include + #include "../common/cbasetypes.h" #include "../common/console.h" #include "../common/malloc.h" @@ -28,10 +33,6 @@ # include "../common/utils.h" #endif -#include -#include -#include -#include #ifndef _WIN32 # include #else diff --git a/src/common/mutex.c b/src/common/mutex.c index 1de707e95..626dfa2e1 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -5,6 +5,8 @@ #include "mutex.h" +#include "../common/cbasetypes.h" // for WIN32 + #ifdef WIN32 #include "../common/winapi.h" #else @@ -13,7 +15,6 @@ #include #endif -#include "../common/cbasetypes.h" #include "../common/malloc.h" #include "../common/showmsg.h" #include "../common/timer.h" diff --git a/src/common/random.c b/src/common/random.c index 7019a31f3..88d5748cf 100644 --- a/src/common/random.c +++ b/src/common/random.c @@ -9,6 +9,7 @@ #include // init_genrand, genrand_int32, genrand_res53 +#include "../common/cbasetypes.h" // for WIN32 #include "../common/showmsg.h" #include "../common/timer.h" // gettick diff --git a/src/common/thread.c b/src/common/thread.c index bba56e7eb..91360537f 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -19,12 +19,12 @@ # define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) # define __thread __declspec( thread ) #else -# include -# include -# include -# include # include # include +# include +# include +# include +# include #endif // When Compiling using MSC (on win32..) we know we have support in any case! diff --git a/src/map/atcommand.c b/src/map/atcommand.c index 96fa9c350..4a183ded4 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -12,6 +12,7 @@ #include #include +#include "HPMmap.h" #include "battle.h" #include "chat.h" #include "chrif.h" @@ -54,7 +55,6 @@ #include "../common/sysinfo.h" #include "../common/timer.h" #include "../common/utils.h" -#include "HPMmap.h" struct atcommand_interface atcommand_s; diff --git a/src/map/battleground.c b/src/map/battleground.c index a7169de0e..4558f32c3 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -6,8 +6,8 @@ #include "battleground.h" -#include #include +#include #include "battle.h" #include "clif.h" diff --git a/src/map/map.h b/src/map/map.h index 099370b7a..3ce59a804 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -10,9 +10,9 @@ #include "atcommand.h" #include "../common/cbasetypes.h" #include "../common/core.h" // CORE_ST_LAST -#include "../common/mmo.h" -#include "../common/mapindex.h" #include "../common/db.h" +#include "../common/mapindex.h" +#include "../common/mmo.h" #include "../common/sql.h" struct mob_data; diff --git a/src/map/script.c b/src/map/script.c index b432e6720..404079126 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "atcommand.h" #include "battle.h" @@ -58,7 +59,6 @@ #ifndef WIN32 #include #endif -#include static inline int GETVALUE(const unsigned char* buf, int i) { return (int)MakeDWord(MakeWord(buf[i], buf[i+1]), MakeWord(buf[i+2], 0)); diff --git a/src/map/script.h b/src/map/script.h index 899c745da..bb6cd6e11 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -5,8 +5,8 @@ #ifndef _MAP_SCRIPT_H_ #define _MAP_SCRIPT_H_ -#include #include +#include #include "map.h" //EVENT_NAME_LENGTH #include "../common/cbasetypes.h" diff --git a/src/plugins/HPMHooking.c b/src/plugins/HPMHooking.c index e6e698383..46792b268 100644 --- a/src/plugins/HPMHooking.c +++ b/src/plugins/HPMHooking.c @@ -3,48 +3,47 @@ // Sample Hercules Plugin #include -#include #include +#include #include "../common/HPMi.h" +#include "../common/db.h" +#include "../common/malloc.h" #include "../common/mmo.h" #include "../common/socket.h" -#include "../common/malloc.h" -#include "../common/db.h" - -#include "../map/map.h" -#include "../map/path.h" +#include "../map/atcommand.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/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/mob.h" -#include "../map/npc.h" -#include "../map/chat.h" -#include "../map/itemdb.h" #include "../map/storage.h" -#include "../map/skill.h" #include "../map/trade.h" -#include "../map/party.h" #include "../map/unit.h" -#include "../map/battle.h" -#include "../map/battleground.h" -#include "../map/quest.h" -#include "../map/script.h" -#include "../map/mapreg.h" -#include "../map/guild.h" -#include "../map/pet.h" -#include "../map/homunculus.h" -#include "../map/instance.h" -#include "../map/mercenary.h" -#include "../map/elemental.h" -#include "../map/atcommand.h" -#include "../map/log.h" -#include "../map/mail.h" -#include "../map/irc-bot.h" #include "../common/HPMDataCheck.h" diff --git a/src/plugins/db2sql.c b/src/plugins/db2sql.c index b8f21407e..1e9cb1a5a 100644 --- a/src/plugins/db2sql.c +++ b/src/plugins/db2sql.c @@ -1,20 +1,22 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#include "../common/cbasetypes.h" -#include "../common/strlib.h" -#include "../common/timer.h" +#include "../config/core.h" + +#include +#include + #include "../common/HPMi.h" +#include "../common/cbasetypes.h" +#include "../common/conf.h" #include "../common/malloc.h" #include "../common/mmo.h" -#include "../common/conf.h" -#include "../config/core.h" +#include "../common/strlib.h" +#include "../common/timer.h" #include "../map/clif.h" -#include "../map/pc.h" -#include "../map/map.h" #include "../map/itemdb.h" -#include -#include +#include "../map/map.h" +#include "../map/pc.h" #include "../common/HPMDataCheck.h" diff --git a/src/plugins/sample.c b/src/plugins/sample.c index 819aae08c..84df88e06 100644 --- a/src/plugins/sample.c +++ b/src/plugins/sample.c @@ -3,17 +3,17 @@ // Sample Hercules Plugin #include -#include #include +#include #include "../common/HPMi.h" +#include "../common/malloc.h" #include "../common/mmo.h" #include "../common/socket.h" -#include "../common/malloc.h" -#include "../map/script.h" -#include "../map/pc.h" -#include "../map/clif.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) */ -- cgit v1.2.3-70-g09d2 From 0a4975ed611db7d1bcfe501008085e420e743128 Mon Sep 17 00:00:00 2001 From: Shido Date: Fri, 30 May 2014 10:37:54 +0800 Subject: Fixed typos inside src/ --- src/char/char.c | 50 ++++++------- src/char/int_auction.c | 2 +- src/char/int_guild.c | 10 +-- src/char/int_homun.c | 4 +- src/char/int_party.c | 4 +- src/char/int_quest.c | 2 +- src/char/inter.c | 18 ++--- src/char/pincode.c | 2 +- src/common/HPM.c | 4 +- src/common/HPM.h | 2 +- src/common/atomic.h | 6 +- src/common/conf.h | 2 +- src/common/db.c | 14 ++-- src/common/db.h | 6 +- src/common/ers.c | 8 +- src/common/ers.h | 14 ++-- src/common/grfio.c | 10 +-- src/common/malloc.c | 4 +- src/common/mapindex.c | 2 +- src/common/mmo.h | 4 +- src/common/mutex.h | 16 ++-- src/common/showmsg.c | 6 +- src/common/showmsg.h | 4 +- src/common/socket.c | 14 ++-- src/common/spinlock.h | 2 +- src/common/sql.c | 10 +-- src/common/sql.h | 6 +- src/common/strlib.c | 32 ++++---- src/common/strlib.h | 10 +-- src/common/sysinfo.c | 4 +- src/common/thread.c | 14 ++-- src/common/thread.h | 16 ++-- src/common/timer.c | 6 +- src/common/utils.c | 6 +- src/config/core.h | 4 +- src/config/secure.h | 2 +- src/login/account.h | 2 +- src/login/account_sql.c | 2 +- src/login/login.c | 16 ++-- src/login/login.h | 2 +- src/login/loginlog_sql.c | 2 +- src/map/atcommand.c | 66 ++++++++--------- src/map/battle.c | 66 ++++++++--------- src/map/battle.h | 6 +- src/map/battleground.c | 4 +- src/map/chat.c | 2 +- src/map/chrif.c | 22 +++--- src/map/chrif.h | 2 +- src/map/clif.c | 96 ++++++++++++------------ src/map/clif.h | 2 +- src/map/elemental.c | 4 +- src/map/guild.c | 8 +- src/map/homunculus.c | 4 +- src/map/intif.c | 10 +-- src/map/itemdb.c | 2 +- src/map/map.c | 26 +++---- src/map/map.h | 8 +- src/map/mob.c | 24 +++--- src/map/mob.h | 6 +- src/map/npc.c | 10 +-- src/map/npc_chat.c | 12 +-- src/map/party.c | 4 +- src/map/script.c | 2 +- src/map/skill.c | 188 ++++++++++++++++++++++++----------------------- src/map/status.c | 24 +++--- src/map/status.h | 2 +- src/map/storage.c | 10 +-- src/map/trade.c | 12 +-- src/map/unit.c | 22 +++--- src/map/vending.h | 4 +- 70 files changed, 497 insertions(+), 495 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/char/char.c b/src/char/char.c index 57031e3ee..fe17fd14f 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -118,7 +118,7 @@ bool char_new = true; int char_new_display = 0; bool name_ignoring_case = false; // Allow or not identical name for characters but with a different case by [Yor] -int char_name_option = 0; // Option to know which letters/symbols are authorised in the name of a character (0: all, 1: only those in char_name_letters, 2: all EXCEPT those in char_name_letters) by [Yor] +int char_name_option = 0; // Option to know which letters/symbols are authorized in the name of a character (0: all, 1: only those in char_name_letters, 2: all EXCEPT those in char_name_letters) by [Yor] char unknown_char_name[NAME_LENGTH] = "Unknown"; // Name to use when the requested name cannot be determined #define TRIM_CHARS "\255\xA0\032\t\x0A\x0D " //The following characters are trimmed regardless because they cause confusion and problems on the servers. [Skotlex] char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) in a character name. by [Yor] @@ -126,8 +126,8 @@ char char_name_letters[1024] = ""; // list of letters/symbols allowed (or not) i int char_del_level = 0; //From which level u can delete character [Lupus] int char_del_delay = 86400; -int log_char = 1; // loggin char or not [devil] -int log_inter = 1; // loggin inter or not [devil] +int log_char = 1; // logging char or not [devil] +int log_inter = 1; // logging inter or not [devil] int char_aegis_delete = 0; // Verify if char is in guild/party or char and reacts as Aegis does (doesn't allow deletion), see char_delete2_req for more information @@ -1387,7 +1387,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything if( SQL_SUCCESS == SQL->StmtNextRow(stmt) ) strcat(t_msg, " accdata"); - if (save_log) ShowInfo("Loaded char (%d - %s): %s\n", char_id, p->name, t_msg); //ok. all data load successfuly! + if (save_log) ShowInfo("Loaded char (%d - %s): %s\n", char_id, p->name, t_msg); //ok. all data load successfully! SQL->StmtFree(stmt); StrBuf->Destroy(&buf); @@ -1413,7 +1413,7 @@ int mmo_char_sql_init(void) //and send the loginserver the new state.... // Force all users offline in sql when starting char-server - // (useful when servers crashs and don't clean the database) + // (useful when servers crashes and don't clean the database) set_all_offline_sql(); return 0; @@ -1468,7 +1468,7 @@ bool char_slotchange(struct char_session_data *sd, int fd, unsigned short from, } //----------------------------------- -// Function to change chararcter's names +// Function to change character's names //----------------------------------- int rename_char_sql(struct char_session_data *sd, int char_id) { @@ -1540,9 +1540,9 @@ int check_char_name(char * name, char * esc_name) if( strcmpi(name, wisp_server_name) == 0 ) return -1; // nick reserved for internal server messages - // Check Authorised letters/symbols in the name of the character + // Check Authorized letters/symbols in the name of the character if( char_name_option == 1 ) - { // only letters/symbols in char_name_letters are authorised + { // only letters/symbols in char_name_letters are authorized for( i = 0; i < NAME_LENGTH && name[i]; i++ ) if( strchr(char_name_letters, name[i]) == NULL ) return -2; @@ -1576,7 +1576,7 @@ int check_char_name(char * name, char * esc_name) * -1: 'Charname already exists' * -2: 'Char creation denied'/ Unknown error * -3: 'You are underaged' - * -4: 'You are not elegible to open the Character Slot.' + * -4: 'You are not eligible to open the Character Slot.' * -5: 'Symbols in Character Names are forbidden' * char_id: Success **/ @@ -2202,7 +2202,7 @@ void mapif_server_reset(int id); void loginif_reset(void) { int id; - // TODO kick everyone out and reset everything or wait for connect and try to reaquire locks [FlavioJS] + // TODO kick everyone out and reset everything or wait for connect and try to reacquire locks [FlavioJS] for( id = 0; id < ARRAYLENGTH(server); ++id ) mapif_server_reset(id); flush_fifos(); @@ -2286,7 +2286,7 @@ int parse_fromlogin(int fd) { switch( command ) { - // acknowledgement of connect-to-loginserver request + // acknowledgment of connect-to-loginserver request case 0x2711: if (RFIFOREST(fd) < 3) return 0; @@ -2306,7 +2306,7 @@ int parse_fromlogin(int fd) { RFIFOSKIP(fd,3); break; - // acknowledgement of account authentication request + // acknowledgment of account authentication request case 0x2713: if (RFIFOREST(fd) < 33) return 0; @@ -2526,7 +2526,7 @@ int parse_fromlogin(int fd) { unsigned char buf[11]; WBUFW(buf,0) = 0x2b14; WBUFL(buf,2) = RFIFOL(fd,2); - WBUFB(buf,6) = RFIFOB(fd,6); // 0: change of statut, 1: ban + WBUFB(buf,6) = RFIFOB(fd,6); // 0: change of status, 1: ban WBUFL(buf,7) = RFIFOL(fd,7); // status or final date of a banishment mapif_sendall(buf, 11); } @@ -3161,7 +3161,7 @@ int parse_frommap(int fd) memcpy(&char_dat, RFIFOP(fd,13), sizeof(struct mmo_charstatus)); mmo_char_tosql(cid, &char_dat); } else { //This may be valid on char-server reconnection, when re-sending characters that already logged off. - ShowError("parse_from_map (save-char): Received data for non-existant/offline character (%d:%d).\n", aid, cid); + ShowError("parse_from_map (save-char): Received data for non-existing/offline character (%d:%d).\n", aid, cid); set_char_online(id, cid, aid); } @@ -4174,7 +4174,7 @@ int parse_char(int fd) ShowInfo("request connect - account_id:%d/login_id1:%d/login_id2:%d\n", account_id, login_id1, login_id2); if (sd) { - //Received again auth packet for already authentified account?? Discard it. + //Received again auth packet for already authenticated account?? Discard it. //TODO: Perhaps log this as a hack attempt? //TODO: and perhaps send back a reply? break; @@ -4201,7 +4201,7 @@ int parse_char(int fd) break; } - // search authentification + // search authentication node = (struct auth_node*)idb_get(auth_db, account_id); if( node != NULL && node->account_id == account_id && @@ -4232,7 +4232,7 @@ int parse_char(int fd) {// authentication not found (coming from login server) if (login_fd > 0) { // don't send request if no login-server WFIFOHEAD(login_fd,23); - WFIFOW(login_fd,0) = 0x2712; // ask login-server to authentify an account + WFIFOW(login_fd,0) = 0x2712; // ask login-server to authenticate an account WFIFOL(login_fd,2) = sd->account_id; WFIFOL(login_fd,6) = sd->login_id1; WFIFOL(login_fd,10) = sd->login_id2; @@ -4317,7 +4317,7 @@ int parse_char(int fd) break; } - /* set char as online prior to loading its data so 3rd party applications will realise the sql data is not reliable */ + /* set char as online prior to loading its data so 3rd party applications will realize the sql data is not reliable */ set_char_online(-2,char_id,sd->account_id); if( !mmo_char_fromsql(char_id, &char_dat, true) ) { /* failed? set it back offline */ set_char_offline(char_id, sd->account_id); @@ -4459,13 +4459,13 @@ int parse_char(int fd) WFIFOW(fd,0) = 0x6e; /* Others I found [Ind] */ /* 0x02 = Symbols in Character Names are forbidden */ - /* 0x03 = You are not elegible to open the Character Slot. */ + /* 0x03 = You are not eligible to open the Character Slot. */ /* 0x0B = This service is only available for premium users. */ switch (result) { case -1: WFIFOB(fd,2) = 0x00; break; // 'Charname already exists' case -2: WFIFOB(fd,2) = 0xFF; break; // 'Char creation denied' case -3: WFIFOB(fd,2) = 0x01; break; // 'You are underaged' - case -4: WFIFOB(fd,2) = 0x03; break; // 'You are not elegible to open the Character Slot.' + case -4: WFIFOB(fd,2) = 0x03; break; // 'You are not eligible to open the Character Slot.' case -5: WFIFOB(fd,2) = 0x02; break; // 'Symbols in Character Names are forbidden' default: @@ -4641,7 +4641,7 @@ int parse_char(int fd) //Confirm change name. // 0x28f .L case 0x28f: - // 0: Sucessfull + // 0: Successful // 1: This character's name has already been changed. You cannot change a character's name more than once. // 2: User information is not correct. // 3: You have failed to change this character's name. @@ -4746,7 +4746,7 @@ int parse_char(int fd) RFIFOSKIP(fd,60); } - return 0; // avoid processing of followup packets here + return 0; // avoid processing of follow-up packets here // checks the entered pin case 0x8b8: @@ -5006,8 +5006,8 @@ static int online_data_cleanup(int tid, int64 tick, int id, intptr_t data) { } //---------------------------------- -// Reading Lan Support configuration -// Rewrote: Anvanced subnet check [LuzZza] +// Reading LAN Support configuration +// Rewrote: Advanced subnet check [LuzZza] //---------------------------------- int char_lan_config_read(const char *lancfgName) { @@ -5479,7 +5479,7 @@ int do_init(int argc, char **argv) { timer->add_func_list(online_data_cleanup, "online_data_cleanup"); timer->add_interval(timer->gettick() + 1000, online_data_cleanup, 0, 0, 600 * 1000); - //Cleaning the tables for NULL entrys @ startup [Sirius] + //Cleaning the tables for NULL entries @ startup [Sirius] //Chardb clean if( SQL_ERROR == SQL->Query(sql_handle, "DELETE FROM `%s` WHERE `account_id` = '0'", char_db) ) Sql_ShowDebug(sql_handle); diff --git a/src/char/int_auction.c b/src/char/int_auction.c index d246e9851..8cd870647 100644 --- a/src/char/int_auction.c +++ b/src/char/int_auction.c @@ -230,7 +230,7 @@ void inter_auctions_fromsql(void) if( auction->timestamp > now ) endtick = ((int64)(auction->timestamp - now) * 1000) + tick; else - endtick = tick + 10000; // 10 Second's to process ended auctions + endtick = tick + 10000; // 10 seconds to process ended auctions auction->auction_end_timer = timer->add(endtick, auction_end_timer, auction->auction_id, 0); idb_put(auction_db_, auction->auction_id, auction); diff --git a/src/char/int_guild.c b/src/char/int_guild.c index ffbe48e10..a6fcfe48c 100644 --- a/src/char/int_guild.c +++ b/src/char/int_guild.c @@ -117,7 +117,7 @@ int inter_guild_tosql(struct guild *g,int flag) // GS_EXPULSION `guild_expulsion` (`guild_id`,`account_id`,`name`,`mes`) // GS_SKILL `guild_skill` (`guild_id`,`id`,`lv`) - // temporary storage for str convertion. They must be twice the size of the + // temporary storage for str conversion. They must be twice the size of the // original string to ensure no overflows will occur. [Skotlex] char t_info[256]; char esc_name[NAME_LENGTH*2+1]; @@ -836,7 +836,7 @@ int guild_calcinfo(struct guild *g) // Save next exp step g->next_exp = nextexp; - // Set the max number of members, Guild Extention skill - currently adds 6 to max per skill lv. + // Set the max number of members, Guild Extension skill - currently adds 6 to max per skill lv. g->max_member = 16 + guild_checkskill(g, GD_EXTENSION) * 6; if(g->max_member > MAX_GUILD) { @@ -1142,8 +1142,8 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member mapif_guild_created(fd,account_id,NULL); return 0; } - // Check Authorised letters/symbols in the name of the character - if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorised + // Check Authorized letters/symbols in the name of the character + if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorized for (i = 0; i < NAME_LENGTH && name[i]; i++) if (strchr(char_name_letters, name[i]) == NULL) { mapif_guild_created(fd,account_id,NULL); @@ -1212,7 +1212,7 @@ int mapif_parse_CreateGuild(int fd,int account_id,char *name,struct guild_member // Return guild info to client int mapif_parse_GuildInfo(int fd,int guild_id) { - struct guild * g = inter_guild_fromsql(guild_id); //We use this because on start-up the info of castle-owned guilds is requied. [Skotlex] + struct guild * g = inter_guild_fromsql(guild_id); //We use this because on start-up the info of castle-owned guilds is required. [Skotlex] if(g) { if (!guild_calcinfo(g)) diff --git a/src/char/int_homun.c b/src/char/int_homun.c index 795a6b927..acde9eb38 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -248,9 +248,9 @@ bool mapif_homunculus_rename(char *name) { int i; - // Check Authorised letters/symbols in the name of the homun + // Check Authorized letters/symbols in the name of the homun if( char_name_option == 1 ) - {// only letters/symbols in char_name_letters are authorised + {// only letters/symbols in char_name_letters are authorized for( i = 0; i < NAME_LENGTH && name[i]; i++ ) if( strchr(char_name_letters, name[i]) == NULL ) return false; diff --git a/src/char/int_party.c b/src/char/int_party.c index 5dd64a32b..a8722fbe3 100644 --- a/src/char/int_party.c +++ b/src/char/int_party.c @@ -475,8 +475,8 @@ int mapif_parse_CreateParty(int fd, char *name, int item, int item2, struct part mapif_party_created(fd,leader->account_id,leader->char_id,NULL); return 0; } - // Check Authorised letters/symbols in the name of the character - if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorised + // Check Authorized letters/symbols in the name of the character + if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorized for (i = 0; i < NAME_LENGTH && name[i]; i++) if (strchr(char_name_letters, name[i]) == NULL) { if( name[i] == '"' ) { /* client-special-char */ diff --git a/src/char/int_quest.c b/src/char/int_quest.c index 61b43c57d..d4155b0d6 100644 --- a/src/char/int_quest.c +++ b/src/char/int_quest.c @@ -197,7 +197,7 @@ int mapif_parse_quest_save(int fd) { if (j < old_n) { // Update existing quests - // Only states and counts are changable. + // Only states and counts are changeable. ARR_FIND( 0, MAX_QUEST_OBJECTIVES, k, new_qd[i].count[k] != old_qd[j].count[k] ); if (k != MAX_QUEST_OBJECTIVES || new_qd[i].state != old_qd[j].state) success &= mapif_quest_update(char_id, new_qd[i]); diff --git a/src/char/inter.c b/src/char/inter.c index 972407ef3..c2d8de37a 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -589,7 +589,7 @@ void mapif_parse_accinfo(int fd) { inter_msg_to_fd(fd, u_fd, aid, "No matches were found for your criteria, '%s'",query); } else { Sql_ShowDebug(sql_handle); - inter_msg_to_fd(fd, u_fd, aid, "An error occured, bother your admin about it."); + inter_msg_to_fd(fd, u_fd, aid, "An error occurred, bother your admin about it."); } SQL->FreeResult(sql_handle); return; @@ -658,7 +658,7 @@ void mapif_parse_accinfo2(bool success, int map_fd, int u_fd, int u_aid, int acc if (SQL->NumRows(sql_handle) == 0) { inter_msg_to_fd(map_fd, u_fd, u_aid, "This account doesn't have characters."); } else { - inter_msg_to_fd(map_fd, u_fd, u_aid, "An error occured, bother your admin about it."); + inter_msg_to_fd(map_fd, u_fd, u_aid, "An error occurred, bother your admin about it."); Sql_ShowDebug(sql_handle); } } else { @@ -1165,7 +1165,7 @@ int check_ttl_wisdata(void) struct WisData *wd = (struct WisData*)idb_get(wis_db, wis_dellist[i]); ShowWarning("inter: wis data id=%d time out : from %s to %s\n", wd->id, wd->src, wd->dst); // removed. not send information after a timeout. Just no answer for the player - //mapif_wis_end(wd, 1); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target + //mapif_wis_end(wd, 1); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target idb_remove(wis_db, wd->id); } } while(wis_delnum >= WISDELLIST_MAX); @@ -1199,7 +1199,7 @@ int mapif_parse_WisRequest(int fd) if (RFIFOW(fd,2)-52 >= sizeof(wd->msg)) { ShowWarning("inter: Wis message size too long.\n"); return 0; - } else if (RFIFOW(fd,2)-52 <= 0) { // normaly, impossible, but who knows... + } else if (RFIFOW(fd,2)-52 <= 0) { // normally, impossible, but who knows... ShowError("inter: Wis message doesn't exist.\n"); return 0; } @@ -1216,7 +1216,7 @@ int mapif_parse_WisRequest(int fd) unsigned char buf[27]; WBUFW(buf, 0) = 0x3802; memcpy(WBUFP(buf, 2), RFIFOP(fd, 4), NAME_LENGTH); - WBUFB(buf,26) = 1; // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target + WBUFB(buf,26) = 1; // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target mapif_send(fd, buf, 27); } else @@ -1231,7 +1231,7 @@ int mapif_parse_WisRequest(int fd) uint8 buf[27]; WBUFW(buf, 0) = 0x3802; memcpy(WBUFP(buf, 2), RFIFOP(fd, 4), NAME_LENGTH); - WBUFB(buf,26) = 1; // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target + WBUFB(buf,26) = 1; // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target mapif_send(fd, buf, 27); } else @@ -1272,7 +1272,7 @@ int mapif_parse_WisReply(int fd) return 0; // This wisp was probably suppress before, because it was timeout of because of target was found on another map-server if ((--wd->count) <= 0 || flag != 1) { - mapif_wis_end(wd, flag); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target + mapif_wis_end(wd, flag); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target idb_remove(wis_db, id); } @@ -1376,8 +1376,8 @@ int mapif_parse_NameChangeRequest(int fd) type = RFIFOB(fd,10); name = (char*)RFIFOP(fd,11); - // Check Authorised letters/symbols in the name - if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorised + // Check Authorized letters/symbols in the name + if (char_name_option == 1) { // only letters/symbols in char_name_letters are authorized for (i = 0; i < NAME_LENGTH && name[i]; i++) if (strchr(char_name_letters, name[i]) == NULL) { mapif_namechange_ack(fd, account_id, char_id, type, 0, name); diff --git a/src/char/pincode.c b/src/char/pincode.c index 59182f12d..18ad0ffc8 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -33,7 +33,7 @@ void pincode_handle ( int fd, struct char_session_data* sd ) { } if( strlen(sd->pincode) == 4 ){ - if( *pincode->changetime && time(NULL) > (sd->pincode_change+*pincode->changetime) ){ // User hasnt changed his PIN code for a long time + if( *pincode->changetime && time(NULL) > (sd->pincode_change+*pincode->changetime) ){ // User hasn't changed his PIN code for a long time pincode->sendstate( fd, sd, PINCODE_EXPIRED ); } else { // Ask user for his PIN code pincode->sendstate( fd, sd, PINCODE_ASK ); diff --git a/src/common/HPM.c b/src/common/HPM.c index d33a4c1aa..f39954175 100644 --- a/src/common/HPM.c +++ b/src/common/HPM.c @@ -410,7 +410,7 @@ void hplugins_addToHPData(enum HPluginDataTypes type, unsigned int pluginID, voi *(action.hdatac) += 1; RECREATE(*(action.HPDataSRCPtr),struct HPluginData *,*(action.hdatac)); - /* RECREATE modified the addresss */ + /* RECREATE modified the address */ HPDataSRC = *(action.HPDataSRCPtr); HPDataSRC[*(action.hdatac) - 1] = HPData; } @@ -578,7 +578,7 @@ void* HPM_reallocz(void *p, size_t size, const char *file, int line, const char char* HPM_astrdup(const char *p, const char *file, int line, const char *func) { return iMalloc->astrdup(p,HPM_file2ptr(file),line,func); } -/* todo: add ability for tracking using pID for the upcoming runtime load/unload support. */ +/* TODO: add ability for tracking using pID for the upcoming runtime load/unload support. */ bool HPM_AddHook(enum HPluginHookType type, const char *target, void *hook, unsigned int pID) { if( !HPM->hooking ) { ShowError("HPM:AddHook Fail! '%s' tried to hook to '%s' but HPMHooking is disabled!\n",HPM->pid2name(pID),target); diff --git a/src/common/HPM.h b/src/common/HPM.h index 9c176cfd6..5667f605a 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -24,7 +24,7 @@ #define DLL HINSTANCE #else // ! WIN32 #include - #ifdef RTLD_DEEPBIND // Certain linux ditributions require this, but it's not available everywhere + #ifdef RTLD_DEEPBIND // Certain linux distributions require this, but it's not available everywhere #define plugin_open(x) dlopen((x),RTLD_NOW|RTLD_DEEPBIND) #else // ! RTLD_DEEPBIND #define plugin_open(x) dlopen((x),RTLD_NOW) diff --git a/src/common/atomic.h b/src/common/atomic.h index 1349d0887..526811a09 100644 --- a/src/common/atomic.h +++ b/src/common/atomic.h @@ -12,7 +12,7 @@ // - Compiler // - Operating System // -// our Abstraction is fully API-Compatible to Microsofts implementation @ NT5.0+ +// our Abstraction is fully API-Compatible to Microsoft's implementation @ NT5.0+ // #include "../common/cbasetypes.h" @@ -23,7 +23,7 @@ #if _MSC_VER < 1800 #if !defined(_M_X64) -// When compiling for windows 32bit, the 8byte interlocked operations are not provided by microsoft +// When compiling for windows 32bit, the 8byte interlocked operations are not provided by Microsoft // (because they need at least i586 so its not generic enough.. ... ) forceinline int64 InterlockedCompareExchange64(volatile int64 *dest, int64 exch, int64 _cmp){ _asm{ @@ -143,7 +143,7 @@ static forceinline int32 InterlockedExchange(volatile int32 *target, int32 val){ }//end: InterlockedExchange() -#endif //endif compiler decission +#endif //endif compiler decision #endif /* _COMMON_ATOMIC_H_ */ diff --git a/src/common/conf.h b/src/common/conf.h index e5b637e47..7c275bec2 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -10,7 +10,7 @@ #include "../../3rdparty/libconfig/libconfig.h" /** - * The libconfig interface -- specially for plugins, but we enforce it throughought the core to be consistent + * The libconfig interface -- specially for plugins, but we enforce it throughout the core to be consistent **/ struct libconfig_interface { int (*read) (config_t *config, FILE *stream); diff --git a/src/common/db.c b/src/common/db.c index bbeaf0b61..11ac06c93 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -3,7 +3,7 @@ * For more information, see LICENCE in the main folder * * This file is separated in five sections: - * (1) Private typedefs, enums, structures, defines and gblobal variables + * (1) Private typedefs, enums, structures, defines and global variables * (2) Private functions * (3) Protected functions used internally * (4) Protected functions used in the interface of the database @@ -89,15 +89,15 @@ * DBNColor - Enumeration of colors of the nodes. * * DBNode - Structure of a node in RED-BLACK trees. * * struct db_free - Structure that holds a deleted node to be freed. * - * DBMap_impl - Struture of the database. * + * DBMap_impl - Structure of the database. * * stats - Statistics about the database system. * \*****************************************************************************/ /** * If defined statistics about database nodes, database creating/destruction - * and function usage are keept and displayed when finalizing the database + * and function usage are kept and displayed when finalizing the database * system. - * WARNING: This adds overhead to every database operation (not shure how much). + * WARNING: This adds overhead to every database operation (not sure how much). * @private * @see #DBStats * @see #stats @@ -511,7 +511,7 @@ static void db_rebalance_erase(DBNode node, DBNode *root) } // Remove the node from the tree - if (y != node) { // both childs existed + if (y != node) { // both child existed // put the left of 'node' in the left of 'y' node->left->parent = y; y->left = node->left; @@ -2066,7 +2066,7 @@ static int db_obj_vforeach(DBMap* self, DBApply func, va_list args) * Apply func to every entry in the database. * Returns the sum of values returned by func. * @param self Interface of the database - * @param func Function to be applyed + * @param func Function to be applied * @param ... Extra arguments for func * @return Sum of the values returned by func * @protected @@ -2345,7 +2345,7 @@ static DBOptions db_obj_options(DBMap* self) * db_default_cmp - Get the default comparator for a type of database. * db_default_hash - Get the default hasher for a type of database. * db_default_release - Get the default releaser for a type of database with the specified options. - * db_custom_release - Get a releaser that behaves a certains way. + * db_custom_release - Get a releaser that behaves a certain way. * db_alloc - Allocate a new database. * db_i2key - Manual cast from 'int' to 'DBKey'. * db_ui2key - Manual cast from 'unsigned int' to 'DBKey'. diff --git a/src/common/db.h b/src/common/db.h index f5714ceaf..4f8d6be79 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -106,7 +106,7 @@ typedef enum DBType { } DBType; /** - * Bitfield of options that define the behaviour of the database. + * Bitfield of options that define the behavior of the database. * See {@link #db_fix_options(DBType,DBOptions)} for restrictions of the * types of databases. * @param DB_OPT_BASE Base options: does not duplicate keys, releases nothing @@ -116,7 +116,7 @@ typedef enum DBType { * @param DB_OPT_RELEASE_KEY Releases the key. * @param DB_OPT_RELEASE_DATA Releases the data whenever an entry is removed * from the database. - * WARNING: for funtions that return the data (like DBMap::remove), + * WARNING: for functions that return the data (like DBMap::remove), * a dangling pointer will be returned. * @param DB_OPT_RELEASE_BOTH Releases both key and data. * @param DB_OPT_ALLOW_NULL_KEY Allow NULL keys in the database. @@ -365,7 +365,7 @@ struct DBIterator }; /** - * Public interface of a database. Only contains funtions. + * Public interface of a database. Only contains functions. * All the functions take the interface as the first argument. * @public * @see #db_alloc(const char*,int,DBType,DBOptions,unsigned short) diff --git a/src/common/ers.c b/src/common/ers.c index 39e05a14c..0842d9e15 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -13,16 +13,16 @@ * If it has reusable entries (freed entry), it uses one. * * So no assumption should be made about the data of the entry. * * Entries should be freed in the manager they where allocated from. * - * Failure to do so can lead to unexpected behaviours. * + * Failure to do so can lead to unexpected behaviors. * * * *

Advantages:

* * - The same manager is used for entries of the same size. * * So entries freed in one instance of the manager can be used by other * * instances of the manager. * * - Much less memory allocation/deallocation - program will be faster. * - * - Avoids memory fragmentaion - program will run better for longer. * + * - Avoids memory fragmentation - program will run better for longer. * * * - *

Disavantages:

* + *

Disadvantages:

* * - Unused entries are almost inevitable - memory being wasted. * * - A manager will only auto-destroy when all of its instances are * * destroyed so memory will usually only be recovered near the end. * @@ -104,7 +104,7 @@ struct ers_instance_t { // Interface to ERS struct eri VTable; - // Name, used for debbuging purpouses + // Name, used for debugging purposes char *Name; // Misc options diff --git a/src/common/ers.h b/src/common/ers.h index 7eceaf87a..f32680339 100644 --- a/src/common/ers.h +++ b/src/common/ers.h @@ -13,16 +13,16 @@ * If it has reusable entries (freed entry), it uses one. * * So no assumption should be made about the data of the entry. * * Entries should be freed in the manager they where allocated from. * - * Failure to do so can lead to unexpected behaviours. * + * Failure to do so can lead to unexpected behaviors. * * * *

Advantages:

* * - The same manager is used for entries of the same size. * * So entries freed in one instance of the manager can be used by other * * instances of the manager. * * - Much less memory allocation/deallocation - program will be faster. * - * - Avoids memory fragmentaion - program will run better for longer. * + * - Avoids memory fragmentation - program will run better for longer. * * * - *

Disavantages:

* + *

Disadvantages:

* * - Unused entries are almost inevitable - memory being wasted. * * - A manager will only auto-destroy when all of its instances are * * destroyed so memory will usually only be recovered near the end. * @@ -49,7 +49,7 @@ * ERS - Entry manager. * * ers_new - Allocate an instance of an entry manager. * * ers_report - Print a report about the current state. * - * ers_final - Clears the remainder of the manangers. * + * ers_final - Clears the remainder of the managers. * \*****************************************************************************/ /** @@ -64,7 +64,7 @@ * By default it aligns to one byte, using the "natural order" of the entries. * This should NEVER be set to zero or less. * If greater than one, some memory can be wasted. This should never be needed - * but is here just in case some aligment issues arise. + * but is here just in case some alignment issues arise. */ #ifndef ERS_ALIGNED # define ERS_ALIGNED 1 @@ -102,7 +102,7 @@ typedef struct eri { /** * Free an entry allocated from this manager. * WARNING: Does not check if the entry was allocated by this manager. - * Freeing such an entry can lead to unexpected behaviour. + * Freeing such an entry can lead to unexpected behavior. * @param self Interface of the entry manager * @param entry Entry to be freed */ @@ -170,7 +170,7 @@ ERS ers_new(uint32 size, char *name, enum ERSOptions options); void ers_report(void); /** - * Clears the remainder of the manangers + * Clears the remainder of the managers **/ void ers_final(void); #endif /* DISABLE_ERS / not DISABLE_ERS */ diff --git a/src/common/grfio.c b/src/common/grfio.c index 1111fb3f3..f592812f6 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -418,7 +418,7 @@ void* grfio_reads(const char* fname, int* size) declen = (int)ftell(in); fseek(in,0,SEEK_SET); buf2 = (unsigned char *)aMalloc(declen+1); // +1 for resnametable zero-termination - if(fread(buf2, 1, declen, in) != (size_t)declen) ShowError("An error occured in fread grfio_reads, fname=%s \n",fname); + if(fread(buf2, 1, declen, in) != (size_t)declen) ShowError("An error occurred in fread grfio_reads, fname=%s \n",fname); fclose(in); if( size ) @@ -440,7 +440,7 @@ void* grfio_reads(const char* fname, int* size) int fsize = entry->srclen_aligned; unsigned char *buf = (unsigned char *)aMalloc(fsize); fseek(in, entry->srcpos, 0); - if(fread(buf, 1, fsize, in) != (size_t)fsize) ShowError("An error occured in fread in grfio_reads, grfname=%s\n",grfname); + if(fread(buf, 1, fsize, in) != (size_t)fsize) ShowError("An error occurred in fread in grfio_reads, grfname=%s\n",grfname); fclose(in); buf2 = (unsigned char *)aMalloc(entry->declen+1); // +1 for resnametable zero-termination @@ -583,7 +583,7 @@ static int grfio_entryread(const char* grfname, int gentry) unsigned char *rBuf; uLongf rSize, eSize; - if(fread(eheader,1,8,fp) != 8) ShowError("An error occured in fread while reading eheader buffer\n"); + if(fread(eheader,1,8,fp) != 8) ShowError("An error occurred in fread while reading header buffer\n"); rSize = getlong(eheader); // Read Size eSize = getlong(eheader+4); // Extend Size @@ -595,7 +595,7 @@ static int grfio_entryread(const char* grfname, int gentry) rBuf = (unsigned char *)aMalloc(rSize); // Get a Read Size grf_filelist = (unsigned char *)aMalloc(eSize); // Get a Extend Size - if(fread(rBuf,1,rSize,fp) != rSize) ShowError("An error occured in fread \n"); + if(fread(rBuf,1,rSize,fp) != rSize) ShowError("An error occurred in fread \n"); fclose(fp); decode_zip(grf_filelist, &eSize, rBuf, rSize); // Decode function aFree(rBuf); @@ -827,7 +827,7 @@ void grfio_init(const char* fname) if( grf_num == 0 ) ShowInfo("No GRF loaded, using default data directory\n"); - // Unneccessary area release of filelist + // Unnecessary area release of filelist filelist_compact(); // Resource check diff --git a/src/common/malloc.c b/src/common/malloc.c index 74303fa92..83d1d6656 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -776,7 +776,7 @@ static void memmgr_init (void) { #ifdef LOG_MEMMGR sprintf(memmer_logfile, "log/%s.leaks", SERVER_NAME); - ShowStatus("Memory manager initialised: "CL_WHITE"%s"CL_RESET"\n", memmer_logfile); + ShowStatus("Memory manager initialized: "CL_WHITE"%s"CL_RESET"\n", memmer_logfile); memset(hash_unfill, 0, sizeof(hash_unfill)); #endif /* LOG_MEMMGR */ } @@ -784,7 +784,7 @@ static void memmgr_init (void) /*====================================== -* Initialise +* Initialize *-------------------------------------- */ diff --git a/src/common/mapindex.c b/src/common/mapindex.c index 5c69c7063..644f2f619 100644 --- a/src/common/mapindex.c +++ b/src/common/mapindex.c @@ -70,7 +70,7 @@ const char* mapindex_getmapname_ext(const char* string, char* output) { } /// Adds a map to the specified index -/// Returns 1 if successful, 0 oherwise +/// Returns 1 if successful, 0 otherwise int mapindex_addmap(int index, const char* name) { char map_name[MAP_NAME_LENGTH]; diff --git a/src/common/mmo.h b/src/common/mmo.h index 4ac7ee793..6ef5b50f5 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -26,7 +26,7 @@ // 20071106 - 2007-11-06aSakexe+ - 0x78, 0x7c, 0x22c // 20080102 - 2008-01-02aSakexe+ - 0x2ec, 0x2ed , 0x2ee // 20081126 - 2008-11-26aSakexe+ - 0x1a2 -// 20090408 - 2009-04-08aSakexe+ - 0x44a (dont use as it overlaps with RE client packets) +// 20090408 - 2009-04-08aSakexe+ - 0x44a (don't use as it overlaps with RE client packets) // 20080827 - 2008-08-27aRagexeRE+ - First RE Client // 20081217 - 2008-12-17aRagexeRE+ - 0x6d (Note: This one still use old Char Info Packet Structure) // 20081218 - 2008-12-17bRagexeRE+ - 0x6d (Note: From this one client use new Char Info Packet Structure) @@ -120,7 +120,7 @@ #define MAX_GUILD_STORAGE 600 #define MAX_PARTY 12 #define MAX_GUILD (16+10*6) // Increased max guild members +6 per 1 extension levels [Lupus] -#define MAX_GUILDPOSITION 20 // Increased max guild positions to accomodate for all members [Valaris] (removed) [PoW] +#define MAX_GUILDPOSITION 20 // Increased max guild positions to accommodate for all members [Valaris] (removed) [PoW] #define MAX_GUILDEXPULSION 32 #define MAX_GUILDALLIANCE 16 #define MAX_GUILDSKILL 15 // Increased max guild skills because of new skills [Sara-chan] diff --git a/src/common/mutex.h b/src/common/mutex.h index f78e31841..ce13a28b7 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -57,23 +57,23 @@ racond racond_create(); /** * Destroy a Condition variable * - * @param c - the condition varaible to destroy + * @param c - the condition variable to destroy */ void racond_destroy( racond c ); /** - * Waits Until state is signalled + * Waits Until state is signaled * - * @param c - the condition var to wait for signalled state - * @param m - the mutex used for syncronization + * @param c - the condition var to wait for signaled state + * @param m - the mutex used for synchronization * @param timeout_ticks - timeout in ticks ( -1 = INFINITE ) */ void racond_wait( racond c, ramutex m, sysint timeout_ticks); /** - * Sets the given condition var to signalled state + * Sets the given condition var to signaled state * - * @param c - condition var to set in signalled state. + * @param c - condition var to set in signaled state. * * @note: * Only one waiter gets notified. @@ -81,8 +81,8 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks); void racond_signal( racond c ); /** - * Sets notifys all waiting threads thats signalled. - * @param c - condition var to set in signalled state + * Sets notifies all waiting threads thats signaled. + * @param c - condition var to set in signaled state * * @note: * All Waiters getting notified. diff --git a/src/common/showmsg.c b/src/common/showmsg.c index 2a8e2d5f8..ece10c1a8 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -88,7 +88,7 @@ int console_msg_log = 0;//[Ind] msg error logging // XXX adapted from eApp (comments are left untouched) [flaviojs] /////////////////////////////////////////////////////////////////////////////// -// ansi compatible printf with control sequence parser for windows +// ANSI compatible printf with control sequence parser for windows // fast hack, handle with care, not everything implemented // // \033[#;...;#m - Set Graphics Rendition (SGR) @@ -147,7 +147,7 @@ int console_msg_log = 0;//[Ind] msg error logging // // \033[u - Restore cursor position (RCP) // Restores the cursor position saved with the (SCP) sequence \033[s. -// (addition, restore to 0,0 if nothinh was saved before) +// (addition, restore to 0,0 if nothing was saved before) // // \033[#J - Erase Display (ED) @@ -282,7 +282,7 @@ int VFPRINTF(HANDLE handle, const char *fmt, va_list argptr) } //case '2': // not existing //case '3': // blinking (not implemented) - //case '4': // unterline (not implemented) + //case '4': // underline (not implemented) //case '6': // not existing //case '8': // concealed (not implemented) //case '9': // not existing diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 5b32f39ae..8008acf5a 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -72,9 +72,9 @@ #define CL_XXBL "\033[0;44m" // default on blue #define CL_PASS "\033[0;32;42m" // green on green -#define CL_SPACE " " // space aquivalent of the print messages +#define CL_SPACE " " // space equivalent of the print messages -extern int stdout_with_ansisequence; //If the color ansi sequences are to be used. [flaviojs] +extern int stdout_with_ansisequence; //If the color ANSI sequences are to be used. [flaviojs] extern int msg_silent; //Specifies how silent the console is. [Skotlex] extern int console_msg_log; //Specifies what error messages to log. [Ind] extern char timestamp_format[20]; //For displaying Timestamps [Skotlex] diff --git a/src/common/socket.c b/src/common/socket.c index ac6be68fe..58c2d5bf9 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -360,7 +360,7 @@ int recv_to_fifo(int fd) len = sRecv(fd, (char *) session[fd]->rdata + session[fd]->rdata_size, (int)RFIFOSPACE(fd), 0); if( len == SOCKET_ERROR ) - {//An exception has occured + {//An exception has occurred if( sErrno != S_EWOULDBLOCK ) { //ShowDebug("recv_to_fifo: %s, closing connection #%d\n", error_msg(), fd); set_eof(fd); @@ -400,7 +400,7 @@ int send_from_fifo(int fd) len = sSend(fd, (const char *) session[fd]->wdata, (int)session[fd]->wdata_size, MSG_NOSIGNAL); if( len == SOCKET_ERROR ) - {//An exception has occured + {//An exception has occurred if( sErrno != S_EWOULDBLOCK ) { //ShowDebug("send_from_fifo: %s, ending connection #%d\n", error_msg(), fd); #ifdef SHOW_SERVER_STATS @@ -845,7 +845,7 @@ int do_sockets(int next) session[i]->func_send(i); if(session[i]->flag.eof) //func_send can't free a session, this is safe. - { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex] + { //Finally, even if there is no data to parse, connections signaled eof should be closed, so we call parse_func [Skotlex] session[i]->func_parse(i); //This should close the session immediately. } } @@ -1234,7 +1234,7 @@ void socket_final(void) if(session[i]) sockt->close(i); - // session[0] ‚̃_ƒ~[ƒf[ƒ^‚ðíœ + // session[0] aFree(session[0]->rdata); aFree(session[0]->wdata); aFree(session[0]); @@ -1364,7 +1364,7 @@ void socket_init(void) } } #elif defined(HAVE_SETRLIMIT) && !defined(CYGWIN) - // NOTE: getrlimit and setrlimit have bogus behaviour in cygwin. + // NOTE: getrlimit and setrlimit have bogus behavior in cygwin. // "Number of fds is virtually unlimited in cygwin" (sys/param.h) {// set socket limit to FD_SETSIZE struct rlimit rlp; @@ -1405,7 +1405,7 @@ void socket_init(void) socket_config_read(SOCKET_CONF_FILENAME); - // initialise last send-receive tick + // initialize last send-receive tick sockt->last_tick = time(NULL); // session[0] is now currently used for disconnected sessions of the map server, and as such, @@ -1458,7 +1458,7 @@ uint32 str2ip(const char* ip_str) } // Reorders bytes from network to little endian (Windows). -// Neccessary for sending port numbers to the RO client until Gravity notices that they forgot ntohs() calls. +// Necessary for sending port numbers to the RO client until Gravity notices that they forgot ntohs() calls. uint16 ntows(uint16 netshort) { return ((netshort & 0xFF) << 8) | ((netshort & 0xFF00) >> 8); diff --git a/src/common/spinlock.h b/src/common/spinlock.h index 1c0825181..fe0da6669 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -4,7 +4,7 @@ // // CAS based Spinlock Implementation // -// CamelCase names are choosen to be consistent with microsofts winapi +// CamelCase names are chosen to be consistent with Microsoft's WinAPI // which implements CriticalSection by this naming... // // Author: Florian Wilkemeyer diff --git a/src/common/sql.c b/src/common/sql.c index ffc4d63ef..a562478ea 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -38,7 +38,7 @@ struct Sql { // Column length receiver. -// Takes care of the possible size missmatch between uint32 and unsigned long. +// Takes care of the possible size mismatch between uint32 and unsigned long. struct s_column_length { uint32* out_length; unsigned long length; @@ -569,7 +569,7 @@ static void SqlStmt_P_ShowDebugTruncatedColumn(SqlStmt* self, size_t i) Sql_P_ShowDebugMysqlFieldInfo("data - ", field->type, field->flags&UNSIGNED_FLAG, self->column_lengths[i].length, ""); column = &self->columns[i]; if( column->buffer_type == MYSQL_TYPE_STRING ) - Sql_P_ShowDebugMysqlFieldInfo("buffer - ", column->buffer_type, column->is_unsigned, column->buffer_length, "+1(nul-terminator)"); + Sql_P_ShowDebugMysqlFieldInfo("buffer - ", column->buffer_type, column->is_unsigned, column->buffer_length, "+1(null-terminator)"); else Sql_P_ShowDebugMysqlFieldInfo("buffer - ", column->buffer_type, column->is_unsigned, column->buffer_length, ""); mysql_free_result(meta); @@ -765,10 +765,10 @@ int SqlStmt_BindColumn(SqlStmt* self, size_t idx, enum SqlDataType buffer_type, { if( buffer_len < 1 ) { - ShowDebug("SqlStmt_BindColumn: buffer_len(%d) is too small, no room for the nul-terminator\n", buffer_len); + ShowDebug("SqlStmt_BindColumn: buffer_len(%d) is too small, no room for the null-terminator\n", buffer_len); return SQL_ERROR; } - --buffer_len;// nul-terminator + --buffer_len;// null-terminator } if( !self->bind_columns ) {// initialize the bindings @@ -891,7 +891,7 @@ int SqlStmt_NextRow(SqlStmt* self) if( self->column_lengths[i].out_length ) *self->column_lengths[i].out_length = (uint32)length; if( column->buffer_type == MYSQL_TYPE_STRING ) - {// clear unused part of the string/enum buffer (and nul-terminate) + {// clear unused part of the string/enum buffer (and null-terminate) memset((char*)column->buffer + length, 0, column->buffer_length - length + 1); } else if( column->buffer_type == MYSQL_TYPE_BLOB && length < column->buffer_length ) diff --git a/src/common/sql.h b/src/common/sql.h index 64d8307fc..3bdb76c74 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -166,7 +166,7 @@ struct sql_interface { /// It uses the connection of the parent Sql handle. /// Queries in Sql and SqlStmt are independent and don't affect each other. /// - /// @return SqlStmt handle or NULL if an error occured + /// @return SqlStmt handle or NULL if an error occurred struct SqlStmt* (*StmtMalloc)(Sql* sql); @@ -198,7 +198,7 @@ struct sql_interface { /// Returns the number of parameters in the prepared statement. /// - /// @return Number or paramenters + /// @return Number or parameters size_t (*StmtNumParams)(SqlStmt* self); @@ -237,7 +237,7 @@ struct sql_interface { /// Binds the result of a column to a buffer. /// The buffer will be filled with data when the next row is fetched. /// For string/enum buffer types there has to be enough space for the data - /// and the nul-terminator (an extra byte). + /// and the null-terminator (an extra byte). /// /// @return SQL_SUCCESS or SQL_ERROR int (*StmtBindColumn)(SqlStmt* self, size_t idx, SqlDataType buffer_type, void* buffer, size_t buffer_len, uint32* out_length, int8* out_is_null); diff --git a/src/common/strlib.c b/src/common/strlib.c index 10e893c3a..2ce8fd347 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -147,15 +147,15 @@ char* trim(char* str) if( start == end ) *str = '\0';// empty string else - {// move string with nul terminator + {// move string with null-terminator str[end] = '\0'; memmove(str,str+start,end-start+1); } return str; } -// Converts one or more consecutive occurences of the delimiters into a single space -// and removes such occurences from the beginning and end of string +// Converts one or more consecutive occurrences of the delimiters into a single space +// and removes such occurrences from the beginning and end of string // NOTE: make sure the string is not const!! char* normalize_name(char* str,const char* delims) { @@ -358,18 +358,18 @@ int config_switch(const char* str) { return (int)strtol(str, NULL, 0); } -/// strncpy that always nul-terminates the string +/// strncpy that always null-terminates the string char* safestrncpy(char* dst, const char* src, size_t n) { if( n > 0 ) { char* d = dst; const char* s = src; - d[--n] = '\0';/* nul-terminate string */ + d[--n] = '\0';/* null-terminate string */ for( ; n > 0; --n ) { if( (*d++ = *s++) == '\0' ) - {/* nul-pad remaining bytes */ + {/* null-pad remaining bytes */ while( --n > 0 ) *d++ = '\0'; break; @@ -385,12 +385,12 @@ size_t safestrnlen(const char* string, size_t maxlen) return ( string != NULL ) ? strnlen(string, maxlen) : 0; } -/// Works like snprintf, but always nul-terminates the buffer. -/// Returns the size of the string (without nul-terminator) +/// Works like snprintf, but always null-terminates the buffer. +/// Returns the size of the string (without null-terminator) /// or -1 if the buffer is too small. /// /// @param buf Target buffer -/// @param sz Size of the buffer (including nul-terminator) +/// @param sz Size of the buffer (including null-terminator) /// @param fmt Format string /// @param ... Format arguments /// @return The size of the string or -1 if the buffer is too small @@ -404,7 +404,7 @@ int safesnprintf(char* buf, size_t sz, const char* fmt, ...) va_end(ap); if( ret < 0 || (size_t)ret >= sz ) {// overflow - buf[sz-1] = '\0';// always nul-terminate + buf[sz-1] = '\0';// always null-terminate return -1; } return ret; @@ -631,8 +631,8 @@ int sv_parse_next(struct s_svstate* svstate) /// @param delim Field delimiter /// @param out_pos Array of resulting positions /// @param npos Size of the pos array -/// @param opt Options that determine the parsing behaviour -/// @return Number of fields found in the string or -1 if an error occured +/// @param opt Options that determine the parsing behavior +/// @return Number of fields found in the string or -1 if an error occurred int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, int npos, enum e_svopt opt) { struct s_svstate svstate; int count; @@ -666,11 +666,11 @@ int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, i /// WARNING: this function modifies the input string /// Starts splitting at startoff and fills the out_fields array. /// out_fields[0] is the start of the next line. -/// Other entries are the start of fields (nul-teminated). +/// Other entries are the start of fields (null-terminated). /// Returns the number of fields found or -1 if an error occurs. /// /// out_fields can be NULL. -/// Fields that don't fit in out_fields are not nul-terminated. +/// Fields that don't fit in out_fields are not null-terminated. /// Extra entries in out_fields are filled with the end of the last field (empty string). /// /// @param str String to parse @@ -679,8 +679,8 @@ int sv_parse(const char* str, int len, int startoff, char delim, int* out_pos, i /// @param delim Field delimiter /// @param out_fields Array of resulting fields /// @param nfields Size of the field array -/// @param opt Options that determine the parsing behaviour -/// @return Number of fields found in the string or -1 if an error occured +/// @param opt Options that determine the parsing behavior +/// @return Number of fields found in the string or -1 if an error occurred int sv_split(char* str, int len, int startoff, char delim, char** out_fields, int nfields, enum e_svopt opt) { int pos[1024]; int i; diff --git a/src/common/strlib.h b/src/common/strlib.h index f93d8ad67..f39f27789 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -16,7 +16,7 @@ char *_strtok_r(char* s1, const char* s2, char** lasts); #endif -/// Bitfield determining the behaviour of sv_parse and sv_split. +/// Bitfield determining the behavior of sv_parse and sv_split. typedef enum e_svopt { // default: no escapes and no line terminator SV_NOESCAPE_NOTERMINATE = 0, @@ -73,14 +73,14 @@ struct strlib_interface { int (*e_mail_check) (char* email); int (*config_switch) (const char* str); - /// strncpy that always nul-terminates the string + /// strncpy that always null-terminates the string char *(*safestrncpy) (char* dst, const char* src, size_t n); /// doesn't crash on null pointer size_t (*safestrnlen) (const char* string, size_t maxlen); - /// Works like snprintf, but always nul-terminates the buffer. - /// Returns the size of the string (without nul-terminator) + /// Works like snprintf, but always null-terminates the buffer. + /// Returns the size of the string (without null-terminator) /// or -1 if the buffer is too small. int (*safesnprintf) (char* buf, size_t sz, const char* fmt, ...); @@ -131,7 +131,7 @@ struct sv_interface { /// WARNING: this function modifies the input string /// Starts splitting at startoff and fills the out_fields array. /// out_fields[0] is the start of the next line. - /// Other entries are the start of fields (nul-teminated). + /// Other entries are the start of fields (null-terminated). /// Returns the number of fields found or -1 if an error occurs. int (*split) (char* str, int len, int startoff, char delim, char** out_fields, int nfields, enum e_svopt opt); diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 3fdfadb41..40ef6cfc0 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -226,7 +226,7 @@ bool sysinfo_svn_get_revision(char **out) { // - since it's a cache column, the data might not even exist if ((fp = fopen(".svn"PATHSEP_STR"wc.db", "rb")) != NULL || (fp = fopen(".."PATHSEP_STR".svn"PATHSEP_STR"wc.db", "rb")) != NULL) { -#ifndef SVNNODEPATH //not sure how to handle branches, so i'll leave this overridable define until a better solution comes up +#ifndef SVNNODEPATH //not sure how to handle branches, so I'll leave this overridable define until a better solution comes up #define SVNNODEPATH trunk #endif // SVNNODEPATH @@ -709,7 +709,7 @@ void sysinfo_vcsrevision_src_retrieve(void) { #endif // WIN32 /** - * Retrieevs the VCS type name. + * Retrieves the VCS type name. * * Once retrieved, the value is stored in sysinfo->p->vcstype_name. */ diff --git a/src/common/thread.c b/src/common/thread.c index 91360537f..4be37d576 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -68,7 +68,7 @@ void rathread_init(){ l_threads[i].myID = i; } - // now lets init thread id 0, which represnts the main thread + // now lets init thread id 0, which represents the main thread #ifdef HAS_TLS g_rathread_ID = 0; #endif @@ -83,7 +83,7 @@ void rathread_final(){ register unsigned int i; // Unterminated Threads Left? - // Should'nt happen .. + // Shouldn't happen .. // Kill 'em all! // for(i = 1; i < RA_THREADS_MAX; i++){ @@ -121,9 +121,9 @@ static void *_raThreadMainRedirector( void *p ){ #ifndef WIN32 // When using posix threads - // the threads inherits the Signal mask from the thread which's spawned + // the threads inherits the Signal mask from the thread which spawned // this thread - // so we've to block everything we dont care about. + // so we've to block everything we don't care about. sigemptyset(&set); sigaddset(&set, SIGINT); sigaddset(&set, SIGTERM); @@ -222,10 +222,10 @@ void rathread_destroy ( rAthread handle ){ #else if( pthread_cancel( handle->hThread ) == 0){ - // We have to join it, otherwise pthread wont re-cycle its internal ressources assoc. with this thread. + // We have to join it, otherwise pthread wont re-cycle its internal resources assoc. with this thread. pthread_join( handle->hThread, NULL ); - // Tell our manager to release ressources ;) + // Tell our manager to release resources ;) rat_thread_terminated(handle); } #endif @@ -265,7 +265,7 @@ int rathread_get_tid(){ #ifdef HAS_TLS return g_rathread_ID; #else - // todo + // TODO #ifdef WIN32 return (int)GetCurrentThreadId(); #else diff --git a/src/common/thread.h b/src/common/thread.h index 7ad326509..992e3e6c8 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -20,7 +20,7 @@ typedef enum RATHREAD_PRIO { * Creates a new Thread * * @param entyPoint - entryProc, - * @param param - general purpose parameter, would be given as parameter to the thread's entrypoint. + * @param param - general purpose parameter, would be given as parameter to the thread's entry point. * * @return not NULL if success */ @@ -31,7 +31,7 @@ rAthread rathread_create( rAthreadProc entryPoint, void *param ); * Creates a new Thread (with more creation options) * * @param entyPoint - entryProc, - * @param param - general purpose parameter, would be given as parameter to the thread's entrypoint + * @param param - general purpose parameter, would be given as parameter to the thread's entry point * @param szStack - stack Size in bytes * @param prio - Priority of the Thread @ OS Scheduler.. * @@ -41,9 +41,9 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta /** - * Destroys the given Thread immediatly + * Destroys the given Thread immediately * - * @note The Handle gets invalid after call! dont use it afterwards. + * @note The Handle gets invalid after call! don't use it afterwards. * * @param handle - thread to destroy. */ @@ -53,7 +53,7 @@ void rathread_destroy ( rAthread handle ); /** * Returns the thread handle of the thread calling this function * - * @note this wont work @ programms main thread + * @note this wont work @ programs main thread * @note the underlying implementation might not perform very well, cache the value received! * * @return not NULL if success @@ -62,10 +62,10 @@ rAthread rathread_self( ); /** - * Returns own thrad id (TID) + * Returns own thread id (TID) * * @note this is an unique identifier for the calling thread, and - * depends on platfrom / compiler, and may not be the systems Thread ID! + * depends on platform/ compiler, and may not be the systems Thread ID! * * @return -1 when fails, otherwise >= 0 */ @@ -93,7 +93,7 @@ void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio ); /** - * Gets the current Prio of the given trhead + * Gets the current Prio of the given thread * * @param handle - the thread to get the prio for. */ diff --git a/src/common/timer.c b/src/common/timer.c index 5240ec202..ab0471d51 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -170,14 +170,14 @@ static int64 sys_tick(void) { } if (pGetTickCount64) return (int64)pGetTickCount64(); - // 32-bit fallback. Note: This will wrap around every ~49 days since system startup!!! + // 32-bit fall back. Note: This will wrap around every ~49 days since system startup!!! return (int64)GetTickCount(); #elif defined(ENABLE_RDTSC) // RDTSC: Returns the number of CPU cycles since reset. Unreliable if // the CPU frequency is variable. return (int64)((_rdtsc() - RDTSC_BEGINTICK) / RDTSC_CLOCK); #elif defined(HAVE_MONOTONIC_CLOCK) - // Monotinic clock: Implementation-defined. + // Monotonic clock: Implementation-defined. // Clock that cannot be set and represents monotonic time since some // unspecified starting point. This clock is not affected by // discontinuous jumps in the system time (e.g., if the system @@ -188,7 +188,7 @@ static int64 sys_tick(void) { // int64 cast to avoid overflows on platforms where time_t is 32 bit return (int64)tval.tv_sec * 1000 + tval.tv_nsec / 1000000; #else - // Fallback, regular clock: Number of milliseconds since epoch. + // Fall back, regular clock: Number of milliseconds since epoch. // The time returned by gettimeofday() is affected by discontinuous // jumps in the system time (e.g., if the system administrator // manually changes the system time). If you need a monotonically diff --git a/src/common/utils.c b/src/common/utils.c index 80954f848..4e6cb49c2 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -200,7 +200,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*)) sprintf(tmppath,"%s%c%s",path, PATHSEP, entry->d_name); - // check if the pattern matchs. + // check if the pattern matches. if (entry->d_name && strstr(entry->d_name, pattern)) { func( tmppath ); } @@ -211,7 +211,7 @@ void findfile(const char *p, const char *pat, void (func)(const char*)) } // is this a directory? if (S_ISDIR(dir_stat.st_mode)) { - // decent recursivly + // decent recursively findfile(tmppath, pat, func); } }//end while @@ -326,7 +326,7 @@ unsigned int get_percentage(const unsigned int A, const unsigned int B) if( B == 0 ) { - ShowError("get_percentage(): divison by zero! (A=%u,B=%u)\n", A, B); + ShowError("get_percentage(): division by zero! (A=%u,B=%u)\n", A, B); return ~0U; } diff --git a/src/config/core.h b/src/config/core.h index 157d94b2f..24e9de710 100644 --- a/src/config/core.h +++ b/src/config/core.h @@ -27,7 +27,7 @@ /// CONSOLE_INPUT allows you to type commands into the server's console, /// Disabling it saves one thread. #define CONSOLE_INPUT -/// Maximum number of caracters 'CONSOLE_INPUT' will support per line. +/// Maximum number of characters 'CONSOLE_INPUT' will support per line. #define MAX_CONSOLE_INPUT 150 /// Uncomment to disable Hercules' anonymous stat report @@ -43,7 +43,7 @@ /// By default, all range checks in Aegis are of Square shapes, so a weapon range /// - of 10 allows you to attack from anywhere within a 21x21 area. /// Enabling this changes such checks to circular checks, which is more realistic, -/// - but is not the official behaviour. +/// - but is not the official behavior. //#define CIRCULAR_AREA //This is the distance at which @autoloot works, diff --git a/src/config/secure.h b/src/config/secure.h index e5e3662d1..1a89e36cf 100644 --- a/src/config/secure.h +++ b/src/config/secure.h @@ -49,7 +49,7 @@ /** * Uncomment to disable - * while enabled, movement of invisible (cloaking, hide, etca [not chase walk]) units is not informed to nearby foes, + * while enabled, movement of invisible (cloaking, hide, etc [not chase walk]) units is not informed to nearby foes, * rendering any client-side cheat, that would otherwise make these units visible, to not function. * - "Why is this a setting?" because theres a cost, while enabled if a hidden character uses a skill with cast time, * - for example "cloaking -> walk a bit -> soul break another player" the character display will be momentarily abrupted diff --git a/src/login/account.h b/src/login/account.h index 329ae31c8..a14595519 100644 --- a/src/login/account.h +++ b/src/login/account.h @@ -25,7 +25,7 @@ struct mmo_account char email[40]; // e-mail (by default: a@a.com) int group_id; // player group id uint8 char_slots; // this accounts maximum character slots (maximum is limited to MAX_CHARS define in char server) - unsigned int state; // packet 0x006a value + 1 (0: compte OK) + unsigned int state; // packet 0x006a value + 1 (0: complete OK) time_t unban_time; // (timestamp): ban time limit of the account (0 = no ban) time_t expiration_time; // (timestamp): validity limit of the account (0 = unlimited) unsigned int logincount; // number of successful auth attempts diff --git a/src/login/account_sql.c b/src/login/account_sql.c index 2e4ed7ab9..51e499369 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -454,7 +454,7 @@ static bool account_db_sql_load_str(AccountDB* self, struct mmo_account* acc, co } if( SQL->NumRows(sql_handle) > 1 ) - {// serious problem - duplicit account + {// serious problem - duplicate account ShowError("account_db_sql_load_str: multiple accounts found when retrieving data for account '%s'!\n", userid); SQL->FreeResult(sql_handle); return false; diff --git a/src/login/login.c b/src/login/login.c index 43883c6ce..c3f2f6000 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -287,7 +287,7 @@ int lan_subnetcheck(uint32 ip) } //---------------------------------- -// Reading Lan Support configuration +// Reading LAN Support configuration //---------------------------------- int login_lan_config_read(const char *lancfgName) { @@ -724,13 +724,13 @@ int parse_fromchar(int fd) RFIFOSKIP(fd,6); if( !accounts->load_num(accounts, &acc, account_id) ) - ShowNotice("Char-server '%s': Error of UnBan request (account: %d not found, ip: %s).\n", server[id].name, account_id, ip); + ShowNotice("Char-server '%s': Error of Unban request (account: %d not found, ip: %s).\n", server[id].name, account_id, ip); else if( acc.unban_time == 0 ) - ShowNotice("Char-server '%s': Error of UnBan request (account: %d, no change for unban date, ip: %s).\n", server[id].name, account_id, ip); + ShowNotice("Char-server '%s': Error of Unban request (account: %d, no change for unban date, ip: %s).\n", server[id].name, account_id, ip); else { - ShowNotice("Char-server '%s': UnBan request (account: %d, ip: %s).\n", server[id].name, account_id, ip); + ShowNotice("Char-server '%s': Unban request (account: %d, ip: %s).\n", server[id].name, account_id, ip); acc.unban_time = 0; accounts->save(accounts, &acc); } @@ -912,7 +912,7 @@ int mmo_auth_new(const char* userid, const char* pass, const char sex, const cha // check if the account doesn't exist already if( accounts->load_str(accounts, &acc, userid) ) { - ShowNotice("Attempt of creation of an already existant account (account: %s_%c, pass: %s, received pass: %s)\n", userid, sex, acc.pass, pass); + ShowNotice("Attempt of creation of an already existing account (account: %s_%c, pass: %s, received pass: %s)\n", userid, sex, acc.pass, pass); return 1; // 1 = Incorrect Password } @@ -1104,7 +1104,7 @@ void login_auth_ok(struct login_session_data* sd) WFIFOSET(fd,3); return; } else if( login_config.min_group_id_to_connect >= 0 && login_config.group_id_to_connect == -1 && sd->group_id < login_config.min_group_id_to_connect ) { - ShowStatus("Connection refused: the minium group id required for connection is %d (account: %s, group: %d).\n", login_config.min_group_id_to_connect, sd->userid, sd->group_id); + ShowStatus("Connection refused: the minimum group id required for connection is %d (account: %s, group: %d).\n", login_config.min_group_id_to_connect, sd->userid, sd->group_id); WFIFOHEAD(fd,3); WFIFOW(fd,0) = 0x81; WFIFOB(fd,2) = 1; // 01 = Server closed @@ -1309,7 +1309,7 @@ int parse_login(int fd) // Perform ip-ban check if( login_config.ipban && ipban_check(ipl) ) { - ShowStatus("Connection refused: IP isn't authorised (deny/allow, ip: %s).\n", ip); + ShowStatus("Connection refused: IP isn't authorized (deny/allow, ip: %s).\n", ip); login_log(ipl, "unknown", -3, "ip banned"); WFIFOHEAD(fd,23); WFIFOW(fd,0) = 0x6a; @@ -1772,7 +1772,7 @@ int do_init(int argc, char** argv) { int i; - // intialize engine (to accept config settings) + // initialize engine (to accept config settings) account_engine[0].db = account_engine[0].constructor(); // read login-server configuration diff --git a/src/login/login.h b/src/login/login.h index e77b96a0e..447301ea4 100644 --- a/src/login/login.h +++ b/src/login/login.h @@ -72,7 +72,7 @@ struct Login_Config { unsigned int ip_sync_interval; // interval (in minutes) to execute a DNS/IP update (for dynamic IPs) bool log_login; // whether to log login server actions or not char date_format[32]; // date format used in messages - bool new_account_flag,new_acc_length_limit; // autoregistration via _M/_F ? / if yes minimum length is 4? + bool new_account_flag,new_acc_length_limit; // auto-registration via _M/_F ? / if yes minimum length is 4? int start_limited_time; // new account expiration time (-1: unlimited) bool use_md5_passwds; // work with password hashes instead of plaintext passwords? int group_id_to_connect; // required group id to connect diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 2cbc02c93..2c0b1cc03 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -35,7 +35,7 @@ static Sql* sql_handle = NULL; static bool enabled = false; -// Returns the number of failed login attemps by the ip in the last minutes. +// Returns the number of failed login attempts by the ip in the last minutes. unsigned long loginlog_failedattempts(uint32 ip, unsigned int minutes) { unsigned long failures = 0; diff --git a/src/map/atcommand.c b/src/map/atcommand.c index a7e4cef39..2acea5872 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -947,7 +947,7 @@ ACMD(jobchange) { } } - // High Jobs, Babys and Third + // High Jobs, Babies and Third for( i = JOB_NOVICE_HIGH; i < JOB_MAX && !found; i++ ){ if (strncmpi(message, pc->job_name(i), 16) == 0) { job = i; @@ -1329,7 +1329,7 @@ ACMD(baselevelup) clif->message(fd, msg_txt(47)); // Base level can't go any higher. return false; } // End Addition - if ((unsigned int)level > pc->maxbaselv(sd) || (unsigned int)level > pc->maxbaselv(sd) - sd->status.base_level) // fix positiv overflow + if ((unsigned int)level > pc->maxbaselv(sd) || (unsigned int)level > pc->maxbaselv(sd) - sd->status.base_level) // fix positive overflow level = pc->maxbaselv(sd) - sd->status.base_level; for (i = 0; i < level; i++) status_point += pc->gets_status_point(sd->status.base_level + i); @@ -1389,7 +1389,7 @@ ACMD(joblevelup) clif->message(fd, msg_txt(23)); // Job level can't go any higher. return false; } - if ((unsigned int)level > pc->maxjoblv(sd) || (unsigned int)level > pc->maxjoblv(sd) - sd->status.job_level) // fix positiv overflow + if ((unsigned int)level > pc->maxjoblv(sd) || (unsigned int)level > pc->maxjoblv(sd) - sd->status.job_level) // fix positive overflow level = pc->maxjoblv(sd) - sd->status.job_level; sd->status.job_level += (unsigned int)level; sd->status.skill_point += level; @@ -1401,11 +1401,11 @@ ACMD(joblevelup) return false; } level *=-1; - if ((unsigned int)level >= sd->status.job_level) // fix negativ overflow + if ((unsigned int)level >= sd->status.job_level) // fix negative overflow level = sd->status.job_level-1; sd->status.job_level -= (unsigned int)level; if (sd->status.skill_point < level) - pc->resetskill(sd,0); //Reset skills since we need to substract more points. + pc->resetskill(sd,0); //Reset skills since we need to subtract more points. if (sd->status.skill_point < level) sd->status.skill_point = 0; else @@ -1631,7 +1631,7 @@ ACMD(model) pc->changelook(sd, LOOK_HAIR, hair_style); pc->changelook(sd, LOOK_HAIR_COLOR, hair_color); pc->changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif->message(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearance changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. return false; @@ -1657,7 +1657,7 @@ ACMD(dye) if (cloth_color >= MIN_CLOTH_COLOR && cloth_color <= MAX_CLOTH_COLOR) { pc->changelook(sd, LOOK_CLOTHES_COLOR, cloth_color); - clif->message(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearance changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. return false; @@ -1683,7 +1683,7 @@ ACMD(hair_style) if (hair_style >= MIN_HAIR_STYLE && hair_style <= MAX_HAIR_STYLE) { pc->changelook(sd, LOOK_HAIR, hair_style); - clif->message(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearance changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. return false; @@ -1709,7 +1709,7 @@ ACMD(hair_color) if (hair_color >= MIN_HAIR_COLOR && hair_color <= MAX_HAIR_COLOR) { pc->changelook(sd, LOOK_HAIR_COLOR, hair_color); - clif->message(fd, msg_txt(36)); // Appearence changed. + clif->message(fd, msg_txt(36)); // Appearance changed. } else { clif->message(fd, msg_txt(37)); // An invalid number was specified. return false; @@ -1896,7 +1896,7 @@ ACMD(monster) return false; } - if ((mob_id = mob->db_searchname(monster)) == 0) // check name first (to avoid possible name begining by a number) + if ((mob_id = mob->db_searchname(monster)) == 0) // check name first (to avoid possible name beginning by a number) mob_id = mob->db_checkid(atoi(monster)); if (mob_id == 0) { @@ -2711,7 +2711,7 @@ ACMD(char_block) * mn: minute * s: second * @ban +1m-2mn1s-6y test_player - * this example adds 1 month and 1 second, and substracts 2 minutes and 6 years at the same time. + * this example adds 1 month and 1 second, and subtracts 2 minutes and 6 years at the same time. *------------------------------------------*/ ACMD(char_ban) { @@ -2879,12 +2879,12 @@ ACMD(doom) { status_kill(&pl_sd->bl); clif->specialeffect(&pl_sd->bl,450,AREA); - clif->message(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement. + clif->message(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgment. } } mapit->free(iter); - clif->message(fd, msg_txt(62)); // Judgement was made. + clif->message(fd, msg_txt(62)); // Judgment was made. return true; } @@ -2904,12 +2904,12 @@ ACMD(doommap) { status_kill(&pl_sd->bl); clif->specialeffect(&pl_sd->bl,450,AREA); - clif->message(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgement. + clif->message(pl_sd->fd, msg_txt(61)); // The holy messenger has given judgment. } } mapit->free(iter); - clif->message(fd, msg_txt(62)); // Judgement was made. + clif->message(fd, msg_txt(62)); // Judgment was made. return true; } @@ -2984,7 +2984,7 @@ ACMD(kick) if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { - clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorize you to do this action on this player. return false; } @@ -3287,7 +3287,7 @@ ACMD(mapexit) { } /*========================================== - * idsearch : revrited by [Yor] + * idsearch : rewrite by [Yor] *------------------------------------------*/ ACMD(idsearch) { @@ -3333,7 +3333,7 @@ ACMD(recallall) memset(atcmd_output, '\0', sizeof(atcmd_output)); if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map. + clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map. return false; } @@ -3385,7 +3385,7 @@ ACMD(guildrecall) } if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map. + clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map. return false; } @@ -3442,7 +3442,7 @@ ACMD(partyrecall) } if (sd->bl.m >= 0 && map->list[sd->bl.m].flag.nowarpto && !pc_has_permission(sd, PC_PERM_WARP_ANYWHERE)) { - clif->message(fd, msg_txt(1032)); // You are not authorized to warp somenone to your current map. + clif->message(fd, msg_txt(1032)); // You are not authorized to warp someone to your current map. return false; } @@ -4089,7 +4089,7 @@ ACMD(nuke) { skill->castend_nodamage_id(&pl_sd->bl, &pl_sd->bl, NPC_SELFDESTRUCTION, 99, timer->gettick(), 0); clif->message(fd, msg_txt(109)); // Player has been nuked! } else { - clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorize you to do this action on this player. return false; } } else { @@ -4286,7 +4286,7 @@ ACMD(servertime) { const struct TimerData * timer_data2 = timer->get(pc->day_timer_tid); if (map->night_flag == 0) { - sprintf(temp, msg_txt(235), // Game time: The game is actualy in daylight for %s. + sprintf(temp, msg_txt(235), // Game time: The game is actually in daylight for %s. txt_time((unsigned int)(DIFF_TICK(timer_data->tick,timer->gettick())/1000))); clif->message(fd, temp); if (DIFF_TICK(timer_data->tick, timer_data2->tick) > 0) @@ -4297,7 +4297,7 @@ ACMD(servertime) { txt_time((unsigned int)(DIFF_TICK(timer_data2->tick,timer_data->tick)/1000))); clif->message(fd, temp); } else { - sprintf(temp, msg_txt(233), // Game time: The game is actualy in night for %s. + sprintf(temp, msg_txt(233), // Game time: The game is actually in night for %s. txt_time((unsigned int)(DIFF_TICK(timer_data2->tick,timer->gettick()) / 1000))); clif->message(fd, temp); if (DIFF_TICK(timer_data2->tick,timer_data->tick) > 0) @@ -4371,7 +4371,7 @@ ACMD(jail) { if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM - clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorize you to do this action on this player. return false; } @@ -4422,7 +4422,7 @@ ACMD(unjail) { if (pc_get_group_level(sd) < pc_get_group_level(pl_sd)) { // you can jail only lower or same GM - clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorize you to do this action on this player. return false; } @@ -4499,7 +4499,7 @@ ACMD(jailfor) { } if (pc_get_group_level(pl_sd) > pc_get_group_level(sd)) { - clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorize you to do this action on this player. return false; } @@ -5245,7 +5245,7 @@ ACMD(useskill) { if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { - clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorized you to do this action on this player. return false; } @@ -5460,7 +5460,7 @@ ACMD(autotrade) { status->change_start(NULL,&sd->bl, SC_AUTOTRADE, 10000, 0, 0, 0, 0, ((timeout > 0) ? min(timeout,battle_config.at_timeout) : battle_config.at_timeout) * 60000, 0); } - /* currently standalones are not supporting buyingstores, so we rely on the previous method */ + /* currently standalone is not supporting buyingstores, so we rely on the previous method */ if( sd->state.buyingstore ) { clif->authfail_fd(fd, 15); return true; @@ -6385,7 +6385,7 @@ ACMD(changesex) int i; pc->resetskill(sd,4); - // to avoid any problem with equipment and invalid sex, equipment is unequiped. + // to avoid any problem with equipment and invalid sex, equipment is unequipped. for( i=0; iequip_index[i] >= 0 ) pc->unequipitem(sd, sd->equip_index[i], 3); chrif->changesex(sd); @@ -6411,7 +6411,7 @@ ACMD(mute) { if ( pc_get_group_level(sd) < pc_get_group_level(pl_sd) ) { - clif->message(fd, msg_txt(81)); // Your GM level don't authorise you to do this action on this player. + clif->message(fd, msg_txt(81)); // Your GM level don't authorize you to do this action on this player. return false; } @@ -7700,7 +7700,7 @@ ACMD(accept) { } if(sd->duel_invite <= 0) { - // "Duel: @accept without invititation." + // "Duel: @accept without invitation." clif->message(fd, msg_txt(360)); return false; } @@ -7720,7 +7720,7 @@ ACMD(accept) { ACMD(reject) { if(sd->duel_invite <= 0) { - // "Duel: @reject without invititation." + // "Duel: @reject without invitation." clif->message(fd, msg_txt(362)); return false; } @@ -8632,7 +8632,7 @@ ACMD(join) { if( hChSys.local && strcmpi(name + 1, hChSys.local_name) == 0 ) { if( !map->list[sd->bl.m].channel ) { clif->chsys_mjoin(sd); - if( map->list[sd->bl.m].channel ) /* mjoin might have refused, map has chatting capabilities disabled */ + if( map->list[sd->bl.m].channel ) /* join might have refused, map has chatting capabilities disabled */ return true; } else channel = map->list[sd->bl.m].channel; diff --git a/src/map/battle.c b/src/map/battle.c index 57302166e..810bebae9 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -58,7 +58,7 @@ int battle_getcurrentskill(struct block_list *bl) { //Returns the current/last s } /*========================================== - * Get random targetting enemy + * Get random targeting enemy *------------------------------------------*/ int battle_gettargeted_sub(struct block_list *bl, va_list ap) { struct block_list **bl_list; @@ -102,7 +102,7 @@ struct block_list* battle_gettargeted(struct block_list *target) { } -//Returns the id of the current targetted character of the passed bl. [Skotlex] +//Returns the id of the current targeted character of the passed bl. [Skotlex] int battle_gettarget(struct block_list* bl) { switch (bl->type) { @@ -262,7 +262,7 @@ int battle_delay_damage(int64 tick, int amotion, struct block_list *src, struct if ( !battle_config.delay_battle_damage || amotion <= 1 ) { map->freeblock_lock(); - status_fix_damage(src, target, damage, ddelay); // We have to seperate here between reflect damage and others [icescope] + status_fix_damage(src, target, damage, ddelay); // We have to separate here between reflect damage and others [icescope] if( attack_type && !status->isdead(target) && additional_effects ) skill->additional_effect(src, target, skill_id, skill_lv, attack_type, dmg_lv, timer->gettick()); if( dmg_lv > ATK_BLOCK && attack_type ) @@ -358,7 +358,7 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d } } } - if( tsc && tsc->count ) { //since an atk can only have one type let's optimise this a bit + if( tsc && tsc->count ) { //since an atk can only have one type let's optimize this a bit switch(atk_elem){ case ELE_FIRE: if( tsc->data[SC_SPIDERWEB]) { @@ -463,7 +463,7 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u damage = battle->calc_elefix(src, bl, skill_id, skill_lv, damage + eatk, nk, n_ele, s_ele, s_ele_, type == EQI_HAND_L, flag); /** - * In RE Shield Bommerang takes weapon element only for damage calculation, + * In RE Shield Boomerang takes weapon element only for damage calculation, * - resist calculation is always against neutral **/ if ( skill_id == CR_SHIELDBOOMERANG ) @@ -482,7 +482,7 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u } /*========================================== * Calculates the standard damage of a normal attack assuming it hits, - * it calculates nothing extra fancy, is needed for magnum break's WATK_ELEMENT bonus. [Skotlex] + * it calculates nothing extra fancy, is needed for magnum breaks WATK_ELEMENT bonus. [Skotlex] *------------------------------------------ * Pass damage2 as NULL to not calc it. * Flag values: @@ -567,7 +567,7 @@ int64 battle_calc_base_damage2(struct status_data *st, struct weapon_atk *wa, st else damage += st->batk; - //rodatazone says that Overrefine bonuses are part of baseatk + //rodatazone says that Overrefined bonuses are part of baseatk //Here we also apply the weapon_atk_rate bonus so it is correctly applied on left/right hands. if(sd) { if (type == EQI_HAND_L) { @@ -604,7 +604,7 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in nullpo_ret(sd); if((skill_lv = pc->checkskill(sd,AL_DEMONBANE)) > 0 && - target->type == BL_MOB && //This bonus doesnt work against players. + target->type == BL_MOB && //This bonus doesn't work against players. (battle->check_undead(st->race,st->def_ele) || st->race==RC_DEMON) ) damage += (int)(skill_lv*(3+sd->status.base_level/20.0)); //damage += (skill_lv * 3); @@ -676,7 +676,7 @@ int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,in case W_FIST: if((skill_lv = pc->checkskill(sd,TK_RUN)) > 0) damage += (skill_lv * 10); - // No break, fallthrough to Knuckles + // No break, fall through to Knuckles case W_KNUCKLE: if((skill_lv = pc->checkskill(sd,MO_IRONHAND)) > 0) damage += (skill_lv * 3); @@ -1272,9 +1272,9 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_ #else vit_def = def2; #endif - if((battle->check_undead(sstatus->race,sstatus->def_ele) || sstatus->race==RC_DEMON) && //This bonus already doesnt work vs players + if((battle->check_undead(sstatus->race,sstatus->def_ele) || sstatus->race==RC_DEMON) && //This bonus already doesn't work vs players src->type == BL_MOB && (i=pc->checkskill(tsd,AL_DP)) > 0) - vit_def += i*(int)(3 +(tsd->status.base_level+1)*0.04); // submitted by orn + vit_def += i*(int)(3 +(tsd->status.base_level+1)*0.04); // [orn] if( src->type == BL_MOB && (i=pc->checkskill(tsd,RA_RANGERMAIN))>0 && (sstatus->race == RC_BRUTE || sstatus->race == RC_FISH || sstatus->race == RC_PLANT) ) vit_def += i*5; @@ -1296,7 +1296,7 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_ #ifdef RENEWAL /** * RE DEF Reduction - * Pierce defence gains 1 atk per def/2 + * Pierce defense gains 1 atk per def/2 **/ if( def1 < -399 ) // it stops at -399 @@ -1384,7 +1384,7 @@ int battle_calc_chorusbonus(struct map_session_data *sd) { if (members < 3) return 0; // Bonus remains 0 unless 3 or more Minstrel's/Wanderer's are in the party. if (members > 7) - return 5; // Maximum effect possiable from 7 or more Minstrel's/Wanderer's + return 5; // Maximum effect possible from 7 or more Minstrel's/Wanderer's return members - 2; // Effect bonus from additional Minstrel's/Wanderer's if not above the max possible } @@ -2005,7 +2005,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block skillratio += 50 * skill_lv; break; case GS_BULLSEYE: - //Only works well against brute/demihumans non bosses. + //Only works well against brute/demi-humans non bosses. if((tst->race == RC_BRUTE || tst->race == RC_DEMIHUMAN) && !(tst->mode&MD_BOSS)) skillratio += 400; @@ -2117,7 +2117,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block RE_LVL_DMOD(150); break; /** - * GC Guilotine Cross + * GC Guillotine Cross **/ case GC_CROSSIMPACT: skillratio += 900 + 100 * skill_lv; @@ -2401,7 +2401,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block { int chorusbonus = battle->calc_chorusbonus(sd); skillratio += 300 + 200 * skill_lv; - //Chorus bonus dont count the first 2 Minstrel's/Wanderer's and only increases when their's 3 or more. [Rytech] + //Chorus bonus don't count the first 2 Minstrel's/Wanderer's and only increases when their's 3 or more. [Rytech] if (chorusbonus >= 1 && chorusbonus <= 5) skillratio += 100<<(chorusbonus-1); // 1->100; 2->200; 3->400; 4->800; 5->1600 RE_LVL_DMOD(100); @@ -2454,7 +2454,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block if( sc && sc->data[SC_BLAST_OPTION] ) skillratio += (sd ? sd->status.job_level * 5 : 0); break; - // Physical Elemantal Spirits Attack Skills + // Physical Elemental Spirits Attack Skills case EL_CIRCLE_OF_FIRE: case EL_FIRE_BOMB_ATK: case EL_STONE_RAIN: @@ -2557,8 +2557,8 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block return skillratio; } /*========================================== - * Check dammage trough status. - * ATK may be MISS, BLOCKED FAIL, reduc, increase, end status... + * Check damage trough status. + * ATK may be MISS, BLOCKED FAIL, reduce, increase, end status... * After this we apply bg/gvg reduction *------------------------------------------*/ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damage *d,int64 damage,uint16 skill_id,uint16 skill_lv) { @@ -2715,7 +2715,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam clif->skill_nodamage(bl, bl, RK_MILLENNIUMSHIELD, 1, 1); sce->val3 -= (int)cap_value(damage,INT_MIN,INT_MAX); // absorb damage d->dmg_lv = ATK_BLOCK; - sc_start(src,bl,SC_STUN,15,0,skill->get_time2(RK_MILLENNIUMSHIELD,sce->val1)); // There is a chance to be stuned when one shield is broken. + sc_start(src,bl,SC_STUN,15,0,skill->get_time2(RK_MILLENNIUMSHIELD,sce->val1)); // There is a chance to be stunned when one shield is broken. if( sce->val3 <= 0 ) { // Shield Down sce->val2--; if( sce->val2 > 0 ) { @@ -3029,7 +3029,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam short rate = 100; struct status_data *tstatus = status->get_status_data(bl); if ( !(flag&BF_SKILL) && (flag&BF_WEAPON) && damage > 0 && rnd()%100 < tsc->data[SC_POISONINGWEAPON]->val3 ) { - if ( tsc->data[SC_POISONINGWEAPON]->val1 == 9 ) // Oblivion Curse gives a 2nd success chance after the 1st one passes which is reduceable. [Rytech] + if ( tsc->data[SC_POISONINGWEAPON]->val1 == 9 ) // Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech] rate = 100 - tstatus->int_ * 4 / 5; sc_start(src,bl,tsc->data[SC_POISONINGWEAPON]->val2,rate,tsc->data[SC_POISONINGWEAPON]->val1,skill->get_time2(GC_POISONINGWEAPON,1) - (tstatus->vit + tstatus->luk) / 2 * 1000); } @@ -3046,7 +3046,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam /* no data claims these settings affect anything other than players */ if( damage && sd && bl->type == BL_PC ) { switch( skill_id ) { - //case PA_PRESSURE: /* pressure also belongs to this list but it doesn't reach this area -- so dont worry about it */ + //case PA_PRESSURE: /* pressure also belongs to this list but it doesn't reach this area -- so don't worry about it */ case HW_GRAVITATION: case NJ_ZENYNAGE: case KO_MUCHANAGE: @@ -3254,7 +3254,7 @@ int battle_blewcount_bonus(struct map_session_data *sd, uint16 skill_id) { int i; if (!sd->skillblown[0].id) return 0; - //Apply the bonus blewcount. [Skotlex] + //Apply the bonus blow count. [Skotlex] for (i = 0; i < ARRAYLENGTH(sd->skillblown) && sd->skillblown[i].id; i++) { if (sd->skillblown[i].id == skill_id) return sd->skillblown[i].val; @@ -3335,7 +3335,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list ad.flag |= battle->range_type(src, target, skill_id, skill_lv); flag.infdef=(tstatus->mode&MD_PLANT?1:0); if( !flag.infdef && target->type == BL_SKILL && ((TBL_SKILL*)target)->group->unit_id == UNT_REVERBERATION ) - flag.infdef = 1; // Reberberation takes 1 damage + flag.infdef = 1; // Reverberation takes 1 damage switch(skill_id) { case MG_FIREWALL: @@ -3600,7 +3600,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list } /*========================================== - * Calculate Misc dammage for skill_id + * Calculate Misc damage for skill_id *------------------------------------------*/ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *target,uint16 skill_id,uint16 skill_lv,int mflag) { int temp; @@ -3908,7 +3908,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * { if (battle_config.agi_penalty_type == 1) flee = (flee * (100 - (attacker_count - (battle_config.agi_penalty_count - 1))*battle_config.agi_penalty_num))/100; - else //asume type 2: absolute reduction + else // assume type 2: absolute reduction flee -= (attacker_count - (battle_config.agi_penalty_count - 1))*battle_config.agi_penalty_num; if(flee < 1) flee = 1; } @@ -4046,7 +4046,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list unsigned lh : 1; //Attack considers left hand (wd.damage2) unsigned weapon : 1; //It's a weapon attack (consider VVS, and all that) #ifdef RENEWAL - unsigned tdef : 1; //Total defence reduction + unsigned tdef : 1; //Total defense reduction #endif } flag; @@ -4065,7 +4065,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list #endif ?1:0); if( !flag.infdef && target->type == BL_SKILL && ((TBL_SKILL*)target)->group->unit_id == UNT_REVERBERATION ) - flag.infdef = 1; // Reberberation takes 1 damage + flag.infdef = 1; // Reverberation takes 1 damage //Initial Values wd.type=0; //Normal attack @@ -5694,7 +5694,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t /** * We need to calculate the DMG before the hp reduction, because it can kill the source. - * For futher information: bugreport:4950 + * For further information: bugreport:4950 **/ ret_val = (damage_lv)skill->attack(BF_WEAPON,src,src,target,PA_SACRIFICE,skill_lv,tick,0); @@ -6058,7 +6058,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f if(((((TBL_MOB*)target)->special_state.ai == 2 || //Marine Spheres (((TBL_MOB*)target)->special_state.ai == 3 && battle_config.summon_flora&1)) && //Floras s_bl->type == BL_PC && src->type != BL_MOB) || (((TBL_MOB*)target)->special_state.ai == 4 && t_bl->id != s_bl->id)) //Zanzoe - { //Targettable by players + { //Targetable by players state |= BCT_ENEMY; strip_enemy = 0; } @@ -6137,7 +6137,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f sd = BL_CAST(BL_PC, t_bl); if( sd->state.monster_ignore && flag&BCT_ENEMY ) - return 0; // Global inminuty only to Attacks + return 0; // Global immunity only to Attacks if( sd->status.karma && s_bl->type == BL_PC && ((TBL_PC*)s_bl)->status.karma ) state |= BCT_ENEMY; // Characters with bad karma may fight amongst them if( sd->state.killable ) { @@ -6231,7 +6231,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f break; } default: - //Need some sort of default behaviour for unhandled types. + //Need some sort of default behavior for unhandled types. if (t_bl->type != s_bl->type) state |= BCT_ENEMY; break; @@ -6351,7 +6351,7 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range return true; // No need for path checking. if( d > AREA_SIZE ) - return false; // Avoid targetting objects beyond your range of sight. + return false; // Avoid targeting objects beyond your range of sight. return path->search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL); } diff --git a/src/map/battle.h b/src/map/battle.h index 433dca95f..fc916597d 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -79,7 +79,7 @@ enum e_battle_check_target { //New definitions [Skotlex] * Structures **/ -// dammage structure +// damage structure struct Damage { int64 damage,damage2; //right, left dmg int type,div_; //chk clif_damage for type @TODO add an enum ? ; nb of hit @@ -489,7 +489,7 @@ enum e_battle_config_idletime { BCIDLE_ATCOMMAND = 0x200, }; -// Dammage delayed info +// Damage delayed info struct delay_damage { int src_id; int target_id; @@ -571,7 +571,7 @@ struct battle_interface { int (*check_target) (struct block_list *src, struct block_list *target,int flag); /* is src and bl within range? */ bool (*check_range) (struct block_list *src,struct block_list *bl,int range); - /* consume amo for this skill and lv */ + /* consume ammo for this skill and lv */ void (*consume_ammo) (struct map_session_data* sd, int skill_id, int lv); int (*get_targeted_sub) (struct block_list *bl, va_list ap); int (*get_enemy_sub) (struct block_list *bl, va_list ap); diff --git a/src/map/battleground.c b/src/map/battleground.c index 4558f32c3..f7131513d 100644 --- a/src/map/battleground.c +++ b/src/map/battleground.c @@ -541,7 +541,7 @@ void bg_match_over(struct bg_arena *arena, bool canceled) { bg->queue_pc_cleanup(sd); } if( canceled ) - clif->colormes(sd->fd,COLOR_RED,"BG Match Cancelled: not enough players"); + clif->colormes(sd->fd,COLOR_RED,"BG Match Canceled: not enough players"); else { pc_setglobalreg(sd, script->add_str(arena->delay_var), (unsigned int)time(NULL)); } @@ -579,7 +579,7 @@ void bg_begin(struct bg_arena *arena) { if( bg->afk_timer_id == INVALID_TIMER && bg->mafksec > 0 ) bg->afk_timer_id = timer->add(timer->gettick()+10000,bg->afk_timer,0,0); - /* TODO: make this a arena-independant var? or just .@? */ + /* TODO: make this a arena-independent var? or just .@? */ mapreg->setreg(script->add_str("$@bg_queue_id"),arena->queue_id); mapreg->setregstr(script->add_str("$@bg_delay_var$"),bg->gdelay_var); diff --git a/src/map/chat.c b/src/map/chat.c index 40a9d2348..cd7b5f811 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -32,7 +32,7 @@ struct chat_data* chat_createchat(struct block_list* bl, const char* title, cons struct chat_data* cd; nullpo_retr(NULL, bl); - /* Given the overhead and the numerous instances (npc allocatted or otherwise) wouldn't it be benefitial to have it use ERS? [Ind] */ + /* Given the overhead and the numerous instances (npc allocated or otherwise) wouldn't it be beneficial to have it use ERS? [Ind] */ cd = (struct chat_data *) aMalloc(sizeof(struct chat_data)); safestrncpy(cd->title, title, sizeof(cd->title)); diff --git a/src/map/chrif.c b/src/map/chrif.c index a69cca573..54cc139f4 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -55,7 +55,7 @@ struct chrif_interface chrif_s; //2b03: Incoming, clif_charselectok -> '' (i think its the packet after enterworld?) (not sure) //2b04: Incoming, chrif_recvmap -> 'getting maps from charserver of other mapserver's' //2b05: Outgoing, chrif_changemapserver -> 'Tell the charserver the mapchange / quest for ok...' -//2b06: Incoming, chrif_changemapserverack -> 'awnser of 2b05, ok/fail, data: dunno^^' +//2b06: Incoming, chrif_changemapserverack -> 'answer of 2b05, ok/fail, data: dunno^^' //2b07: Outgoing, chrif_removefriend -> 'Tell charserver to remove friend_id from char_id friend list' //2b08: Outgoing, chrif_searchcharid -> '...' //2b09: Incoming, map_addchariddb -> 'Adds a name to the nick db' @@ -79,7 +79,7 @@ struct chrif_interface chrif_s; //2b1b: Incoming, chrif_recvfamelist -> 'Receive fame ranking lists' //2b1c: Outgoing, chrif_save_scdata -> 'Send sc_data of player for saving.' //2b1d: Incoming, chrif_load_scdata -> 'received sc_data of player for loading.' -//2b1e: Incoming, chrif_update_ip -> 'Reqest forwarded from char-server for interserver IP sync.' [Lance] +//2b1e: Incoming, chrif_update_ip -> 'Request forwarded from char-server for interserver IP sync.' [Lance] //2b1f: Incoming, chrif_disconnectplayer -> 'disconnects a player (aid X) with the message XY ... 0x81 ..' [Sirius] //2b20: Incoming, chrif_removemap -> 'remove maps of a server (sample: its going offline)' [Sirius] //2b21: Incoming, chrif_save_ack. Returned after a character has been "final saved" on the char-server. [Skotlex] @@ -393,7 +393,7 @@ bool chrif_changemapserver(struct map_session_data* sd, uint32 ip, uint16 port) return true; } -/// map-server change request acknowledgement (positive or negative) +/// map-server change request acknowledgment (positive or negative) /// R 2b06 .L .L .L .L .W .W .W .L .W bool chrif_changemapserverack(int account_id, int login_id1, int login_id2, int char_id, short map_index, short x, short y, uint32 ip, uint16 port) { struct auth_node *node; @@ -853,9 +853,9 @@ void chrif_changedsex(int fd) { // Path to activate this response: // Map(start) (0x2b0e) -> Char(0x2727) -> Login // Login(0x2723) [ALL] -> Char (0x2b0d)[ALL] -> Map (HERE) - // Char will usually be "logged in" despite being forced to log-out in the begining + // Char will usually be "logged in" despite being forced to log-out in the beginning // of this process, but there's no need to perform map-server specific response - // as everything should've been changed through char-server [Panikon] + // as everything should been changed through char-server [Panikon] } /*========================================== * Request Char Server to Divorce Players @@ -944,14 +944,14 @@ void chrif_idbanned(int fd) { } sd->login_id1++; // change identify, because if player come back in char within the 5 seconds, he can change its characters - if (RFIFOB(fd,6) == 0) { // 0: change of statut + if (RFIFOB(fd,6) == 0) { // 0: change of status int ret_status = RFIFOL(fd,7); // status or final date of a banishment if(0message(sd->fd, msg_txt(411+ret_status)); // Message IDs (for search convenience): 412, 413, 414, 415, 416, 417, 418, 419, 420 else if(ret_status==100) clif->message(sd->fd, msg_txt(421)); else - clif->message(sd->fd, msg_txt(420)); //"Your account has not more authorised." + clif->message(sd->fd, msg_txt(420)); //"Your account has not more authorized." } else if (RFIFOB(fd,6) == 1) { // 1: ban time_t timestamp; char tmpstr[2048]; @@ -1206,7 +1206,7 @@ bool chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) { /*========================================= - * Tell char-server charcter disconnected [Wizputer] + * Tell char-server character disconnected [Wizputer] *-----------------------------------------*/ bool chrif_char_offline_nsd(int account_id, int char_id) { chrif_check(false); @@ -1247,7 +1247,7 @@ bool chrif_char_reset_offline(void) { } /*========================================= - * Tell char-server charcter is online [Wizputer] + * Tell char-server character is online [Wizputer] *-----------------------------------------*/ bool chrif_char_online(struct map_session_data *sd) { chrif_check(false); @@ -1533,7 +1533,7 @@ void chrif_send_report(char* buf, int len) { } /** - * Sends a single scdata for saving into char server, meant to ensure integrity of durationless conditions + * Sends a single scdata for saving into char server, meant to ensure integrity of duration-less conditions **/ void chrif_save_scdata_single(int account_id, int char_id, short type, struct status_change_entry *sce) { @@ -1555,7 +1555,7 @@ void chrif_save_scdata_single(int account_id, int char_id, short type, struct st } /** - * Sends a single scdata deletion request into char server, meant to ensure integrity of durationless conditions + * Sends a single scdata deletion request into char server, meant to ensure integrity of duration-less conditions **/ void chrif_del_scdata_single(int account_id, int char_id, short type) { diff --git a/src/map/chrif.h b/src/map/chrif.h index 661ba8f84..51ab0e9b9 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -53,7 +53,7 @@ struct chrif_interface { int other_mapserver_count; //Holds count of how many other map servers are online (apart of this instance) [Skotlex] /* */ - struct eri *auth_db_ers; //For reutilizing player login structures. + struct eri *auth_db_ers; //For re-utilizing player login structures. DBMap* auth_db; // int id -> struct auth_node* /* */ int packet_len_table[CHRIF_PACKET_LEN_TABLE_SIZE]; diff --git a/src/map/clif.c b/src/map/clif.c index d1ae2eb07..d8714dda0 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2588,7 +2588,7 @@ void clif_cartlist(struct map_session_data *sd) { /// Removes cart (ZC_CARTOFF). /// 012b -/// Client behaviour: +/// Client behavior: /// Closes the cart storage and removes all it's items from memory. /// The Num & Weight values of the cart are left untouched and the cart is NOT removed. void clif_clearcart(int fd) @@ -5047,7 +5047,7 @@ void clif_skillcastcancel(struct block_list* bl) /// 4 = "no party" MsgStringTable[163] /// 5 = "no shout" MsgStringTable[164] /// 6 = "no PKing" MsgStringTable[165] -/// 7 = "no alligning" MsgStringTable[383] +/// 7 = "no aligning" MsgStringTable[383] /// ? = ignored /// cause: /// 0 = "not enough skill level" MsgStringTable[214] (AL_WARP) @@ -5425,7 +5425,7 @@ void clif_skill_estimation(struct map_session_data *sd,struct block_list *dst) { } -/// Presents a textual list of producable items (ZC_MAKABLEITEMLIST). +/// Presents a textual list of producible items (ZC_MAKABLEITEMLIST). /// 018d .W { .W { .W }*3 }* /// material id: /// unused by the client @@ -5467,7 +5467,7 @@ void clif_skill_produce_mix_list(struct map_session_data *sd, int skill_id , int } -/// Present a list of producable items (ZC_MAKINGITEM_LIST). +/// Present a list of producible items (ZC_MAKINGITEM_LIST). /// 025a .W .W { .W }* /// mk type: /// 1 = cooking @@ -5603,7 +5603,7 @@ void clif_displaymessage(const int fd, const char* mes) { if ( ( len = strnlen(mes, 255) ) > 0 ) { // don't send a void message (it's not displaying on the client chat). @help can send void line. WFIFOHEAD(fd, 5 + len); WFIFOW(fd,0) = 0x8e; - WFIFOW(fd,2) = 5 + len; // 4 + len + NULL teminate + WFIFOW(fd,2) = 5 + len; // 4 + len + NULL terminate safestrncpy((char *)WFIFOP(fd,4), mes, len + 1); WFIFOSET(fd, 5 + len); } @@ -5632,7 +5632,7 @@ void clif_displaymessage2(const int fd, const char* mes) { } else { WFIFOHEAD(fd, 5 + len); WFIFOW(fd,0) = 0x8e; - WFIFOW(fd,2) = 5 + len; // 4 + len + NULL teminate + WFIFOW(fd,2) = 5 + len; // 4 + len + NULL terminate safestrncpy((char *)WFIFOP(fd,4), line, len + 1); WFIFOSET(fd, 5 + len); } @@ -5669,7 +5669,7 @@ void clif_displaymessage_sprintf(const int fd, const char* mes, ...) { /* */ WFIFOW(fd,0) = 0x8e; - WFIFOW(fd,2) = 5 + len; // 4 + len + NULL teminate + WFIFOW(fd,2) = 5 + len; // 4 + len + NULL terminate WFIFOSET(fd, 5 + len); } @@ -5924,8 +5924,8 @@ void clif_wis_message(int fd, const char* nick, const char* mes, size_t mes_len) /// Inform the player about the result of his whisper action (ZC_ACK_WHISPER). /// 0098 .B /// result: -/// 0 = success to send wisper -/// 1 = target character is not loged in +/// 0 = success to send whisper +/// 1 = target character is not logged in /// 2 = ignored by target /// 3 = everyone ignored by target void clif_wis_end(int fd, int flag) { @@ -6191,7 +6191,7 @@ void clif_item_refine_list(struct map_session_data *sd) /// Notification of an auto-casted skill (ZC_AUTORUN_SKILL). -/// 0147 .W .L .W .W .W .24B .B +/// 0147 .W .L .W .W .W .24B .B void clif_item_skill(struct map_session_data *sd,uint16 skill_id,uint16 skill_lv) { int fd; @@ -7276,7 +7276,7 @@ void clif_mvp_noitem(struct map_session_data* sd) /// 0 = "Guild has been created." /// 1 = "You are already in a Guild." /// 2 = "That Guild Name already exists." -/// 3 = "You need the neccessary item to create a Guild." +/// 3 = "You need the necessary item to create a Guild." void clif_guild_created(struct map_session_data *sd,int flag) { int fd; @@ -7669,7 +7669,7 @@ void clif_guild_emblem_area(struct block_list* bl) /// Sends guild skills (ZC_GUILD_SKILLINFO). -/// 0162 .W .W { .W .L .W .W .W .24B .B }* +/// 0162 .W .W { .W .L .W .W .W .24B .B }* void clif_guild_skillinfo(struct map_session_data* sd) { int fd; @@ -8186,7 +8186,7 @@ void clif_manner_message(struct map_session_data* sd, uint32 type) } -/// Followup to 0x14a type 3/5, informs who did the manner adjustment action (ZC_NOTIFY_MANNER_POINT_GIVEN). +/// Follow-up to 0x14a type 3/5, informs who did the manner adjustment action (ZC_NOTIFY_MANNER_POINT_GIVEN). /// 014b .B .24B /// type: /// 0 = positive (unmute) @@ -8277,7 +8277,7 @@ void clif_playBGM(struct map_session_data* sd, const char* name) /// term: /// unknown purpose, only relevant to act = 1 /// npc id: -/// The accustic direction of the sound is determined by the +/// The acoustic direction of the sound is determined by the /// relative position of the NPC to the player (3D sound). void clif_soundeffect(struct map_session_data* sd, struct block_list* bl, const char* name, int type) { @@ -8643,7 +8643,7 @@ void clif_charnameack (int fd, struct block_list *bl) return; } - // if no receipient specified just update nearby clients + // if no recipient specified just update nearby clients if (fd == 0) clif->send(buf, packet_len(cmd), bl, AREA); else { @@ -8738,7 +8738,7 @@ void clif_slide(struct block_list *bl, int x, int y) /// 008d .W .L .?B void clif_disp_overhead(struct block_list *bl, const char* mes) { - unsigned char buf[256]; //This should be more than sufficient, the theorical max is CHAT_SIZE + 8 (pads and extra inserted crap) + unsigned char buf[256]; //This should be more than sufficient, the theoretical max is CHAT_SIZE + 8 (pads and extra inserted crap) size_t len_mes = strlen(mes)+1; //Account for \0 if (len_mes > sizeof(buf)-8) { @@ -8846,7 +8846,7 @@ void clif_starskill(struct map_session_data* sd, const char* mapname, int monste } /*========================================== - * Info about Star Glaldiator save map [Komurka] + * Info about Star Gladiator save map [Komurka] * type: 1: Information, 0: Map registered *------------------------------------------*/ void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsigned char type) @@ -8858,7 +8858,7 @@ void clif_feel_info(struct map_session_data* sd, unsigned char feel_level, unsig } /*========================================== - * Info about Star Glaldiator hate mob [Komurka] + * Info about Star Gladiator hate mob [Komurka] * type: 1: Register mob, 0: Information. *------------------------------------------*/ void clif_hate_info(struct map_session_data *sd, unsigned char hate_level,int class_, unsigned char type) @@ -9052,7 +9052,7 @@ bool clif_process_message(struct map_session_data *sd, int format, char **name_, if( strncmp(name, sd->status.name, namelen) || // the text must start with the speaker's name name[namelen] != ' ' || name[namelen+1] != ':' || name[namelen+2] != ' ' ) // followed by ' : ' { - //Hacked message, or infamous "client desynch" issue where they pick one char while loading another. + //Hacked message, or infamous "client desynchronize" issue where they pick one char while loading another. ShowWarning("clif_process_message: Player '%s' sent a message using an incorrect name! Forcing a relog...\n", sd->status.name); set_eof(fd); // Just kick them out to correct it. return false; @@ -10323,7 +10323,7 @@ void clif_hercules_chsys_quit(struct map_session_data *sd) { /// 1 = pick up item /// 2 = sit down /// 3 = stand up -/// 7 = continous attack +/// 7 = continuous attack /// 12 = (touch skill?) /// There are various variants of this packet, some of them have padding between fields. void clif_parse_ActionRequest(int fd, struct map_session_data *sd) @@ -11037,7 +11037,7 @@ void clif_parse_ChatLeave(int fd, struct map_session_data* sd) } -//Handles notifying asker and rejecter of what has just ocurred. +//Handles notifying asker and rejecter of what has just occurred. //Type is used to determine the correct msg_txt to use: //0: void clif_noask_sub(struct map_session_data *src, struct map_session_data *target, int type) { @@ -12239,7 +12239,7 @@ void clif_parse_PartyChangeLeader(int fd, struct map_session_data* sd) { /// Party Booking in KRO [Spiria] /// -/// Request to register a party booking advertisment (CZ_PARTY_BOOKING_REQ_REGISTER). +/// Request to register a party booking advertisement (CZ_PARTY_BOOKING_REQ_REGISTER). /// 0802 .W .W { .W }*6 void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) { @@ -12259,7 +12259,7 @@ void clif_parse_PartyBookingRegisterReq(int fd, struct map_session_data* sd) } -/// Result of request to register a party booking advertisment (ZC_PARTY_BOOKING_ACK_REGISTER). +/// Result of request to register a party booking advertisement (ZC_PARTY_BOOKING_ACK_REGISTER). /// 0803 .W /// result: /// 0 = success @@ -12280,7 +12280,7 @@ void clif_PartyBookingRegisterAck(struct map_session_data *sd, int flag) } -/// Request to search for party booking advertisments (CZ_PARTY_BOOKING_REQ_SEARCH). +/// Request to search for party booking advertisement (CZ_PARTY_BOOKING_REQ_SEARCH). /// 0804 .W .W .W .L .W void clif_parse_PartyBookingSearchReq(int fd, struct map_session_data* sd) { @@ -12331,7 +12331,7 @@ void clif_PartyBookingSearchAck(int fd, struct party_booking_ad_info** results, } -/// Request to delete own party booking advertisment (CZ_PARTY_BOOKING_REQ_DELETE). +/// Request to delete own party booking advertisement (CZ_PARTY_BOOKING_REQ_DELETE). /// 0806 void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd) { @@ -12344,7 +12344,7 @@ void clif_parse_PartyBookingDeleteReq(int fd, struct map_session_data* sd) } -/// Result of request to delete own party booking advertisment (ZC_PARTY_BOOKING_ACK_DELETE). +/// Result of request to delete own party booking advertisement (ZC_PARTY_BOOKING_ACK_DELETE). /// 0807 .W /// result: /// 0 = success @@ -12366,7 +12366,7 @@ void clif_PartyBookingDeleteAck(struct map_session_data* sd, int flag) } -/// Request to update party booking advertisment (CZ_PARTY_BOOKING_REQ_UPDATE). +/// Request to update party booking advertisement (CZ_PARTY_BOOKING_REQ_UPDATE). /// 0808 { .W }*6 void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd) { @@ -12384,7 +12384,7 @@ void clif_parse_PartyBookingUpdateReq(int fd, struct map_session_data* sd) } -/// Notification about new party booking advertisment (ZC_PARTY_BOOKING_NOTIFY_INSERT). +/// Notification about new party booking advertisement (ZC_PARTY_BOOKING_NOTIFY_INSERT). /// 0809 .L .24B .L .W .W { .W }*6 void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad) { @@ -12410,7 +12410,7 @@ void clif_PartyBookingInsertNotify(struct map_session_data* sd, struct party_boo } -/// Notification about updated party booking advertisment (ZC_PARTY_BOOKING_NOTIFY_UPDATE). +/// Notification about updated party booking advertisement (ZC_PARTY_BOOKING_NOTIFY_UPDATE). /// 080a .L { .W }*6 void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad) { @@ -12431,7 +12431,7 @@ void clif_PartyBookingUpdateNotify(struct map_session_data* sd, struct party_boo } -/// Notification about deleted party booking advertisment (ZC_PARTY_BOOKING_NOTIFY_DELETE). +/// Notification about deleted party booking advertisement (ZC_PARTY_BOOKING_NOTIFY_DELETE). /// 080b .L void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index) { @@ -12450,7 +12450,7 @@ void clif_PartyBookingDeleteNotify(struct map_session_data* sd, int index) /// Modified version of Party Booking System for 2012-04-10 or 2012-04-18 (RagexeRE). /// Code written by mkbu95, Spiria, Yommy and Ind -/// Request to register a party booking advertisment (CZ_PARTY_RECRUIT_REQ_REGISTER). +/// Request to register a party booking advertisement (CZ_PARTY_RECRUIT_REQ_REGISTER). /// 08e5 .W .37B void clif_parse_PartyRecruitRegisterReq(int fd, struct map_session_data* sd) { @@ -12497,7 +12497,7 @@ void clif_PartyRecruitSearchAck(int fd, struct party_booking_ad_info** results, #endif } -/// Result of request to register a party booking advertisment (ZC_PARTY_RECRUIT_ACK_REGISTER). +/// Result of request to register a party booking advertisement (ZC_PARTY_RECRUIT_ACK_REGISTER). /// 08e6 .W /// result: /// 0 = success @@ -12517,7 +12517,7 @@ void clif_PartyRecruitRegisterAck(struct map_session_data *sd, int flag) #endif } -/// Request to search for party booking advertisments (CZ_PARTY_RECRUIT_REQ_SEARCH). +/// Request to search for party booking advertisement (CZ_PARTY_RECRUIT_REQ_SEARCH). /// 08e7 .W .W .L .W void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data* sd) { @@ -12533,7 +12533,7 @@ void clif_parse_PartyRecruitSearchReq(int fd, struct map_session_data* sd) #endif } -/// Request to delete own party booking advertisment (CZ_PARTY_RECRUIT_REQ_DELETE). +/// Request to delete own party booking advertisement (CZ_PARTY_RECRUIT_REQ_DELETE). /// 08e9 void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data* sd) { @@ -12545,7 +12545,7 @@ void clif_parse_PartyRecruitDeleteReq(int fd, struct map_session_data* sd) #endif } -/// Result of request to delete own party booking advertisment (ZC_PARTY_RECRUIT_ACK_DELETE). +/// Result of request to delete own party booking advertisement (ZC_PARTY_RECRUIT_ACK_DELETE). /// 08ea .W /// result: /// 0 = success @@ -12566,7 +12566,7 @@ void clif_PartyRecruitDeleteAck(struct map_session_data* sd, int flag) #endif } -/// Request to update party booking advertisment (CZ_PARTY_RECRUIT_REQ_UPDATE). +/// Request to update party booking advertisement (CZ_PARTY_RECRUIT_REQ_UPDATE). /// 08eb .37B void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd) { @@ -12581,7 +12581,7 @@ void clif_parse_PartyRecruitUpdateReq(int fd, struct map_session_data *sd) #endif } -/// Notification about new party booking advertisment (ZC_PARTY_RECRUIT_NOTIFY_INSERT). +/// Notification about new party booking advertisement (ZC_PARTY_RECRUIT_NOTIFY_INSERT). /// 08ec .L .L .24B .W .37B void clif_PartyRecruitInsertNotify(struct map_session_data* sd, struct party_booking_ad_info* pb_ad) { @@ -12603,7 +12603,7 @@ void clif_PartyRecruitInsertNotify(struct map_session_data* sd, struct party_boo #endif } -/// Notification about updated party booking advertisment (ZC_PARTY_RECRUIT_NOTIFY_UPDATE). +/// Notification about updated party booking advertisement (ZC_PARTY_RECRUIT_NOTIFY_UPDATE). /// 08ed .L .37B void clif_PartyRecruitUpdateNotify(struct map_session_data *sd, struct party_booking_ad_info* pb_ad) { @@ -12620,7 +12620,7 @@ void clif_PartyRecruitUpdateNotify(struct map_session_data *sd, struct party_boo #endif } -/// Notification about deleted party booking advertisment (ZC_PARTY_RECRUIT_NOTIFY_DELETE). +/// Notification about deleted party booking advertisement (ZC_PARTY_RECRUIT_NOTIFY_DELETE). /// 08ee .L void clif_PartyRecruitDeleteNotify(struct map_session_data* sd, int index) { @@ -13172,7 +13172,7 @@ void clif_parse_GuildChangeNotice(int fd, struct map_session_data* sd) if(!sd->state.gmaster_flag) return; - // compensate for some client defects when using multilanguage mode + // compensate for some client defects when using multilingual mode if (msg1[0] == '|' && msg1[3] == '|') msg1+= 3; // skip duplicate marker if (msg2[0] == '|' && msg2[3] == '|') msg2+= 3; // skip duplicate marker if (msg2[0] == '|') msg2[strnlen(msg2, MAX_GUILDMES2)-1] = '\0'; // delete extra space at the end of string @@ -13612,7 +13612,7 @@ void clif_parse_GMRecall2(int fd, struct map_session_data* sd) { /// Request to execute GM commands. /// usage: /// /item n - summon n monster or acquire n item/s -/// /item money - grants 2147483647 zenies +/// /item money - grants 2147483647 Zeny /// /item whereisboss - locate boss mob in current map.(not yet implemented) /// /item regenboss_n t - regenerate n boss monster by t millisecond.(not yet implemented) /// /item onekillmonster - toggle an ability to kill mobs in one hit.(not yet implemented) @@ -13993,7 +13993,7 @@ void clif_friendslist_toggle(struct map_session_data *sd,int account_id, int cha } -//Subfunction called from clif_foreachclient to toggle friends on/off [Skotlex] +//Sub-function called from clif_foreachclient to toggle friends on/off [Skotlex] int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap) { int account_id, char_id, online; @@ -14342,7 +14342,7 @@ void clif_parse_ranklist(int fd, struct map_session_data *sd) { case RANKTYPE_BLACKSMITH: case RANKTYPE_ALCHEMIST: case RANKTYPE_TAEKWON: - clif->ranklist(sd, type); // pk_list unsuported atm + clif->ranklist(sd, type); // pk_list unsupported atm break; } } @@ -14672,7 +14672,7 @@ void clif_check(int fd, struct map_session_data* pl_sd) { WFIFOW(fd,34) = pl_sd->battle_status.flee2/10; WFIFOW(fd,36) = pl_sd->battle_status.cri/10; WFIFOW(fd,38) = (2000-pl_sd->battle_status.amotion)/10; // aspd - WFIFOW(fd,40) = 0; // FIXME: What is 'plusASPD' supposed to be? Maybe adelay? + WFIFOW(fd,40) = 0; // FIXME: What is 'plusASPD' supposed to be? Maybe a delay? WFIFOSET(fd,packet_len(0x214)); } @@ -14737,7 +14737,7 @@ void clif_Mail_getattachment(int fd, uint8 flag) /// 0249 .B /// result: /// 0 = success -/// 1 = recipinent does not exist +/// 1 = recipient does not exist void clif_Mail_send(int fd, bool fail) { WFIFOHEAD(fd,packet_len(0x249)); @@ -16068,7 +16068,7 @@ void clif_mercenary_info(struct map_session_data *sd) { /// Mercenary skill tree (ZC_MER_SKILLINFO_LIST). -/// 029d .W { .W .L .W .W .W .24B .B }* +/// 029d .W { .W .L .W .W .W .24B .B }* void clif_mercenary_skillblock(struct map_session_data *sd) { struct mercenary_data *md; @@ -17142,7 +17142,7 @@ void clif_parse_debug(int fd,struct map_session_data *sd) { } /*========================================== * Server tells client to display a window similar to Magnifier (item) one - * Server populates the window with avilable elemental converter options according to player's inventory + * Server populates the window with available elemental converter options according to player's inventory *------------------------------------------*/ int clif_elementalconverter_list(struct map_session_data *sd) { int i,c,view,fd; @@ -17587,7 +17587,7 @@ void clif_parse_CashShopSchedule(int fd, struct map_session_data *sd) { } void clif_parse_CashShopBuy(int fd, struct map_session_data *sd) { unsigned short limit = RFIFOW(fd, 4), i, j; - unsigned int kafra_pay = RFIFOL(fd, 6);// [Ryuuzaki] - These are free cash points (strangely #CASH = main cash curreny for us, confusing) + unsigned int kafra_pay = RFIFOL(fd, 6);// [Ryuuzaki] - These are free cash points (strangely #CASH = main cash currently for us, confusing) if( map->list[sd->bl.m].flag.nocashshop ) { clif->colormes(fd,COLOR_RED,msg_txt(1489)); //Cash Shop is disabled in this map diff --git a/src/map/clif.h b/src/map/clif.h index 7b27e1fe6..e1af44881 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -66,7 +66,7 @@ typedef enum send_target { AREA, // area AREA_WOS, // area, without self AREA_WOC, // area, without chatrooms - AREA_WOSC, // area, without own chatroom + AREA_WOSC, // area, without own chatrooms AREA_CHAT_WOC, // hearable area, without chatrooms CHAT, // current chatroom CHAT_WOS, // current chatroom, without self diff --git a/src/map/elemental.c b/src/map/elemental.c index b414d5b9f..7ffeea410 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.c @@ -505,7 +505,7 @@ int elemental_change_mode_ack(struct elemental_data *ed, int mode) { else unit->skilluse_id(&ed->bl,bl->id,skill_id,skill_lv); - ed->target_id = 0; // Reset target after casting the skill to avoid continious attack. + ed->target_id = 0; // Reset target after casting the skill to avoid continuous attack. return 1; } @@ -529,7 +529,7 @@ int elemental_change_mode(struct elemental_data *ed, int mode) { else if( mode == EL_MODE_ASSIST ) mode = EL_SKILLMODE_ASSIST; // Assist spirit mode -> Assist spirit skill. else mode = EL_SKILLMODE_PASIVE; // Passive spirit mode -> Passive spirit skill. - // Use a skill inmediately after every change mode. + // Use a skill immediately after every change mode. if( mode != EL_SKILLMODE_AGGRESSIVE ) elemental->change_mode_ack(ed,mode); return 1; diff --git a/src/map/guild.c b/src/map/guild.c index 4bf9c9da0..209f29103 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -61,7 +61,7 @@ int guild_skill_get_max (int id) { return guild->skill_tree[id-GD_SKILLBASE].max; } -// Retrive skill_lv learned by guild +// Retrieve skill_lv learned by guild int guild_checkskill(struct guild *g, int id) { int idx = id - GD_SKILLBASE; if (idx < 0 || idx >= MAX_GUILDSKILL) @@ -764,7 +764,7 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag) { return 0; if(sd==NULL || sd->guild_invite==0){ - // cancel if player not present or invalide guild_id invitation + // cancel if player not present or invalid guild_id invitation if (flag == 0) { ShowError("guild: member added error %d is not online\n",account_id); intif->guild_leave(guild_id,account_id,char_id,0,"** Data Error **"); @@ -882,7 +882,7 @@ int guild_member_withdraw(int guild_id, int account_id, int char_id, int flag, c online_member_sd = guild->getavailablesd(g); if(online_member_sd == NULL) - return 0; // noone online to inform + return 0; // no one online to inform #ifdef GP_BOUND_ITEMS //Guild bound item check @@ -2373,7 +2373,7 @@ void guild_defaults(void) { guild->agit_end = guild_agit_end; guild->agit2_start = guild_agit2_start; guild->agit2_end = guild_agit2_end; - /* guild flag cachin */ + /* guild flag caching */ guild->flag_add = guild_flag_add; guild->flag_remove = guild_flag_remove; guild->flags_clear = guild_flags_clear; diff --git a/src/map/homunculus.c b/src/map/homunculus.c index b6a83d1cb..8c47226db 100644 --- a/src/map/homunculus.c +++ b/src/map/homunculus.c @@ -809,7 +809,7 @@ bool homunculus_call(struct map_session_data *sd) { return true; } -// Recv homunculus data from char server +// Receive homunculus data from char server bool homunculus_recv_data(int account_id, struct s_homunculus *sh, int flag) { struct map_session_data *sd; struct homun_data *hd; @@ -1157,7 +1157,7 @@ bool homunculus_read_skill_db_sub(char* split[], int columns, int current) { classid = atoi(split[0]) - HM_CLASS_BASE; if ( classid >= MAX_HOMUNCULUS_CLASS ) { - ShowWarning("homunculus_read_skill_db_sub: Invalud homunculus class %d.\n", atoi(split[0])); + ShowWarning("homunculus_read_skill_db_sub: Invalid homunculus class %d.\n", atoi(split[0])); return false; } diff --git a/src/map/intif.c b/src/map/intif.c index 042896f4f..4dd0fa448 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -238,7 +238,7 @@ int intif_wis_replay(int id, int flag) WFIFOHEAD(inter_fd,7); WFIFOW(inter_fd,0) = 0x3002; WFIFOL(inter_fd,2) = id; - WFIFOB(inter_fd,6) = flag; // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target + WFIFOB(inter_fd,6) = flag; // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target WFIFOSET(inter_fd,7); if (battle_config.etc_log) @@ -387,7 +387,7 @@ int intif_request_registry(struct map_session_data *sd, int flag) { nullpo_ret(sd); - /* if char server aint online it doesn't load, shouldn't we kill the session then? */ + /* if char server ain't online it doesn't load, shouldn't we kill the session then? */ if (intif->CheckForCharServer()) return 0; @@ -931,7 +931,7 @@ void intif_parse_WisMessage(int fd) { } //Success to send whisper. clif->wis_message(sd->fd, wisp_source, (char*)RFIFOP(fd,56),RFIFOW(fd,2)-56); - intif_wis_replay(id,0); // succes + intif_wis_replay(id,0); // success } // Wisp/page transmission result reception @@ -939,7 +939,7 @@ void intif_parse_WisEnd(int fd) { struct map_session_data* sd; if (battle_config.etc_log) - ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send wisper, 1: target character is not loged in?, 2: ignored by target + ShowInfo("intif_parse_wisend: player: %s, flag: %d\n", RFIFOP(fd,2), RFIFOB(fd,26)); // flag: 0: success to send whisper, 1: target character is not logged in?, 2: ignored by target sd = (struct map_session_data *)map->nick2sd((char *) RFIFOP(fd,2)); if (sd != NULL) clif->wis_end(sd->fd, RFIFOB(fd,26)); @@ -1366,7 +1366,7 @@ void intif_parse_DeletePetOk(int fd) { ShowError("pet data delete failure\n"); } -// ACK changing name resquest, players,pets,hommon +// ACK changing name request, players,pets,homun void intif_parse_ChangeNameOk(int fd) { struct map_session_data *sd = NULL; diff --git a/src/map/itemdb.c b/src/map/itemdb.c index 9bc352276..320c64402 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1123,7 +1123,7 @@ void itemdb_read_packages(void) { for( r = 0; r < itemdb->packages[count].random_qty; r++ ) { if( itemdb->packages[count].random_groups[r].random_qty == 1 ) { - //item packages dont stop looping until something comes out of them, so if you have only one item in it the drop is guaranteed. + //item packages don't stop looping until something comes out of them, so if you have only one item in it the drop is guaranteed. ShowWarning("itemdb_read_packages: in '%s' 'Random: %d' group has only 1 random option, drop rate will be 100%!\n",itemdb_name(itemdb->packages[count].id),r+1); itemdb->packages[count].random_groups[r].random_list[0].rate = 10000; } diff --git a/src/map/map.c b/src/map/map.c index e37e902f6..a89478cb1 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -254,7 +254,7 @@ int map_delblock(struct block_list* bl) // blocklist (2ways chainlist) if (bl->prev == NULL) { if (bl->next != NULL) { - // can't delete block (already at the begining of the chain) + // can't delete block (already at the beginning of the chain) ShowError("map_delblock error : bl->next!=NULL\n"); } return 0; @@ -468,7 +468,7 @@ static int bl_vforeach(int (*func)(struct block_list*, va_list), int blockcount, map->freeblock_lock(); for (i = blockcount; i < map->bl_list_count && returnCount < max; i++) { - if (map->bl_list[i]->prev) { //func() may delete this bl_list[] slot, checking for prev ensures it wasnt queued for deletion. + if (map->bl_list[i]->prev) { //func() may delete this bl_list[] slot, checking for prev ensures it wasn't queued for deletion. va_list argscopy; va_copy(argscopy, args); returnCount += func(map->bl_list[i], argscopy); @@ -2037,7 +2037,7 @@ void map_foreachnpc(int (*func)(struct npc_data* nd, va_list args), ...) { } /// Applies func to everything in the db. -/// Stops iteratin gif func returns -1. +/// Stops iterating gif func returns -1. void map_vforeachregen(int (*func)(struct block_list* bl, va_list args), va_list args) { DBIterator* iter; struct block_list* bl; @@ -2057,7 +2057,7 @@ void map_vforeachregen(int (*func)(struct block_list* bl, va_list args), va_list } /// Applies func to everything in the db. -/// Stops iteratin gif func returns -1. +/// Stops iterating gif func returns -1. /// @see map_vforeachregen void map_foreachregen(int (*func)(struct block_list* bl, va_list args), ...) { va_list args; @@ -4402,7 +4402,7 @@ bool map_zone_mf_cache(int m, char *flag, char *params) { } if( modifier[0] == '\0' || !( skill_id = skill->name2id(skill_name) ) || !skill->get_unit_id( skill->name2id(skill_name), 0) || atoi(modifier) < 1 || atoi(modifier) > USHRT_MAX ) { - ;/* we dont mind it, the server will take care of it next. */ + ;/* we don't mind it, the server will take care of it next. */ } else { int idx = map->list[m].unit_count; @@ -4435,7 +4435,7 @@ bool map_zone_mf_cache(int m, char *flag, char *params) { } if( modifier[0] == '\0' || !( skill_id = skill->name2id(skill_name) ) || atoi(modifier) < 1 || atoi(modifier) > USHRT_MAX ) { - ;/* we dont mind it, the server will take care of it next. */ + ;/* we don't mind it, the server will take care of it next. */ } else { int idx = map->list[m].skill_count; @@ -4792,7 +4792,7 @@ void read_map_zone_db(void) { --h; continue; } - if( !map->zone_bl_type(libconfig->setting_get_string_elem(skills,h),&subtype) )/* we dont remove it from the three due to inheritance */ + if( !map->zone_bl_type(libconfig->setting_get_string_elem(skills,h),&subtype) )/* we don't remove it from the three due to inheritance */ --disabled_skills_count; } /* all ok, process */ @@ -4830,7 +4830,7 @@ void read_map_zone_db(void) { --h; continue; } - if( !libconfig->setting_get_bool(item) )/* we dont remove it from the three due to inheritance */ + if( !libconfig->setting_get_bool(item) )/* we don't remove it from the three due to inheritance */ --disabled_items_count; } /* all ok, process */ @@ -4875,7 +4875,7 @@ void read_map_zone_db(void) { --h; continue; } - if( !libconfig->setting_get_int(command) )/* we dont remove it from the three due to inheritance */ + if( !libconfig->setting_get_int(command) )/* we don't remove it from the three due to inheritance */ --disabled_commands_count; } /* all ok, process */ @@ -4911,7 +4911,7 @@ void read_map_zone_db(void) { --h; continue; } - if( !map->zone_bl_type(libconfig->setting_get_string_elem(cap,1),&subtype) )/* we dont remove it from the three due to inheritance */ + if( !map->zone_bl_type(libconfig->setting_get_string_elem(cap,1),&subtype) )/* we don't remove it from the three due to inheritance */ --capped_skills_count; } /* all ok, process */ @@ -5712,7 +5712,7 @@ int do_init(int argc, char *argv[]) char ip_str[16]; ip2str(sockt->addr_[0], ip_str); - ShowWarning("Not all IP addresses in /conf/map-server.conf configured, autodetecting...\n"); + ShowWarning("Not all IP addresses in /conf/map-server.conf configured, auto-detecting...\n"); if (sockt->naddr_ == 0) ShowError("Unable to determine your IP address...\n"); @@ -5736,7 +5736,7 @@ int do_init(int argc, char *argv[]) map->id_db = idb_alloc(DB_OPT_BASE); map->pc_db = idb_alloc(DB_OPT_BASE); //Added for reliable map->id2sd() use. [Skotlex] - map->mobid_db = idb_alloc(DB_OPT_BASE); //Added to lower the load of the lazy mob ai. [Skotlex] + map->mobid_db = idb_alloc(DB_OPT_BASE); //Added to lower the load of the lazy mob AI. [Skotlex] map->bossid_db = idb_alloc(DB_OPT_BASE); // Used for Convex Mirror quick MVP search map->map_db = uidb_alloc(DB_OPT_BASE); map->nick_db = idb_alloc(DB_OPT_BASE); @@ -5795,7 +5795,7 @@ int do_init(int argc, char *argv[]) itemdb->init(minimal); skill->init(minimal); if (!minimal) - map->read_zone_db();/* read after item and skill initalization */ + map->read_zone_db();/* read after item and skill initialization */ mob->init(minimal); pc->init(minimal); status->init(minimal); diff --git a/src/map/map.h b/src/map/map.h index 3ce59a804..38167597a 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -324,7 +324,7 @@ struct spawn_data { unsigned int level; struct { unsigned int size : 2; //Holds if mob has to be tiny/large - unsigned int ai : 4; //Special ai for summoned monsters. + unsigned int ai : 4; //Special AI for summoned monsters. //0: Normal mob | 1: Standard summon, attacks mobs //2: Alchemist Marine Sphere | 3: Alchemist Summon Flora | 4: Summon Zanzou unsigned int dynamic : 1; //Whether this data is indexed by a map's dynamic mob list @@ -659,8 +659,8 @@ struct map_data { int nocommand; //Blocks @/# commands for non-gms. [Skotlex] /** * Ice wall reference counter for bugreport:3574 - * - since there are a thounsand mobs out there in a lot of maps checking on, - * - every targetting for icewall on attack path would just be a waste, so, + * - since there are a thousand mobs out there in a lot of maps checking on, + * - every targeting for icewall on attack path would just be a waste, so, * - this counter allows icewall checking be only run when there is a actual ice wall on the map **/ int icewall_num; @@ -732,7 +732,7 @@ struct map_data_other_server { /// Bitfield of flags for the iterator. enum e_mapitflags { MAPIT_NORMAL = 0, - // MAPIT_PCISPLAYING = 1,// Unneeded as pc_db/id_db will only hold auth'ed, active players. + // MAPIT_PCISPLAYING = 1,// Unneeded as pc_db/id_db will only hold authed, active players. }; struct s_mapiterator; diff --git a/src/map/mob.c b/src/map/mob.c index ef47d6b70..552724de0 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -356,7 +356,7 @@ bool mob_ksprotected(struct block_list *src, struct block_list *target) { return false; // KS Protection Disabled if( !(md = BL_CAST(BL_MOB,target)) ) - return false; // Tarjet is not MOB + return false; // Target is not MOB if( (s_bl = battle->get_master(src)) == NULL ) s_bl = src; @@ -1073,7 +1073,7 @@ int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap) default: if (battle_config.hom_setting&0x4 && (*target) && (*target)->type == BL_HOM && bl->type != BL_HOM) - return 0; //For some reason Homun targets are never overriden. + return 0; //For some reason Homun targets are never overridden. dist = distance_bl(&md->bl, bl); if( @@ -1443,7 +1443,7 @@ bool mob_ai_sub_hard(struct mob_data *md, int64 tick) { //Unlock current target. if (mob->warpchase(md, tbl)) return true; //Chasing this target. - mob->unlocktarget(md, tick-(battle_config.mob_ai&0x8?3000:0)); //Imediately do random walk. + mob->unlocktarget(md, tick-(battle_config.mob_ai&0x8?3000:0)); //Immediately do random walk. tbl = NULL; } } @@ -2084,7 +2084,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { unsigned int base_exp,job_exp; } pt[DAMAGELOG_SIZE]; int i, temp, count, m = md->bl.m, pnum = 0; - int dmgbltypes = 0; // bitfield of all bl types, that caused damage to the mob and are elligible for exp distribution + int dmgbltypes = 0; // bitfield of all bl types, that caused damage to the mob and are eligible for exp distribution unsigned int mvp_damage; int64 tick = timer->gettick(); bool rebirth, homkillonly; @@ -2302,7 +2302,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { int drop_modifier = mvp_sd ? pc->level_penalty_mod( md->level - mvp_sd->status.base_level, md->status.race, md->status.mode, 2) : second_sd ? pc->level_penalty_mod( md->level - second_sd->status.base_level, md->status.race, md->status.mode, 2): third_sd ? pc->level_penalty_mod( md->level - third_sd->status.base_level, md->status.race, md->status.mode, 2) : - 100;/* no player was attached, we dont use any modifier (100 = rates are not touched) */ + 100;/* no player was attached, we don't use any modifier (100 = rates are not touched) */ #endif dlist->m = md->bl.m; dlist->x = md->bl.x; @@ -2613,7 +2613,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { if( !rebirth ) { if( pcdb_checkid(md->vd->class_) ) {//Player mobs are not removed automatically by the client. - /* first we set them dead, then we delay the outsight effect */ + /* first we set them dead, then we delay the out sight effect */ clif->clearunit_area(&md->bl,CLR_DEAD); clif->clearunit_delayed(&md->bl, CLR_OUTSIGHT,tick+3000); } else @@ -2842,7 +2842,7 @@ int mob_warpslave(struct block_list *bl, int range) { } /*========================================== - * Counts slave sub, curently checking if mob master is the given ID. + * Counts slave sub, currently checking if mob master is the given ID. *------------------------------------------*/ int mob_countslave_sub(struct block_list *bl,va_list ap) { @@ -3231,7 +3231,7 @@ int mobskill_use(struct mob_data *md, int64 tick, int event) { continue; } } else { - //Targetted skill + //Targeted skill switch (skill_target) { case MST_RANDOM: //Pick a random enemy within skill range. bl = battle->get_enemy(&md->bl, DEFAULT_ENEMY_TYPE(md), @@ -3335,7 +3335,7 @@ int mob_is_clone(int class_) } //Flag values: -//&1: Set special ai (fight mobs, not players) +//&1: Set special AI (fight mobs, not players) //If mode is not passed, a default aggressive mode is used. //If master_id is passed, clone is attached to him. //Returns: ID of newly crafted copy. @@ -3621,7 +3621,7 @@ unsigned int mob_drop_adjust(int baserate, int rate_adjust, unsigned short rate_ } /** - * Check if global item drop rate is overriden for given item + * Check if global item drop rate is overridden for given item * in db/mob_item_ratio.txt * @param nameid ID of the item * @param mob_id ID of the monster @@ -3773,7 +3773,7 @@ bool mob_parse_dbrow(char** str) { status->calc_misc(&data.bl, mstatus, db->lv); // MVP EXP Bonus: MEXP - // Some new MVP's MEXP multipled by high exp-rate cause overflow. [LuzZza] + // Some new MVP's MEXP multiple by high exp-rate cause overflow. [LuzZza] exp = (double)atoi(str[30]) * (double)battle_config.mvp_exp_rate / 100.; db->mexp = (unsigned int)cap_value(exp, 0, UINT_MAX); @@ -3835,7 +3835,7 @@ bool mob_parse_dbrow(char** str) { ratemax = battle_config.item_drop_treasure_max; } else switch (type) - { // Added suport to restrict normal drops of MVP's [Reddozen] + { // Added support to restrict normal drops of MVP's [Reddozen] case IT_HEALING: rate_adjust = (mstatus->mode&MD_BOSS) ? battle_config.item_rate_heal_boss : battle_config.item_rate_heal; ratemin = battle_config.item_drop_heal_min; diff --git a/src/map/mob.h b/src/map/mob.h index d07f78c77..7e222fa74 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -13,7 +13,7 @@ #define MAX_RANDOMMONSTER 5 -// Change this to increase the table size in your mob_db to accomodate a larger mob database. +// Change this to increase the table size in your mob_db to accommodate a larger mob database. // Be sure to note that IDs 4001 to 4048 are reserved for advanced/baby/expanded classes. // Notice that the last 1000 entries are used for player clones, so always set this to desired value +1000 #define MAX_MOB_DB 4000 @@ -35,7 +35,7 @@ #define MOB_CLONE_START (MAX_MOB_DB-999) #define MOB_CLONE_END MAX_MOB_DB -//Used to determine default enemy type of mobs (for use in eachinrange calls) +//Used to determine default enemy type of mobs (for use in each in range calls) #define DEFAULT_ENEMY_TYPE(md) ((md)->special_state.ai?BL_CHAR:BL_MOB|BL_PC|BL_HOM|BL_MER) #define MAX_MOB_CHAT 250 //Max Skill's messages @@ -127,7 +127,7 @@ struct mob_data { char name[NAME_LENGTH]; struct { unsigned int size : 2; //Small/Big monsters. - unsigned int ai : 4; //Special ai for summoned monsters. + unsigned int ai : 4; //Special AI for summoned monsters. //0: Normal mob. //1: Standard summon, attacks mobs. //2: Alchemist Marine Sphere diff --git a/src/map/npc.c b/src/map/npc.c index 0817313e2..81615022a 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -666,7 +666,7 @@ void npc_timerevent_quit(struct map_session_data* sd) struct npc_data* nd; struct timer_event_data *ted; - // Check timer existance + // Check timer existence if( sd->npc_timer_id == INVALID_TIMER ) return; if( !(td = timer->get(sd->npc_timer_id)) ) @@ -1340,7 +1340,7 @@ int npc_cashshop_buylist(struct map_session_data *sd, int points, int count, uns return ERROR_TYPE_ITEM_ID; if( !itemdb->isstackable(nameid) && amount > 1 ) { - ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of nonstackable item %d!\n", + ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n", sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid); amount = item_list[i*2+0] = 1; } @@ -1667,7 +1667,7 @@ int npc_cashshop_buy(struct map_session_data *sd, int nameid, int amount, int po return ERROR_TYPE_ITEM_ID; if(!itemdb->isstackable(nameid) && amount > 1) { - ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of nonstackable item %d!\n", + ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n", sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid); amount = 1; } @@ -1775,7 +1775,7 @@ int npc_buylist(struct map_session_data* sd, int n, unsigned short* item_list) { if( !itemdb->isstackable(nameid) && amount > 1 ) { //Exploit? You can't buy more than 1 of equipment types o.O - ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of nonstackable item %d!\n", + ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n", sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid); amount = item_list[i*2+0] = 1; } @@ -1898,7 +1898,7 @@ int npc_market_buylist(struct map_session_data* sd, unsigned short list_size, st if( !itemdb->isstackable(nameid) && amount > 1 ) { //Exploit? You can't buy more than 1 of equipment types o.O - ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of nonstackable item %d!\n", + ShowWarning("Player %s (%d:%d) sent a hexed packet trying to buy %d of non-stackable item %d!\n", sd->status.name, sd->status.account_id, sd->status.char_id, amount, nameid); amount = p->list[i].qty = 1; } diff --git a/src/map/npc_chat.c b/src/map/npc_chat.c index 2182e1da2..8bc246819 100644 --- a/src/map/npc_chat.c +++ b/src/map/npc_chat.c @@ -80,7 +80,7 @@ struct pcre_interface libpcre_s; /** - * delete everythign associated with a entry + * delete everything associated with a entry * * This does NOT do the list management */ @@ -245,7 +245,7 @@ void delete_pcreset(struct npc_data* nd, int setid) while (pcreset->head) { struct pcrematch_entry* n = pcreset->head->next; npc_chat->finalize_pcrematch_entry(pcreset->head); - aFree(pcreset->head); // Cleanin' the last ones.. [Lance] + aFree(pcreset->head); // Cleaning the last ones.. [Lance] pcreset->head = n; } @@ -301,7 +301,7 @@ void npc_chat_def_pattern(struct npc_data* nd, int setid, const char* pattern, c * Delete everything associated with a NPC concerning the pattern * matching code * - * this could be more efficent but.. how often do you do this? + * this could be more efficient but.. how often do you do this? */ void npc_chat_finalize(struct npc_data* nd) { @@ -344,10 +344,10 @@ int npc_chat_sub(struct block_list* bl, va_list ap) // iterate across all active sets for (pcreset = npcParse->active; pcreset != NULL; pcreset = pcreset->next) { - // interate across all patterns in that set + // n across all patterns in that set for (e = pcreset->head; e != NULL; e = e->next) { - int offsets[2*10 + 10]; // 1/3 reserved for temp space requred by pcre_exec + int offsets[2*10 + 10]; // 1/3 reserved for temp space required by pcre_exec // perform pattern match int r = libpcre->exec(e->pcre_, e->pcre_extra_, msg, len, 0, 0, offsets, ARRAYLENGTH(offsets)); @@ -380,7 +380,7 @@ int npc_chat_sub(struct block_list* bl, va_list ap) return 0; } -// Various script builtins used to support these functions +// Various script built-ins used to support these functions BUILDIN(defpattern) { int setid = script_getnum(st,2); const char* pattern = script_getstr(st,3); diff --git a/src/map/party.c b/src/map/party.c index 678b2cd54..7cf340edb 100644 --- a/src/map/party.c +++ b/src/map/party.c @@ -213,7 +213,7 @@ void party_check_state(struct party_data *p) { int i; memset(&p->state, 0, sizeof(p->state)); for (i = 0; i < MAX_PARTY; i ++) { - if (!p->party.member[i].online) continue; //Those not online shouldn't aport to skill usage and all that. + if (!p->party.member[i].online) continue; //Those not online shouldn't apart to skill usage and all that. switch (p->party.member[i].class_) { case JOB_MONK: case JOB_BABY_MONK: @@ -1132,7 +1132,7 @@ int party_sub_count_chorus(struct block_list *bl, va_list ap) { * @param func Function to execute * @param sd Reference character for party, map, area center * @param range Area size (0 = whole map) - * @param ... Adidtional parameters to pass to func() + * @param ... Additional parameters to pass to func() * @return Sum of the return values from func() */ int party_foreachsamemap(int (*func)(struct block_list*,va_list), struct map_session_data *sd, int range, ...) { diff --git a/src/map/script.c b/src/map/script.c index 95cf48a16..6ccbf8eaa 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -2765,7 +2765,7 @@ void script_array_add_member(struct script_array *sa, unsigned int idx) { } /** * Obtains the source of the array database for this type and scenario - * Initializes such database when not yet initialised. + * Initializes such database when not yet initialized. **/ struct reg_db *script_array_src(struct script_state *st, struct map_session_data *sd, const char *name, struct reg_db *ref) { struct reg_db *src = NULL; diff --git a/src/map/skill.c b/src/map/skill.c index 383720361..cb0f4786f 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -852,7 +852,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 #ifdef RENEWAL sc_start(src,bl,SC_FREEZE,65-(5*skill_lv),skill_lv,skill->get_time2(skill_id,skill_lv)); #else - //Tharis pointed out that this is normal freeze chance with a base of 300% + // [Tharis] pointed out that this is normal freeze chance with a base of 300% if(tsc->sg_counter >= 3 && sc_start(src,bl,SC_FREEZE,300,skill_lv,skill->get_time2(skill_id,skill_lv))) tsc->sg_counter = 0; @@ -993,7 +993,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 break; case NPC_MENTALBREAKER: { - //Based on observations by Tharis, Mental Breaker should do SP damage + //Based on observations by [Tharis], Mental Breaker should do SP damage //equal to Matk*skLevel. rate = status->get_matk(src, 2); rate*=skill_lv; @@ -1032,7 +1032,7 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 sc_start(src,bl,SC_BLIND,100,skill_lv,skill->get_time2(skill_id,skill_lv)); break; - case LK_HEADCRUSH: //Headcrush has chance of causing Bleeding status, except on demon and undead element + case LK_HEADCRUSH: // Headcrush has chance of causing Bleeding status, except on demon and undead element if (!(battle->check_undead(tstatus->race, tstatus->def_ele) || tstatus->race == RC_DEMON)) sc_start2(src, bl, SC_BLOODING,50, skill_lv, src->id, skill->get_time2(skill_id,skill_lv)); break; @@ -1296,11 +1296,11 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 sc_start(src, bl, SC_BLOODING, 100, skill_lv, 10000); break; case ITEMID_MELON_BOMB: - sc_start(src, bl, SC_MELON_BOMB, 100, skill_lv, 60000); // Reduces ASPD and moviment speed + sc_start(src, bl, SC_MELON_BOMB, 100, skill_lv, 60000); // Reduces ASPD and movement speed break; case ITEMID_BANANA_BOMB: sc_start(src, bl, SC_BANANA_BOMB, 100, skill_lv, 60000); // Reduces LUK? Needed confirm it, may be it's bugged in kRORE? - sc_start(src, bl, SC_BANANA_BOMB_SITDOWN_POSTDELAY, (sd? sd->status.job_level:0) + sstatus->dex / 6 + tstatus->agi / 4 - tstatus->luk / 5 - status->get_lv(bl) + status->get_lv(src), skill_lv, 1000); // Sitdown for 3 seconds. + sc_start(src, bl, SC_BANANA_BOMB_SITDOWN_POSTDELAY, (sd? sd->status.job_level:0) + sstatus->dex / 6 + tstatus->agi / 4 - tstatus->luk / 5 - status->get_lv(bl) + status->get_lv(src), skill_lv, 1000); // Sit down for 3 seconds. break; } sd->itemid = -1; @@ -1657,7 +1657,7 @@ int skill_onskillusage(struct map_session_data *sd, struct block_list *bl, uint1 return 1; } -/* Splitted off from skill->additional_effect, which is never called when the +/* Split off from skill->additional_effect, which is never called when the * attack skill kills the enemy. Place in this function counter status effects * when using skills (eg: Asura's sp regen penalty, or counter-status effects * from cards) that will take effect on the source, not the target. [Skotlex] @@ -1673,7 +1673,7 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b nullpo_ret(src); nullpo_ret(bl); - if(skill_id > 0 && !skill_lv) return 0; // don't forget auto attacks! - celest + if(skill_id > 0 && !skill_lv) return 0; // don't forget auto attacks! [celest] sd = BL_CAST(BL_PC, src); dstsd = BL_CAST(BL_PC, bl); @@ -1712,7 +1712,7 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b case GS_FULLBUSTER: sc_start(src,src,SC_BLIND,2*skill_lv,skill_lv,skill->get_time2(skill_id,skill_lv)); break; - case HFLI_SBR44: //[orn] + case HFLI_SBR44: // [orn] case HVAN_EXPLOSION: if(src->type == BL_HOM){ TBL_HOM *hd = (TBL_HOM*)src; @@ -1728,15 +1728,15 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b } if( sd && (sd->class_&MAPID_UPPERMASK) == MAPID_STAR_GLADIATOR - && rnd()%10000 < battle_config.sg_miracle_skill_ratio) //SG_MIRACLE [Komurka] + && rnd()%10000 < battle_config.sg_miracle_skill_ratio) // SG_MIRACLE [Komurka] sc_start(src,src,SC_MIRACLE,100,1,battle_config.sg_miracle_skill_duration); if( sd && skill_id && attack_type&BF_MAGIC && status->isdead(bl) && !(skill->get_inf(skill_id)&(INF_GROUND_SKILL|INF_SELF_SKILL)) && (rate=pc->checkskill(sd,HW_SOULDRAIN)) > 0 ) { - //Soul Drain should only work on targetted spells [Skotlex] - if( pc_issit(sd) ) pc->setstand(sd); //Character stuck in attacking animation while 'sitting' fix. [Skotlex] + // Soul Drain should only work on targeted spells [Skotlex] + if( pc_issit(sd) ) pc->setstand(sd); // Character stuck in attacking animation while 'sitting' fix. [Skotlex] if( skill->get_nk(skill_id)&NK_SPLASH && skill->area_temp[1] != bl->id ) ; else { @@ -1756,7 +1756,7 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b if( attack_type&BF_MAGIC ) { sp += sd->bonus.magic_sp_gain_value; hp += sd->bonus.magic_hp_gain_value; - if( skill_id == WZ_WATERBALL ) {//(bugreport:5303) + if( skill_id == WZ_WATERBALL ) {// (bugreport:5303) struct status_change *sc = NULL; if( ( sc = status->get_sc(src) ) ) { if( sc->data[SC_SOULLINK] @@ -1851,7 +1851,7 @@ int skill_counter_additional_effect(struct block_list* src, struct block_list *b break; } dstsd->state.autocast = 0; - //Set canact delay. [Skotlex] + // Set canact delay. [Skotlex] ud = unit->bl2ud(bl); if (ud) { rate = skill->delay_fix(bl, auto_skill_id, auto_skill_lv); @@ -1989,7 +1989,7 @@ int skill_strip_equip(struct block_list *bl, unsigned short where, int rate, int return 0; sc = status->get_sc(bl); - if (!sc || sc->option&OPTION_MADOGEAR ) //Mado Gear cannot be divested [Ind] + if (!sc || sc->option&OPTION_MADOGEAR ) // Mado Gear cannot be divested [Ind] return 0; for (i = 0; i < ARRAYLENGTH(pos); i++) { @@ -2018,16 +2018,16 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in nullpo_ret(src); if (src != target && map->list[src->m].flag.noknockback) - return 0; //No knocking + return 0; // No knocking if (count == 0) - return 0; //Actual knockback distance is 0. + return 0; // Actual knockback distance is 0. switch (target->type) { case BL_MOB: { struct mob_data* md = BL_CAST(BL_MOB, target); if( md->class_ == MOBID_EMPERIUM ) return 0; - if(src != target && is_boss(target)) //Bosses can't be knocked-back + if(src != target && is_boss(target)) // Bosses can't be knocked-back return 0; } break; @@ -2059,11 +2059,13 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in } -// Checks if 'bl' should reflect back a spell cast by 'src'. -// type is the type of magic attack: 0: indirect (aoe), 1: direct (targetted) -// In case of success returns type of reflection, otherwise 0 -// 1 - Regular reflection (Maya) -// 2 - SL_KAITE reflection +/* + Checks if 'bl' should reflect back a spell cast by 'src'. + type is the type of magic attack: 0: indirect (aoe), 1: direct (targeted) + In case of success returns type of reflection, otherwise 0 + 1 - Regular reflection (Maya) + 2 - SL_KAITE reflection +*/ int skill_magic_reflect(struct block_list* src, struct block_list* bl, int type) { struct status_change *sc = status->get_sc(bl); struct map_session_data* sd = BL_CAST(BL_PC, bl); @@ -2122,8 +2124,8 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr if(skill_id > 0 && !skill_lv) return 0; - nullpo_ret(src); //Source is the master behind the attack (player/mob/pet) - nullpo_ret(dsrc); //dsrc is the actual originator of the damage, can be the same as src, or a skill casted by src. + nullpo_ret(src); // Source is the master behind the attack (player/mob/pet) + nullpo_ret(dsrc); // dsrc is the actual originator of the damage, can be the same as src, or a skill casted by src. nullpo_ret(bl); //Target to be attacked. if (src != dsrc) { @@ -2131,7 +2133,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr if (!status->check_skilluse(battle_config.skill_caster_check?src:NULL, bl, skill_id, 2)) return 0; } else if ((flag&SD_ANIMATION) && skill->get_nk(skill_id)&NK_SPLASH) { - //Note that splash attacks often only check versus the targetted mob, those around the splash area normally don't get checked for being hidden/cloaked/etc. [Skotlex] + //Note that splash attacks often only check versus the targeted mob, those around the splash area normally don't get checked for being hidden/cloaked/etc. [Skotlex] if (!status->check_skilluse(src, bl, skill_id, 2)) return 0; } @@ -2185,7 +2187,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr sc = NULL; //Don't need it. /* bugreport:2564 flag&2 disables double casting trigger */ flag |= 2; - /* bugreport:7859 magical reflect'd zeroes blewcount */ + /* bugreport:7859 magical reflected zeroes blow count */ dmg.blewcount = 0; //Spirit of Wizard blocks Kaite's reflection if( type == 2 && sc && sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_WIZARD ) @@ -2207,11 +2209,11 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr #if MAGIC_REFLECTION_TYPE #ifdef RENEWAL - if( dmg.dmg_lv != ATK_MISS ) //Wiz SL cancelled and consumed fragment + if( dmg.dmg_lv != ATK_MISS ) // Wiz SL canceled and consumed fragment #else // issue:6415 in pre-renewal Kaite reflected the entire damage received - // regardless of caster's equipament (Aegis 11.1) - if( dmg.dmg_lv != ATK_MISS && type == 1 ) //Wiz SL cancelled and consumed fragment + // regardless of caster's equipment (Aegis 11.1) + if( dmg.dmg_lv != ATK_MISS && type == 1 ) //Wiz SL canceled and consumed fragment #endif { short s_ele = skill->get_ele(skill_id, skill_lv); @@ -2503,7 +2505,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr { //Updated to not be able to copy skills if the blow will kill you. [Skotlex] int copy_skill = skill_id, cidx = 0; /** - * Copy Referal: dummy skills should point to their source upon copying + * Copy Referral: dummy skills should point to their source upon copying **/ switch( skill_id ) { case AB_DUPLELIGHT_MELEE: @@ -2740,7 +2742,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr struct status_change *ssc = status->get_sc(src); if( ssc && ssc->data[SC_POISONINGWEAPON] && rnd()%100 < 70 + 5*skill_lv ) { short rate = 100; - if ( ssc->data[SC_POISONINGWEAPON]->val1 == 9 )//Oblivion Curse gives a 2nd success chance after the 1st one passes which is reduceable. [Rytech] + if ( ssc->data[SC_POISONINGWEAPON]->val1 == 9 )// Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech] rate = 100 - tstatus->int_ * 4 / 5; sc_start(src, bl,ssc->data[SC_POISONINGWEAPON]->val2,rate,ssc->data[SC_POISONINGWEAPON]->val1,skill->get_time2(GC_POISONINGWEAPON,1) - (tstatus->vit + tstatus->luk) / 2 * 1000); status_change_end(src,SC_POISONINGWEAPON,-1); @@ -2775,8 +2777,8 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr } /*========================================== - * sub fonction for recursive skill call. - * Checking bl battle flag and display dammage + * sub function for recursive skill call. + * Checking bl battle flag and display damage * then call func with source,target,skill_id,skill_lv,tick,flag *------------------------------------------*/ int skill_area_sub(struct block_list *bl, va_list ap) { @@ -2967,7 +2969,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, if( (idx = skill->get_index(skill_id)) == 0 ) return 0; - // Requeriments + // Requirements for( i = 0; i < ARRAYLENGTH(itemid); i++ ) { itemid[i] = skill->db[idx].itemid[i]; @@ -2989,7 +2991,7 @@ int skill_check_condition_mercenary(struct block_list *bl, int skill_id, int lv, else sp += (st->max_sp * (-sp_rate)) / 100; - if( bl->type == BL_HOM ) { // Intimacy Requeriments + if( bl->type == BL_HOM ) { // Intimacy Requirements struct homun_data *hd = BL_CAST(BL_HOM, bl); switch( skill_id ) { case HFLI_SBR44: @@ -3414,7 +3416,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 return 1; if (skill_id && skill->get_type(skill_id) == BF_MAGIC && status->isimmune(bl) == 100) { - //GTB makes all targetted magic display miss with a single bolt. + //GTB makes all targeted magic display miss with a single bolt. sc_type sct = status->skill2sc(skill_id); if(sct != SC_NONE) status_change_end(bl, sct, INVALID_TIMER); @@ -4054,7 +4056,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 skill->attack(BF_MISC,src,src,bl,skill_id,skill_lv,tick,flag); break; - // Celest + // [Celest] case PF_SOULBURN: if (rnd()%100 < (skill_lv < 5 ? 30 + skill_lv * 10 : 70)) { clif->skill_nodamage(src,bl,skill_id,skill_lv,1); @@ -4139,7 +4141,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 if( unit->movepos(src, bl->x+x, bl->y+y, 1, 1) ) { clif->slide(src,bl->x+x,bl->y+y); - clif->fixpos(src); // the official server send these two packts. + clif->fixpos(src); // the official server send these two packets. skill->attack(BF_WEAPON,src,src,bl,skill_id,skill_lv,tick,flag); if( rnd()%100 < 4 * skill_lv ) skill->castend_damage_id(src,bl,GC_CROSSIMPACT,skill_lv,tick,flag); @@ -4562,7 +4564,7 @@ int skill_castend_damage_id(struct block_list* src, struct block_list *bl, uint1 } break; - //recursive homon skill + // Recursive homun skill case MH_MAGMA_FLOW: case MH_HEILIGE_STANGE: if(flag & 1) @@ -4791,7 +4793,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) { && (sc = status->get_sc(target)) && sc->data[SC_FOGWALL] && rnd() % 100 < 75 ) { - //Fogwall makes all offensive-type targetted skills fail at 75% + // Fogwall makes all offensive-type targeted skills fail at 75% if (sd) clif->skill_fail(sd, ud->skill_id, USESKILL_FAIL_LEVEL, 0); break; } @@ -4842,8 +4844,8 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) { unit->stop_walking(src,1); if( !sd || sd->skillitem != ud->skill_id || skill->get_delay(ud->skill_id,ud->skill_lv) ) - ud->canact_tick = tick + skill->delay_fix(src, ud->skill_id, ud->skill_lv); //Tests show wings don't overwrite the delay but skill scrolls do. [Inkfish] - if (sd) { //Cooldown application + ud->canact_tick = tick + skill->delay_fix(src, ud->skill_id, ud->skill_lv); // Tests show wings don't overwrite the delay but skill scrolls do. [Inkfish] + if (sd) { // Cooldown application int i, cooldown = skill->get_cooldown(ud->skill_id, ud->skill_lv); for (i = 0; i < ARRAYLENGTH(sd->skillcooldown) && sd->skillcooldown[i].id; i++) { // Increases/Decreases cooldown of a skill by item/card bonuses. if (sd->skillcooldown[i].id == ud->skill_id){ @@ -4886,7 +4888,7 @@ int skill_castend_id(int tid, int64 tick, int id, intptr_t data) { // SC_MAGICPOWER needs to switch states before any damage is actually dealt skill->toggle_magicpower(src, ud->skill_id); - /* On aegis damage skills are also increase by camouflage. Need confirmation on kRo. + /* On aegis damage skills are also increase by camouflage. Need confirmation on kRO. if( ud->skill_id != RA_CAMOUFLAGE ) // only normal attack and auto cast skills benefit from its bonuses status_change_end(src,SC_CAMOUFLAGE, INVALID_TIMER); */ @@ -4983,7 +4985,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin int element = 0; enum sc_type type; - if(skill_id > 0 && !skill_lv) return 0; // celest + if(skill_id > 0 && !skill_lv) return 0; // [Celest] nullpo_retr(1, src); nullpo_retr(1, bl); @@ -5024,7 +5026,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin //Check for undead skills that convert a no-damage skill into a damage one. [Skotlex] switch (skill_id) { - case HLIF_HEAL: //[orn] + case HLIF_HEAL: // [orn] if (bl->type != BL_HOM) { if (sd) clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0) ; break ; @@ -5095,7 +5097,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin struct block_list *s_src = battle->get_master(src); short ret = 0; if(!skill->check_unit_range(src, src->x, src->y, skill_id, skill_lv)) //prevent reiteration - ret = skill->castend_pos2(src,src->x,src->y,skill_id,skill_lv,tick,flag); //cast on homon + ret = skill->castend_pos2(src,src->x,src->y,skill_id,skill_lv,tick,flag); //cast on homun if(s_src && !skill->check_unit_range(s_src, s_src->x, s_src->y, skill_id, skill_lv)) ret |= skill->castend_pos2(s_src,s_src->x,s_src->y,skill_id,skill_lv,tick,flag); //cast on master if (hd) @@ -5138,7 +5140,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin map->freeblock_lock(); switch(skill_id) { - case HLIF_HEAL: //[orn] + case HLIF_HEAL: // [orn] case AL_HEAL: /** * Arch Bishop @@ -5494,7 +5496,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (dstsd) { if(dstsd->status.weapon == W_FIST || (dstsd->sc.count && !dstsd->sc.data[type] && - ( //Allow re-enchanting to lenghten time. [Skotlex] + ( //Allow re-enchanting to lengthen time. [Skotlex] dstsd->sc.data[SC_PROPERTYFIRE] || dstsd->sc.data[SC_PROPERTYWATER] || dstsd->sc.data[SC_PROPERTYWIND] || @@ -5716,7 +5718,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin { int duration = skill->get_time(skill_id,skill_lv); clif->skill_nodamage(bl,bl,skill_id,skill_lv,sc_start(src,bl,type,100,skill_lv,duration)); // Master - clif->skill_nodamage(src,src,skill_id,skill_lv,sc_start(src,src,type,100,skill_lv,duration)); // Homunc + clif->skill_nodamage(src,src,skill_id,skill_lv,sc_start(src,src,type,100,skill_lv,duration)); // Homun } break; case NJ_BUNSINJYUTSU: @@ -6050,7 +6052,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin BF_MAGIC, src, src, skill_id, skill_lv, tick, flag, BCT_ENEMY); break; - case HVAN_EXPLOSION: //[orn] + case HVAN_EXPLOSION: // [orn] case NPC_SELFDESTRUCTION: { //Self Destruction hits everyone in range (allies+enemies) @@ -6183,7 +6185,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin return 0; } clif->skill_nodamage(src,bl,skill_id,skill_lv,sc_start4(src,bl,type,100,skill_lv,unit->getdir(bl),0,0,0)); - if (sd) // If the client receives a skill-use packet inmediately before a walkok packet, it will discard the walk packet! [Skotlex] + if (sd) // If the client receives a skill-use packet immediately before a walkok packet, it will discard the walk packet! [Skotlex] clif->walkok(sd); // So aegis has to resend the walk ok. break; case AS_CLOAKING: @@ -6419,7 +6421,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case MC_IDENTIFY: if(sd) { clif->item_identify_list(sd); - if( sd->menuskill_id != MC_IDENTIFY ) {/* failed, dont consume anything, return */ + if( sd->menuskill_id != MC_IDENTIFY ) {/* failed, don't consume anything, return */ map->freeblock_unlock(); return 1; } @@ -6761,7 +6763,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } clif->skill_nodamage(src,bl,skill_id,skill_lv,1); if((dstsd && (dstsd->class_&MAPID_UPPERMASK) == MAPID_SOUL_LINKER) - || (tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_ROGUE) //Rogue's spirit defends againt dispel. + || (tsc && tsc->data[SC_SOULLINK] && tsc->data[SC_SOULLINK]->val2 == SL_ROGUE) //Rogue's spirit defends against dispel. || (dstsd && pc_ismadogear(dstsd)) || rnd()%100 >= 50+10*skill_lv ) { @@ -7071,7 +7073,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin unit->stop_attack(src); //Run skillv tiles overriding the can-move check. if (unit->walktoxy(src, src->x + skill_lv * mask[dir][0], src->y + skill_lv * mask[dir][1], 2) && md) - md->state.skillstate = MSS_WALK; //Otherwise it isn't updated in the ai. + md->state.skillstate = MSS_WALK; //Otherwise it isn't updated in the AI. } break; @@ -7137,14 +7139,14 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case WE_MALE: { int hp_rate = (!skill_lv)? 0:skill->db[skill_id].hp_rate[skill_lv-1]; - int gain_hp = tstatus->max_hp*abs(hp_rate)/100; // The earned is the same % of the target HP than it costed the caster. [Skotlex] + int gain_hp = tstatus->max_hp*abs(hp_rate)/100; // The earned is the same % of the target HP than it cost the caster. [Skotlex] clif->skill_nodamage(src,bl,skill_id,status->heal(bl, gain_hp, 0, 0),1); } break; case WE_FEMALE: { int sp_rate = (!skill_lv)? 0:skill->db[skill_id].sp_rate[skill_lv-1]; - int gain_sp = tstatus->max_sp*abs(sp_rate)/100;// The earned is the same % of the target SP than it costed the caster. [Skotlex] + int gain_sp = tstatus->max_sp*abs(sp_rate)/100;// The earned is the same % of the target SP than it cost the caster. [Skotlex] clif->skill_nodamage(src,bl,skill_id,status->heal(bl, 0, gain_sp, 0),1); } break; @@ -7248,7 +7250,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin // if it is already trapping something don't spring it, // remove trap should be used instead break; - // otherwise fallthrough to below + // otherwise fall through to below case UNT_BLASTMINE: case UNT_SKIDTRAP: case UNT_LANDMINE: @@ -7481,7 +7483,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if (count == -1) count = 3; else - count++; //Should not retrigger this one. + count++; //Should not re-trigger this one. break; case 7: // stop freeze or stoned { @@ -7696,7 +7698,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } break; - case AM_CALLHOMUN: //[orn] + case AM_CALLHOMUN: // [orn] if( sd ) { if (homun->call(sd)) clif->skill_nodamage(src, bl, skill_id, skill_lv, 1); @@ -7714,7 +7716,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } break; - case HAMI_CASTLE: //[orn] + case HAMI_CASTLE: // [orn] if(rnd()%100 < 20*skill_lv && src != bl) { int x,y; @@ -7724,7 +7726,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin skill->blockhomun_start(hd, skill_id, skill->get_time2(skill_id,skill_lv)); if (unit->movepos(src,bl->x,bl->y,0,0)) { - clif->skill_nodamage(src,src,skill_id,skill_lv,1); // Homunc + clif->skill_nodamage(src,src,skill_id,skill_lv,1); // Homun clif->slide(src,bl->x,bl->y) ; if (unit->movepos(bl,x,y,0,0)) { @@ -7743,7 +7745,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin else if (sd) clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0); break; - case HVAN_CHAOTIC: //[orn] + case HVAN_CHAOTIC: // [orn] { static const int per[5][2]={{20,50},{50,60},{25,75},{60,64},{34,67}}; int r = rnd()%100; @@ -7764,7 +7766,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin status->heal(bl, hp, 0, 0); } break; - //Homun single-target support skills [orn] + // Homun single-target support skills [orn] case HAMI_BLOODLUST: case HFLI_FLEET: case HFLI_SPEED: @@ -8016,7 +8018,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin { // Every time the skill is casted the status change is reseted adding a counter. count += (short)tsc->data[SC_ROLLINGCUTTER]->val1; if( count > 10 ) - count = 10; // Max coounter + count = 10; // Max counter status_change_end(bl, SC_ROLLINGCUTTER, INVALID_TIMER); } sc_start(src,bl,SC_ROLLINGCUTTER,100,count,skill->get_time(skill_id,skill_lv)); @@ -8548,7 +8550,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } if ( tsc && tsc->data[SC__UNLUCKY] && skill_id == SC_UNLUCKY) { //If the target was successfully inflected with the Unlucky status, give 1 of 3 random status's. - switch(rnd()%3) {//Targets in the Unlucky status will be affected by one of the 3 random status's reguardless of resistance. + switch(rnd()%3) {//Targets in the Unlucky status will be affected by one of the 3 random status's regardless of resistance. case 0: status->change_start(src,bl,SC_POISON,10000,skill_lv,0,0,0,skill->get_time(skill_id,skill_lv),10); break; @@ -8732,7 +8734,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin } else { int count = 0; clif->skill_damage(src, bl, tick, status_get_amotion(src), 0, -30000, 1, skill_id, skill_lv, 6); - count = map->forcountinrange(skill->area_sub, src, skill->get_splash(skill_id,skill_lv), (sd)?sd->spiritball_old:15, // Assume 15 spiritballs in non-charactors + count = map->forcountinrange(skill->area_sub, src, skill->get_splash(skill_id,skill_lv), (sd)?sd->spiritball_old:15, // Assume 15 spiritballs in non-characters BL_CHAR, src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill->castend_nodamage_id); if( sd ) pc->delspiritball(sd, count, 0); clif->skill_nodamage(src, src, skill_id, skill_lv, @@ -8921,7 +8923,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin sc_start(src, bl, type, 100, skill_lv,skill->get_time(skill_id, skill_lv)); if ( madnesscheck >= 8 )//The god of madness deals 9999 fixed unreduceable damage when 8 or more enemy players are affected. status_fix_damage(src, bl, 9999, clif->damage(src, bl, 0, 0, 9999, 0, 0, 0)); - //skill->attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);//To renable when I can confirm it deals damage like this. Data shows its dealed as reflected damage which I dont have it coded like that yet. [Rytech] + //skill->attack(BF_MISC,src,src,bl,skillid,skilllv,tick,flag);//To renable when I can confirm it deals damage like this. Data shows its dealt as reflected damage which I don't have it coded like that yet. [Rytech] } else if( sd ) { int rate = sstatus->int_ / 6 + (sd? sd->status.job_level:0) / 5 + skill_lv * 4; if ( rnd()%100 < rate ) { @@ -9047,7 +9049,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin if( sd ) { int elemental_class = skill->get_elemental_type(skill_id,skill_lv); - // Remove previous elemental fisrt. + // Remove previous elemental first. if( sd->ed ) elemental->delete(sd->ed,0); @@ -9070,7 +9072,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin elemental->delete(sd->ed, 0); break; } - switch( skill_lv ) {// Select mode bassed on skill level used. + switch( skill_lv ) {// Select mode based on skill level used. case 2: mode = EL_MODE_ASSIST; break; case 3: mode = EL_MODE_AGGRESSIVE; break; } @@ -9847,7 +9849,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui int r; //if(skill_lv <= 0) return 0; - if(skill_id > 0 && !skill_lv) return 0; // celest + if(skill_id > 0 && !skill_lv) return 0; // [Celest] nullpo_ret(src); @@ -10153,7 +10155,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui int class_ = skill_id==AM_SPHEREMINE?1142:summons[skill_lv-1]; struct mob_data *md; - // Correct info, don't change any of this! [celest] + // Correct info, don't change any of this! [Celest] md = mob->once_spawn_sub(src, src->m, x, y, status->get_name(src), class_, "", SZ_MEDIUM, AI_NONE); if (md) { md->master_id = src->id; @@ -10293,7 +10295,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui sc_start(src,src,type,100,skill_lv,skill->get_time2(skill_id,skill_lv)); break; - case AM_RESURRECTHOMUN: //[orn] + case AM_RESURRECTHOMUN: // [orn] if (sd) { if (!homun->ressurect(sd, 20*skill_lv, x, y)) { clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); @@ -11871,7 +11873,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 case UNT_POISONSMOKE: if( battle->check_target(ss,bl,BCT_ENEMY) > 0 && !(tsc && tsc->data[sg->val2]) && rnd()%100 < 50 ) { short rate = 100; - if ( sg->val1 == 9 )//Oblivion Curse gives a 2nd success chance after the 1st one passes which is reduceable. [Rytech] + if ( sg->val1 == 9 )//Oblivion Curse gives a 2nd success chance after the 1st one passes which is reducible. [Rytech] rate = 100 - tstatus->int_ * 4 / 5 ; sc_start(ss,bl,sg->val2,rate,sg->val1,skill->get_time2(GC_POISONINGWEAPON,1) - (tstatus->vit + tstatus->luk) / 2 * 1000); } @@ -11906,7 +11908,7 @@ int skill_unit_onplace_timer(struct skill_unit *src, struct block_list *bl, int6 case UNT_STEALTHFIELD: if( bl->id == sg->src_id ) - break; // Dont work on Self (video shows that) + break; // Don't work on Self (video shows that) case UNT_NEUTRALBARRIER: sc_start(ss,bl,type,100,sg->skill_lv,sg->interval + 100); break; @@ -12188,8 +12190,8 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) { //We don't check for SC_LONGING because someone could always have knocked you back and out of the song/dance. //FIXME: This code is not perfect, it doesn't checks for the real ensemble's owner, //it only checks if you are doing the same ensemble. So if there's two chars doing an ensemble - //which overlaps, by stepping outside of the other parther's ensemble will cause you to cancel - //your own. Let's pray that scenario is pretty unlikely and noone will complain too much about it. + //which overlaps, by stepping outside of the other partner's ensemble will cause you to cancel + //your own. Let's pray that scenario is pretty unlikely and none will complain too much about it. status_change_end(bl, SC_DANCING, INVALID_TIMER); } case MH_STEINWAND: @@ -12235,7 +12237,7 @@ int skill_unit_onleft(uint16 skill_id, struct block_list *bl, int64 tick) { if (sce) { status_change_end(bl, type, INVALID_TIMER); if ((sce=sc->data[SC_BLIND])) { - if (bl->type == BL_PC) //Players get blind ended inmediately, others have it still for 30 secs. [Skotlex] + if (bl->type == BL_PC) //Players get blind ended immediately, others have it still for 30 secs. [Skotlex] status_change_end(bl, SC_BLIND, INVALID_TIMER); else { timer->delete(sce->timer, status->change_timer); @@ -12683,7 +12685,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id case BS_GREED: clif->skill_fail(sd,skill_id,USESKILL_FAIL_MADOGEAR,0); return 0; - default: //Only Mechanic exlcusive skill can be used. + default: //Only Mechanic exclusive skill can be used. break; } } @@ -12996,7 +12998,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id return 0; } break; - case AM_REST: //Can't vapo homun if you don't have an active homunc or it's hp is < 80% + case AM_REST: //Can't vapo homun if you don't have an active homun or it's hp is < 80% if (!homun_alive(sd->hd) || sd->hd->battle_status.hp < (sd->hd->battle_status.max_hp*80/100)) { clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); @@ -13433,7 +13435,7 @@ int skill_check_condition_castbegin(struct map_session_data* sd, uint16 skill_id // There's no need to check if the skill is part of a combo if it's // already been checked before, see unit_skilluse_id2 [Panikon] - // Note that if this check is readded part of issue:8047 will reapear! + // Note that if this check is read part of issue:8047 will reappear! //if( sd->sc.data[SC_COMBOATTACK] && !skill->is_combo(skill_id ) ) // return 0; @@ -13681,7 +13683,7 @@ int skill_consume_requirement( struct map_session_data *sd, uint16 skill_id, uin continue; if( itemid_isgemstone(req.itemid[i]) && skill_id != HW_GANBANTEIN && sc && sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_WIZARD ) - continue; //Gemstones are checked, but not substracted from inventory. + continue; //Gemstones are checked, but not subtracted from inventory. switch( skill_id ){ case SA_SEISMICWEAPON: @@ -13876,7 +13878,7 @@ struct skill_condition skill_get_requirement(struct map_session_data* sd, uint16 if( itemid_isgemstone(req.itemid[i]) && skill_id != HW_GANBANTEIN ) { if( sd->special_state.no_gemstone ) - { // All gem skills except Hocus Pocus and Ganbantein can cast for free with Mistress card -helvetica + { // All gem skills except Hocus Pocus and Ganbantein can cast for free with Mistress card [helvetica] if( skill_id != SA_ABRACADABRA ) req.itemid[i] = req.amount[i] = 0; else if( --req.amount[i] < 1 ) @@ -15033,7 +15035,7 @@ int skill_cell_overlap(struct block_list *bl, va_list ap) { if( su == NULL || su->group == NULL || (*alive) == 0 ) return 0; - if( su->group->state.guildaura ) /* guild auras are not cancelled! */ + if( su->group->state.guildaura ) /* guild auras are not canceled! */ return 0; switch (skill_id) { @@ -15484,7 +15486,7 @@ int skill_delunit (struct skill_unit* su) { } break; case SC_MANHOLE: // Note : Removing the unit don't remove the status (official info) - if( group->val2 ) { // Someone Traped + if( group->val2 ) { // Someone Trapped struct status_change *tsc = status->get_sc(map->id2bl(group->val2)); if( tsc && tsc->data[SC__MANHOLE] ) tsc->data[SC__MANHOLE]->val4 = 0; // Remove the Unit ID @@ -15631,7 +15633,7 @@ int skill_delunitgroup(struct skill_unit_group *group, const char* file, int lin struct status_change* sc = status->get_sc(src); if (sc && sc->data[SC_DANCING]) { - sc->data[SC_DANCING]->val2 = 0 ; //This prevents status_change_end attempting to redelete the group. [Skotlex] + sc->data[SC_DANCING]->val2 = 0 ; //This prevents status_change_end attempting to re-delete the group. [Skotlex] status_change_end(src, SC_DANCING, INVALID_TIMER); } } @@ -16013,7 +16015,7 @@ int skill_unit_timer_sub(DBKey key, DBData *data, va_list ap) { return 0; } /*========================================== - * Executes on all skill units every SKILLUNITTIMER_INTERVAL miliseconds. + * Executes on all skill units every SKILLUNITTIMER_INTERVAL milliseconds. *------------------------------------------*/ int skill_unit_timer(int tid, int64 tick, int id, intptr_t data) { map->freeblock_lock(); @@ -16420,7 +16422,7 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, make_per = 100000; // Star Crumbs are 100% success crafting rate? (made 1000% so it succeeds even after penalties) [Skotlex] break; default: // Enchanted Stones - make_per += 1000+i*500; // Enchantedstone Craft bonus: +15/+20/+25/+30/+35 + make_per += 1000+i*500; // Enchanted stone Craft bonus: +15/+20/+25/+30/+35 break; } break; @@ -16468,7 +16470,7 @@ int skill_produce_mix(struct map_session_data *sd, uint16 skill_id, int nameid, case ITEMID_COATING_BOTTLE: make_per -= (1+rnd()%100)*10; break; - //Common items, recieve no bonus or penalty, listed just because they are commonly produced + //Common items, receive no bonus or penalty, listed just because they are commonly produced case ITEMID_BLUE_POTION: case ITEMID_RED_SLIM_POTION: case ITEMID_ANODYNE: @@ -17371,7 +17373,7 @@ int skill_blockpc_start_(struct map_session_data *sd, uint16 skill_id, int tick) return 0; } -int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) { //[orn] +int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) { // [orn] struct homun_data *hd = (TBL_HOM*)map->id2bl(id); if (data <= 0 || data >= MAX_SKILL) return 0; @@ -17380,7 +17382,7 @@ int skill_blockhomun_end(int tid, int64 tick, int id, intptr_t data) { //[orn] return 1; } -int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { //[orn] +int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { // [orn] uint16 idx = skill->get_index(skill_id); nullpo_retr (-1, hd); @@ -17396,7 +17398,7 @@ int skill_blockhomun_start(struct homun_data *hd, uint16 skill_id, int tick) { / return timer->add(timer->gettick() + tick, skill->blockhomun_end, hd->bl.id, idx); } -int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) {//[orn] +int skill_blockmerc_end(int tid, int64 tick, int id, intptr_t data) {// [orn] struct mercenary_data *md = (TBL_MER*)map->id2bl(id); if( data <= 0 || data >= MAX_SKILL ) return 0; @@ -17984,7 +17986,7 @@ bool skill_parse_row_requiredb(char* split[], int columns, int current) { skill->split_atoi(split[5],skill->db[idx].sp_rate); skill->split_atoi(split[6],skill->db[idx].zeny); - //Wich weapon type are required, see doc/item_db for types + //Which weapon type are required, see doc/item_db for types p = split[7]; for( j = 0; j < 32; j++ ) { int l = atoi(p); @@ -18481,7 +18483,7 @@ void skill_defaults(void) { memset(&skill->area_temp,0,sizeof(skill->area_temp)); memset(&skill->unit_temp,0,sizeof(skill->unit_temp)); skill->unit_group_newid = 0; - /* accesssors */ + /* accessors */ skill->get_index = skill_get_index; skill->get_type = skill_get_type; skill->get_hit = skill_get_hit; diff --git a/src/map/status.c b/src/map/status.c index a716b8913..d05341683 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -1121,8 +1121,8 @@ int status_charge(struct block_list* bl, int64 hp, int64 sp) { } //Inflicts damage on the target with the according walkdelay. -//If flag&1, damage is passive and does not triggers cancelling status changes. -//If flag&2, fail if target does not has enough to substract. +//If flag&1, damage is passive and does not triggers canceling status changes. +//If flag&2, fail if target does not has enough to subtract. //If flag&4, if killed, mob must not give exp/loot. //flag will be set to &8 when damaging sp of a dead character int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, int64 in_sp, int walkdelay, int flag) { @@ -1269,7 +1269,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, st->hp = 1; //To let the dead function cast skills and all that. //NOTE: These dead functions should return: [Skotlex] - //0: Death cancelled, auto-revived. + //0: Death canceled, auto-revived. //Non-zero: Standard death. Clear status, cancel move/attack, etc //&2: Also remove object from map. //&4: Also delete object from memory. @@ -1284,7 +1284,7 @@ int status_damage(struct block_list *src,struct block_list *target,int64 in_hp, break; } - if(!flag) //Death cancelled. + if(!flag) //Death canceled. return (int)(hp+sp); //Normal death @@ -1429,7 +1429,7 @@ int status_heal(struct block_list *bl,int64 in_hp,int64 in_sp, int flag) { //If rates are > 0, percent is of current HP/SP //If rates are < 0, percent is of max HP/SP //If !flag, this is heal, otherwise it is damage. -//Furthermore, if flag==2, then the target must not die from the substraction. +//Furthermore, if flag==2, then the target must not die from the subtraction. int status_percent_change(struct block_list *src,struct block_list *target,signed char hp_rate, signed char sp_rate, int flag) { struct status_data *st; unsigned int hp = 0, sp = 0; @@ -1633,11 +1633,11 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin if( sc && sc->count ) { - if (skill_id != RK_REFRESH && sc->opt1 >0 && !(sc->opt1 == OPT1_CRYSTALIZE && src->type == BL_MOB) && sc->opt1 != OPT1_BURNING && skill_id != SR_GENTLETOUCH_CURE) { //Stuned/Frozen/etc + if (skill_id != RK_REFRESH && sc->opt1 >0 && !(sc->opt1 == OPT1_CRYSTALIZE && src->type == BL_MOB) && sc->opt1 != OPT1_BURNING && skill_id != SR_GENTLETOUCH_CURE) { //Stunned/Frozen/etc if (flag != 1) //Can't cast, casted stuff can't damage. return 0; if (!(skill->get_inf(skill_id)&INF_GROUND_SKILL)) - return 0; //Targetted spells can't come off. + return 0; //Targeted spells can't come off. } if ( @@ -1782,7 +1782,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin if( ( tsc->data[SC_STEALTHFIELD] || tsc->data[SC_CAMOUFLAGE] ) && !(st->mode&(MD_BOSS|MD_DETECTOR)) && flag == 4 ) return 0; } - //If targetting, cloak+hide protect you, otherwise only hiding does. + //If targeting, cloak+hide protect you, otherwise only hiding does. hide_flag = flag?OPTION_HIDE:(OPTION_HIDE|OPTION_CLOAK|OPTION_CHASEWALK); //You cannot hide from ground skills. @@ -1815,7 +1815,7 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, uin } } break; - case BL_ITEM: //Allow targetting of items to pick'em up (or in the case of mobs, to loot them). + case BL_ITEM: //Allow targeting of items to pick'em up (or in the case of mobs, to loot them). //TODO: Would be nice if this could be used to judge whether the player can or not pick up the item it targets. [Skotlex] if (st->mode&MD_LOOTER) return 1; @@ -1891,7 +1891,7 @@ int status_base_amotion_pc(struct map_session_data *sd, struct status_data *st) #ifdef RENEWAL_ASPD short mod = -1; - switch( sd->weapontype2 ){ // adjustment for dual weilding + switch( sd->weapontype2 ){ // adjustment for dual wielding case W_DAGGER: mod = 0; break; // 0, 1, 1 case W_1HSWORD: case W_1HAXE: mod = 1; @@ -2555,7 +2555,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { return 1; } - // sanitize the refine level in case someone decreased the value inbetween + // sanitize the refine level in case someone decreased the value in between if (sd->status.inventory[index].refine > MAX_REFINE) sd->status.inventory[index].refine = MAX_REFINE; @@ -2583,7 +2583,7 @@ int status_calc_pc_(struct map_session_data* sd, enum e_status_calc_opt opt) { wa->matk += status->refine_info[wlv].bonus[r-1] / 100; #endif - //Overrefine bonus. + //Overrefined bonus. if (r) wd->overrefine = status->refine_info[wlv].randombonus_max[r-1] / 100; diff --git a/src/map/status.h b/src/map/status.h index 32bef4df8..b08aa2a04 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -21,7 +21,7 @@ struct pet_data; //Change the equation when the values are high enough to discard the //imprecision in exchange of overflow protection [Skotlex] //Also add 100% checks since those are the most used cases where we don't -//want aproximation errors. +//want approximation errors. #define APPLY_RATE(value, rate) ( \ (rate) == 100 ? \ (value) \ diff --git a/src/map/storage.c b/src/map/storage.c index 2db5fff3d..fad23d770 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -544,7 +544,7 @@ int storage_guild_storageadd(struct map_session_data* sd, int index, int amount) * @index : storage idx * return * 0 : fail -* 1 : succes +* 1 : success *------------------------------------------*/ int storage_guild_storageget(struct map_session_data* sd, int index, int amount) { @@ -585,7 +585,7 @@ int storage_guild_storageget(struct map_session_data* sd, int index, int amount) * @index : cart inventory idx * return * 0 : fail -* 1 : succes +* 1 : success *------------------------------------------*/ int storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int amount) { @@ -617,7 +617,7 @@ int storage_guild_storageaddfromcart(struct map_session_data* sd, int index, int * @index : storage idx * return * 0 : fail -* 1 : succes +* 1 : success *------------------------------------------*/ int storage_guild_storagegettocart(struct map_session_data* sd, int index, int amount) { @@ -648,7 +648,7 @@ int storage_guild_storagegettocart(struct map_session_data* sd, int index, int a * Request to save guild storage * return * 0 : fail (no storage) -* 1 : succes +* 1 : success *------------------------------------------*/ int storage_guild_storagesave(int account_id, int guild_id, int flag) { @@ -669,7 +669,7 @@ int storage_guild_storagesave(int account_id, int guild_id, int flag) * ACK save of guild storage * return * 0 : fail (no storage) -* 1 : succes +* 1 : success *------------------------------------------*/ int storage_guild_storagesaved(int guild_id) { diff --git a/src/map/trade.c b/src/map/trade.c index 83426c407..8bb47e0cb 100644 --- a/src/map/trade.c +++ b/src/map/trade.c @@ -61,7 +61,7 @@ void trade_traderequest(struct map_session_data *sd, struct map_session_data *ta if( previous_sd ){ previous_sd->trade_partner = 0; clif->tradecancelled(previous_sd); - } // Once cancelled then continue to the new one. + } // Once canceled then continue to the new one. sd->trade_partner = 0; clif->tradecancelled(sd); } @@ -169,7 +169,7 @@ void trade_tradeack(struct map_session_data *sd, int type) { /*========================================== * Check here hacker for duplicate item in trade * normal client refuse to have 2 same types of item (except equipment) in same trade window - * normal client authorise only no equiped item and only from inventory + * normal client authorize only no equipped item and only from inventory *------------------------------------------*/ int impossible_trade_check(struct map_session_data *sd) { @@ -187,9 +187,9 @@ int impossible_trade_check(struct map_session_data *sd) // get inventory of player memcpy(&inventory, &sd->status.inventory, sizeof(struct item) * MAX_INVENTORY); - // remove this part: arrows can be trade and equiped + // remove this part: arrows can be trade and equipped // re-added! [celest] - // remove equiped items (they can not be trade) + // remove equipped items (they can not be trade) for (i = 0; i < MAX_INVENTORY; i++) if (inventory[i].nameid > 0 && inventory[i].equip && !(inventory[i].equip & EQP_AMMO)) memset(&inventory[i], 0, sizeof(struct item)); @@ -457,7 +457,7 @@ void trade_tradeok(struct map_session_data *sd) { } /*========================================== - * 'Cancel' is pressed. (or trade was force-cancelled by the code) + * 'Cancel' is pressed. (or trade was force-canceled by the code) *------------------------------------------*/ void trade_tradecancel(struct map_session_data *sd) { struct map_session_data *target_sd; @@ -466,7 +466,7 @@ void trade_tradecancel(struct map_session_data *sd) { target_sd = map->id2sd(sd->trade_partner); if(!sd->state.trading) - { // Not trade acepted + { // Not trade accepted if( target_sd ) { target_sd->trade_partner = 0; clif->tradecancelled(target_sd); diff --git a/src/map/unit.c b/src/map/unit.c index e22d6f697..95feb2a1d 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -244,7 +244,7 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) { { if (!(ud->skill_id == NPC_SELFDESTRUCTION && ud->skilltimer != INVALID_TIMER)) { //Skill used, abort walking - clif->fixpos(bl); //Fix position as walk has been cancelled. + clif->fixpos(bl); //Fix position as walk has been canceled. return 0; } //Resend walk packet for proper Self Destruction display. @@ -869,7 +869,7 @@ int unit_stop_walking(struct block_list *bl,int type) return 0; //NOTE: We are using timer data after deleting it because we know the //timer->delete function does not messes with it. If the function's - //behaviour changes in the future, this code could break! + //behavior changes in the future, this code could break! td = timer->get(ud->walktimer); timer->delete(ud->walktimer, unit->walktoxy_timer); ud->walktimer = INVALID_TIMER; @@ -892,7 +892,7 @@ int unit_stop_walking(struct block_list *bl,int type) if(bl->type == BL_PET && type&~0xff) ud->canmove_tick = timer->gettick() + (type>>8); - //Readded, the check in unit_set_walkdelay means dmg during running won't fall through to this place in code [Kevin] + //Read, the check in unit_set_walkdelay means dmg during running won't fall through to this place in code [Kevin] if (ud->state.running) { status_change_end(bl, SC_RUN, INVALID_TIMER); status_change_end(bl, SC_WUGDASH, INVALID_TIMER); @@ -1250,7 +1250,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui if (!temp) //Stop attack on non-combo skills [Skotlex] unit->stop_attack(src); - else if(ud->attacktimer != INVALID_TIMER) //Elsewise, delay current attack sequence + else if(ud->attacktimer != INVALID_TIMER) //Else-wise, delay current attack sequence ud->attackabletime = tick + status_get_adelay(src); ud->state.skillcastcancel = castcancel; @@ -1366,7 +1366,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui } if(!ud->state.running) //need TK_RUN or WUGDASH handler to be done before that, see bugreport:6026 - unit->stop_walking(src,1);// eventhough this is not how official works but this will do the trick. bugreport:6829 + unit->stop_walking(src,1);// even though this is not how official works but this will do the trick. bugreport:6829 // in official this is triggered even if no cast time. clif->skillcasting(src, src->id, target_id, 0,0, skill_id, skill->get_ele(skill_id, skill_lv), casttime); @@ -1375,7 +1375,7 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui if (sd && target->type == BL_MOB) { TBL_MOB *md = (TBL_MOB*)target; - mob->skill_event(md, src, tick, -1); //Cast targetted skill event. + mob->skill_event(md, src, tick, -1); //Cast targeted skill event. if (tstatus->mode&(MD_CASTSENSOR_IDLE|MD_CASTSENSOR_CHASE) && battle->check_target(target, src, BCT_ENEMY) > 0) { @@ -1470,7 +1470,7 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui if( skill->not_ok(skill_id, sd) || !skill->check_condition_castbegin(sd, skill_id, skill_lv) ) return 0; /** - * "WHY IS IT HEREE": pneuma cannot be cancelled past this point, the client displays the animation even, + * "WHY IS IT HEREE": pneuma cannot be canceled past this point, the client displays the animation even, * if we cancel it from nodamage_id, so it has to be here for it to not display the animation. **/ if( skill_id == AL_PNEUMA && map->getcell(src->m, skill_x, skill_y, CELL_CHKLANDPROTECTOR) ) { @@ -1648,7 +1648,7 @@ int unit_attack(struct block_list *src,int target_id,int continuous) { ud->state.attack_continue = continuous; unit->set_target(ud, target_id); - if (continuous) //If you're to attack continously, set to auto-case character + if (continuous) //If you're to attack continuously, set to auto-case character ud->chaserange = status_get_range(src); //Just change target/type. [Skotlex] @@ -1938,7 +1938,7 @@ int unit_attack_timer(int tid, int64 tick, int id, intptr_t data) { /*========================================== * Cancels an ongoing skill cast. * flag&1: Cast-Cancel invoked. - * flag&2: Cancel only if skill is cancellable. + * flag&2: Cancel only if skill is can be cancel. *------------------------------------------*/ int unit_skillcastcancel(struct block_list *bl,int type) { @@ -1954,7 +1954,7 @@ int unit_skillcastcancel(struct block_list *bl,int type) sd = BL_CAST(BL_PC, bl); if (type&2) { - //See if it can be cancelled. + //See if it can be canceled. if (!ud->state.skillcastcancel) return 0; @@ -2057,7 +2057,7 @@ int unit_changeviewsize(struct block_list *bl,short size) /*========================================== * Removes a bl/ud from the map. * Returns 1 on success. 0 if it couldn't be removed or the bl was free'd - * if clrtype is 1 (death), appropiate cleanup is performed. + * if clrtype is 1 (death), appropriate cleanup is performed. * Otherwise it is assumed bl is being warped. * On-Kill specific stuff is not performed here, look at status->damage for that. *------------------------------------------*/ diff --git a/src/map/vending.h b/src/map/vending.h index a70726374..b65e888e3 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -13,8 +13,8 @@ struct s_search_store_search; struct s_vending { short index; //cart index (return item data) - short amount; //amout of the item for vending - unsigned int value; //at wich price + short amount; //amount of the item for vending + unsigned int value; //at which price }; struct vending_interface { -- cgit v1.2.3-70-g09d2 From 7cd967f812ab741c41c416fb9f7c2a921c36e947 Mon Sep 17 00:00:00 2001 From: panikon Date: Tue, 8 Jul 2014 23:19:49 -0300 Subject: Extracted method to obtain SYSTEM_INFO from functions in sysinfo.c Added proper method to obtain page size in windows --- src/common/sysinfo.c | 53 +++++++++++++++++++++++++++++++++++++--------------- src/common/sysinfo.h | 1 + src/common/thread.c | 5 ++--- 3 files changed, 41 insertions(+), 18 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 40ef6cfc0..5ecb7b5ad 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -607,6 +607,37 @@ void sysinfo_osversion_retrieve(void) { } typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); + +/** + * Retrieves SYSTEM_INFO (Windows only) + * System info is not stored anywhere after retrieval + * @see http://msdn.microsoft.com/en-us/library/windows/desktop/ms724958(v=vs.85).aspx + **/ +void sysinfo_systeminfo_retrieve( LPSYSTEM_INFO info ) { + PGNSI pGNSI; + + // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. + pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); + if (NULL != pGNSI) + pGNSI(info); + else + GetSystemInfo(info); + + return; +} + +/** + * Returns number of bytes in a memory page + * Only needed when compiling with MSVC + **/ +long sysinfo_getpagesize( void ) { + SYSTEM_INFO si; + ZeroMemory(&si, sizeof(SYSTEM_INFO)); + + sysinfo_systeminfo_retrieve(&si); + return si.dwPageSize; +} + /** * Retrieves the CPU type (Windows only). * @@ -615,7 +646,6 @@ typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); */ void sysinfo_cpu_retrieve(void) { StringBuf buf; - PGNSI pGNSI; SYSTEM_INFO si; ZeroMemory(&si, sizeof(SYSTEM_INFO)); StrBuf->Init(&buf); @@ -625,12 +655,7 @@ void sysinfo_cpu_retrieve(void) { sysinfo->p->cpu = NULL; } - // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. - pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); - if (NULL != pGNSI) - pGNSI(&si); - else - GetSystemInfo(&si); + sysinfo_systeminfo_retrieve(&si); if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_INTEL || si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64 @@ -656,7 +681,6 @@ void sysinfo_cpu_retrieve(void) { * Once retrieved, the name is stored into sysinfo->p->arch. */ void sysinfo_arch_retrieve(void) { - PGNSI pGNSI; SYSTEM_INFO si; ZeroMemory(&si, sizeof(SYSTEM_INFO)); @@ -665,12 +689,7 @@ void sysinfo_arch_retrieve(void) { sysinfo->p->arch = NULL; } - // Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. - pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); - if (NULL != pGNSI) - pGNSI(&si); - else - GetSystemInfo(&si); + sysinfo_systeminfo_retrieve(&si); if (si.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64) // x64 sysinfo->p->arch = aStrdup("x86_64"); @@ -1018,7 +1037,11 @@ void sysinfo_defaults(void) { sysinfo = &sysinfo_s; memset(&sysinfo_p, '\0', sizeof(sysinfo_p)); sysinfo->p = &sysinfo_p; - +#if defined(WIN32) && !defined(__CYGWIN__) + sysinfo->getpagesize = sysinfo_getpagesize; +#else + sysinfo->getpagesize = getpagesize(); +#endif sysinfo->platform = sysinfo_platform; sysinfo->osversion = sysinfo_osversion; sysinfo->cpu = sysinfo_cpu; diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index c0c4d276a..97f14d0f2 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -21,6 +21,7 @@ struct sysinfo_private; struct sysinfo_interface { struct sysinfo_private *p; + long (*getpagesize) (void); const char *(*platform) (void); const char *(*osversion) (void); const char *(*cpu) (void); diff --git a/src/common/thread.c b/src/common/thread.c index 4be37d576..933ee2c0e 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -10,13 +10,13 @@ #include "thread.h" +#include "../common/sysinfo.h" // sysinfo->getpagesize() #include "../common/cbasetypes.h" #include "../common/malloc.h" #include "../common/showmsg.h" #ifdef WIN32 # include "../common/winapi.h" -# define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) # define __thread __declspec( thread ) #else # include @@ -32,7 +32,6 @@ #define HAS_TLS #endif - #define RA_THREADS_MAX 64 struct rAthread { @@ -170,7 +169,7 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta // given stacksize aligned to systems pagesize? - tmp = szStack % getpagesize(); + tmp = szStack % sysinfo->getpagesize(); if(tmp != 0) szStack += tmp; -- cgit v1.2.3-70-g09d2 From bce716fa908584f435dcf97904fb37ada6dd90b7 Mon Sep 17 00:00:00 2001 From: Streusel Date: Tue, 8 Jul 2014 22:49:50 -0700 Subject: reversed portion of 7cd967f812ab741c41c416fb9f7c2a921c36e947 that would point to nothing. --- src/common/thread.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/common/thread.c b/src/common/thread.c index 933ee2c0e..b97eecb44 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -10,13 +10,13 @@ #include "thread.h" -#include "../common/sysinfo.h" // sysinfo->getpagesize() #include "../common/cbasetypes.h" #include "../common/malloc.h" #include "../common/showmsg.h" #ifdef WIN32 # include "../common/winapi.h" +# define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) # define __thread __declspec( thread ) #else # include @@ -169,7 +169,7 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta // given stacksize aligned to systems pagesize? - tmp = szStack % sysinfo->getpagesize(); + tmp = szStack % getpagesize(); if(tmp != 0) szStack += tmp; -- cgit v1.2.3-70-g09d2 From fc41d1f9fa9f3eff21568c8111f74454793dea9c Mon Sep 17 00:00:00 2001 From: panikon Date: Wed, 9 Jul 2014 03:16:46 -0300 Subject: Corrected issue with bce716fa908584f435dcf97904fb37ada6dd90b7 forgot to removed a couple of parenthesis, sorry guys --- src/common/sysinfo.c | 2 +- src/common/thread.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index 5ecb7b5ad..605256100 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -1040,7 +1040,7 @@ void sysinfo_defaults(void) { #if defined(WIN32) && !defined(__CYGWIN__) sysinfo->getpagesize = sysinfo_getpagesize; #else - sysinfo->getpagesize = getpagesize(); + sysinfo->getpagesize = getpagesize; #endif sysinfo->platform = sysinfo_platform; sysinfo->osversion = sysinfo_osversion; diff --git a/src/common/thread.c b/src/common/thread.c index b97eecb44..933ee2c0e 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -10,13 +10,13 @@ #include "thread.h" +#include "../common/sysinfo.h" // sysinfo->getpagesize() #include "../common/cbasetypes.h" #include "../common/malloc.h" #include "../common/showmsg.h" #ifdef WIN32 # include "../common/winapi.h" -# define getpagesize() 4096 // @TODO: implement this properly (GetSystemInfo .. dwPageSize..). (Atm as on all supported win platforms its 4k its static.) # define __thread __declspec( thread ) #else # include @@ -169,7 +169,7 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta // given stacksize aligned to systems pagesize? - tmp = szStack % getpagesize(); + tmp = szStack % sysinfo->getpagesize(); if(tmp != 0) szStack += tmp; -- cgit v1.2.3-70-g09d2 From 8b4f35532c8fd7c7f0939756923fdaf14ee39531 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 10 Jul 2014 15:38:09 +0200 Subject: Removed unsafe pointer typedefs - If a variable doesn't look like a pointer... Maybe it might be a pointer after all. Please, give me back my '*' sign. - See CERT DCL05-C. Signed-off-by: Haru --- src/common/console.h | 6 +-- src/common/db.c | 106 +++++++++++++++++++++++------------------------ src/common/ers.c | 14 +++---- src/common/ers.h | 4 +- src/common/mutex.c | 20 ++++----- src/common/mutex.h | 24 +++++------ src/common/spinlock.h | 12 +++--- src/common/thread.c | 28 ++++++------- src/common/thread.h | 16 +++---- src/test/test_spinlock.c | 2 +- 10 files changed, 116 insertions(+), 116 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/common/console.h b/src/common/console.h index d2c58f978..55a9a767c 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -53,10 +53,10 @@ struct { struct console_input_interface { /* vars */ SPIN_LOCK ptlock;/* parse thread lock */ - rAthread pthread;/* parse thread */ + rAthread *pthread;/* parse thread */ volatile int32 ptstate;/* parse thread state */ - ramutex ptmutex;/* parse thread mutex */ - racond ptcond;/* parse thread cond */ + ramutex *ptmutex;/* parse thread mutex */ + racond *ptcond;/* parse thread cond */ /* */ struct CParseEntry **cmd_list; struct CParseEntry **cmds; diff --git a/src/common/db.c b/src/common/db.c index 79e55023f..cf22d8245 100644 --- a/src/common/db.c +++ b/src/common/db.c @@ -145,7 +145,7 @@ typedef struct dbn { // Other node_color color; unsigned deleted : 1; -} *DBNode; +} DBNode; /** * Structure that holds a deleted node. @@ -155,8 +155,8 @@ typedef struct dbn { * @see DBMap_impl#free_list */ struct db_free { - DBNode node; - DBNode *root; + DBNode *node; + DBNode **root; }; /** @@ -193,12 +193,12 @@ typedef struct DBMap_impl { unsigned int free_max; unsigned int free_lock; // Other - ERS nodes; + ERS *nodes; DBComparator cmp; DBHasher hash; DBReleaser release; - DBNode ht[HASH_SIZE]; - DBNode cache; + DBNode *ht[HASH_SIZE]; + DBNode *cache; DBType type; DBOptions options; uint32 item_count; @@ -222,7 +222,7 @@ typedef struct DBIterator_impl { struct DBIterator vtable; DBMap_impl* db; int ht_index; - DBNode node; + DBNode *node; } DBIterator_impl; #if defined(DB_ENABLE_STATS) @@ -361,12 +361,12 @@ struct eri *db_alloc_ers; * @param node Node to be rotated * @param root Pointer to the root of the tree * @private - * @see #db_rebalance(DBNode,DBNode *) - * @see #db_rebalance_erase(DBNode,DBNode *) + * @see #db_rebalance(DBNode *,DBNode **) + * @see #db_rebalance_erase(DBNode *,DBNode **) */ -static void db_rotate_left(DBNode node, DBNode *root) +static void db_rotate_left(DBNode *node, DBNode **root) { - DBNode y = node->right; + DBNode *y = node->right; DB_COUNTSTAT(db_rotate_left); // put the left of y at the right of node @@ -392,12 +392,12 @@ static void db_rotate_left(DBNode node, DBNode *root) * @param node Node to be rotated * @param root Pointer to the root of the tree * @private - * @see #db_rebalance(DBNode,DBNode *) - * @see #db_rebalance_erase(DBNode,DBNode *) + * @see #db_rebalance(DBNode *,DBNode **) + * @see #db_rebalance_erase(DBNode *,DBNode **) */ -static void db_rotate_right(DBNode node, DBNode *root) +static void db_rotate_right(DBNode *node, DBNode **root) { - DBNode y = node->left; + DBNode *y = node->left; DB_COUNTSTAT(db_rotate_right); // put the right of y at the left of node @@ -424,13 +424,13 @@ static void db_rotate_right(DBNode node, DBNode *root) * @param node Node to be rebalanced * @param root Pointer to the root of the tree * @private - * @see #db_rotate_left(DBNode,DBNode *) - * @see #db_rotate_right(DBNode,DBNode *) + * @see #db_rotate_left(DBNode *,DBNode **) + * @see #db_rotate_right(DBNode *,DBNode **) * @see #db_obj_put(DBMap*,DBKey,DBData) */ -static void db_rebalance(DBNode node, DBNode *root) +static void db_rebalance(DBNode *node, DBNode **root) { - DBNode y; + DBNode *y; DB_COUNTSTAT(db_rebalance); // Restore the RED-BLACK properties @@ -486,16 +486,16 @@ static void db_rebalance(DBNode node, DBNode *root) * @param node Node to be erased from the tree * @param root Root of the tree * @private - * @see #db_rotate_left(DBNode,DBNode *) - * @see #db_rotate_right(DBNode,DBNode *) + * @see #db_rotate_left(DBNode *,DBNode **) + * @see #db_rotate_right(DBNode *,DBNode **) * @see #db_free_unlock(DBMap_impl*) */ -static void db_rebalance_erase(DBNode node, DBNode *root) +static void db_rebalance_erase(DBNode *node, DBNode **root) { - DBNode y = node; - DBNode x = NULL; - DBNode x_parent = NULL; - DBNode w; + DBNode *y = node; + DBNode *x = NULL; + DBNode *x_parent = NULL; + DBNode *w; DB_COUNTSTAT(db_rebalance_erase); // Select where to change the tree @@ -650,8 +650,8 @@ static int db_is_key_null(DBType type, DBKey key) * @param key Key to be duplicated * @param Duplicated key * @private - * @see #db_free_add(DBMap_impl*,DBNode,DBNode *) - * @see #db_free_remove(DBMap_impl*,DBNode) + * @see #db_free_add(DBMap_impl*,DBNode *,DBNode **) + * @see #db_free_remove(DBMap_impl*,DBNode *) * @see #db_obj_put(DBMap*,DBKey,void *) * @see #db_dup_key_free(DBMap_impl*,DBKey) */ @@ -710,9 +710,9 @@ static void db_dup_key_free(DBMap_impl* db, DBKey key) * @see DBMap_impl#free_count * @see DBMap_impl#free_max * @see #db_obj_remove(DBMap*,DBKey) - * @see #db_free_remove(DBMap_impl*,DBNode) + * @see #db_free_remove(DBMap_impl*,DBNode *) */ -static void db_free_add(DBMap_impl* db, DBNode node, DBNode *root) +static void db_free_add(DBMap_impl* db, DBNode *node, DBNode **root) { DBKey old_key; @@ -759,9 +759,9 @@ static void db_free_add(DBMap_impl* db, DBNode node, DBNode *root) * @see DBMap_impl#free_list * @see DBMap_impl#free_count * @see #db_obj_put(DBMap*,DBKey,DBData) - * @see #db_free_add(DBMap_impl*,DBNode*,DBNode) + * @see #db_free_add(DBMap_impl*,DBNode**,DBNode*) */ -static void db_free_remove(DBMap_impl* db, DBNode node) +static void db_free_remove(DBMap_impl* db, DBNode *node) { unsigned int i; @@ -810,7 +810,7 @@ static void db_free_lock(DBMap_impl* db) * @param db Target database * @private * @see DBMap_impl#free_lock - * @see #db_free_dbn(DBNode) + * @see #db_free_dbn(DBNode*) * @see #db_lock(DBMap_impl*) */ static void db_free_unlock(DBMap_impl* db) @@ -1267,8 +1267,8 @@ DBData* dbit_obj_last(DBIterator* self, DBKey* out_key) DBData* dbit_obj_next(DBIterator* self, DBKey* out_key) { DBIterator_impl* it = (DBIterator_impl*)self; - DBNode node; - DBNode parent; + DBNode *node; + DBNode *parent; struct dbn fake; DB_COUNTSTAT(dbit_next); @@ -1343,8 +1343,8 @@ DBData* dbit_obj_next(DBIterator* self, DBKey* out_key) DBData* dbit_obj_prev(DBIterator* self, DBKey* out_key) { DBIterator_impl* it = (DBIterator_impl*)self; - DBNode node; - DBNode parent; + DBNode *node; + DBNode *parent; struct dbn fake; DB_COUNTSTAT(dbit_prev); @@ -1439,7 +1439,7 @@ bool dbit_obj_exists(DBIterator* self) int dbit_obj_remove(DBIterator* self, DBData *out_data) { DBIterator_impl* it = (DBIterator_impl*)self; - DBNode node; + DBNode *node; int retval = 0; DB_COUNTSTAT(dbit_remove); @@ -1518,7 +1518,7 @@ static DBIterator* db_obj_iterator(DBMap* self) static bool db_obj_exists(DBMap* self, DBKey key) { DBMap_impl* db = (DBMap_impl*)self; - DBNode node; + DBNode *node; int c; bool found = false; @@ -1569,7 +1569,7 @@ static bool db_obj_exists(DBMap* self, DBKey key) static DBData* db_obj_get(DBMap* self, DBKey key) { DBMap_impl* db = (DBMap_impl*)self; - DBNode node; + DBNode *node; int c; DBData *data = NULL; @@ -1630,8 +1630,8 @@ static unsigned int db_obj_vgetall(DBMap* self, DBData **buf, unsigned int max, { DBMap_impl* db = (DBMap_impl*)self; unsigned int i; - DBNode node; - DBNode parent; + DBNode *node; + DBNode *parent; unsigned int ret = 0; DB_COUNTSTAT(db_vgetall); @@ -1727,8 +1727,8 @@ static unsigned int db_obj_getall(DBMap* self, DBData **buf, unsigned int max, D static DBData* db_obj_vensure(DBMap* self, DBKey key, DBCreateData create, va_list args) { DBMap_impl* db = (DBMap_impl*)self; - DBNode node; - DBNode parent = NULL; + DBNode *node; + DBNode *parent = NULL; unsigned int hash; int c = 0; DBData *data = NULL; @@ -1856,8 +1856,8 @@ static DBData* db_obj_ensure(DBMap* self, DBKey key, DBCreateData create, ...) static int db_obj_put(DBMap* self, DBKey key, DBData data, DBData *out_data) { DBMap_impl* db = (DBMap_impl*)self; - DBNode node; - DBNode parent = NULL; + DBNode *node; + DBNode *parent = NULL; int c = 0, retval = 0; unsigned int hash; @@ -1949,19 +1949,19 @@ static int db_obj_put(DBMap* self, DBKey key, DBData data, DBData *out_data) /** * Remove an entry from the database. * Puts the previous data in out_data, if out_data is not NULL. - * NOTE: The key (of the database) is released in {@link #db_free_add(DBMap_impl*,DBNode,DBNode *)}. + * NOTE: The key (of the database) is released in {@link #db_free_add(DBMap_impl*,DBNode*,DBNode **)}. * @param self Interface of the database * @param key Key that identifies the entry * @param out_data Previous data if the entry exists * @return 1 if if the entry already exists, 0 otherwise * @protected - * @see #db_free_add(DBMap_impl*,DBNode,DBNode *) + * @see #db_free_add(DBMap_impl*,DBNode*,DBNode **) * @see DBMap#remove */ static int db_obj_remove(DBMap* self, DBKey key, DBData *out_data) { DBMap_impl* db = (DBMap_impl*)self; - DBNode node; + DBNode *node; unsigned int hash; int c = 0, retval = 0; @@ -2018,8 +2018,8 @@ static int db_obj_vforeach(DBMap* self, DBApply func, va_list args) DBMap_impl* db = (DBMap_impl*)self; unsigned int i; int sum = 0; - DBNode node; - DBNode parent; + DBNode *node; + DBNode *parent; DB_COUNTSTAT(db_vforeach); if (db == NULL) return 0; // nullpo candidate @@ -2104,8 +2104,8 @@ static int db_obj_vclear(DBMap* self, DBApply func, va_list args) DBMap_impl* db = (DBMap_impl*)self; int sum = 0; unsigned int i; - DBNode node; - DBNode parent; + DBNode *node; + DBNode *parent; DB_COUNTSTAT(db_vclear); if (db == NULL) return 0; // nullpo candidate diff --git a/src/common/ers.c b/src/common/ers.c index 0842d9e15..c8a11d2a9 100644 --- a/src/common/ers.c +++ b/src/common/ers.c @@ -185,7 +185,7 @@ static void ers_free_cache(ers_cache_t *cache, bool remove) aFree(cache); } -static void *ers_obj_alloc_entry(ERS self) +static void *ers_obj_alloc_entry(ERS *self) { struct ers_instance_t *instance = (struct ers_instance_t *)self; void *ret; @@ -225,7 +225,7 @@ static void *ers_obj_alloc_entry(ERS self) return ret; } -static void ers_obj_free_entry(ERS self, void *entry) +static void ers_obj_free_entry(ERS *self, void *entry) { struct ers_instance_t *instance = (struct ers_instance_t *)self; struct ers_list *reuse = (struct ers_list *)((unsigned char *)entry - sizeof(struct ers_list)); @@ -247,7 +247,7 @@ static void ers_obj_free_entry(ERS self, void *entry) instance->Cache->UsedObjs--; } -static size_t ers_obj_entry_size(ERS self) +static size_t ers_obj_entry_size(ERS *self) { struct ers_instance_t *instance = (struct ers_instance_t *)self; @@ -259,7 +259,7 @@ static size_t ers_obj_entry_size(ERS self) return instance->Cache->ObjectSize; } -static void ers_obj_destroy(ERS self) +static void ers_obj_destroy(ERS *self) { struct ers_instance_t *instance = (struct ers_instance_t *)self; @@ -289,7 +289,7 @@ static void ers_obj_destroy(ERS self) aFree(instance); } -void ers_cache_size(ERS self, unsigned int new_size) { +void ers_cache_size(ERS *self, unsigned int new_size) { struct ers_instance_t *instance = (struct ers_instance_t *)self; nullpo_retv(instance); @@ -302,7 +302,7 @@ void ers_cache_size(ERS self, unsigned int new_size) { } -ERS ers_new(uint32 size, char *name, enum ERSOptions options) +ERS *ers_new(uint32 size, char *name, enum ERSOptions options) { struct ers_instance_t *instance; CREATE(instance,struct ers_instance_t, 1); @@ -387,7 +387,7 @@ void ers_final(void) { while( instance ) { next = instance->Next; - ers_obj_destroy((ERS)instance); + ers_obj_destroy((ERS*)instance); instance = next; } } diff --git a/src/common/ers.h b/src/common/ers.h index f32680339..e11f7f37e 100644 --- a/src/common/ers.h +++ b/src/common/ers.h @@ -126,7 +126,7 @@ typedef struct eri { /* */ void (*chunk_size) (struct eri *self, unsigned int new_size); -} *ERS; +} ERS; #ifdef DISABLE_ERS // Use memory manager to allocate/free and disable other interface functions @@ -158,7 +158,7 @@ typedef struct eri { * @param The requested size of the entry in bytes * @return Interface of the object */ -ERS ers_new(uint32 size, char *name, enum ERSOptions options); +ERS *ers_new(uint32 size, char *name, enum ERSOptions options); /** * Print a report about the current state of the Entry Reusage System. diff --git a/src/common/mutex.c b/src/common/mutex.c index 626dfa2e1..6707df7e6 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -50,7 +50,7 @@ struct racond{ // -ramutex ramutex_create(){ +ramutex *ramutex_create() { struct ramutex *m; m = (struct ramutex*)aMalloc( sizeof(struct ramutex) ); @@ -69,7 +69,7 @@ ramutex ramutex_create(){ }//end: ramutex_create() -void ramutex_destroy( ramutex m ){ +void ramutex_destroy(ramutex *m) { #ifdef WIN32 DeleteCriticalSection(&m->hMutex); @@ -82,7 +82,7 @@ void ramutex_destroy( ramutex m ){ }//end: ramutex_destroy() -void ramutex_lock( ramutex m ){ +void ramutex_lock(ramutex *m) { #ifdef WIN32 EnterCriticalSection(&m->hMutex); @@ -92,7 +92,7 @@ void ramutex_lock( ramutex m ){ }//end: ramutex_lock -bool ramutex_trylock( ramutex m ){ +bool ramutex_trylock(ramutex *m) { #ifdef WIN32 if(TryEnterCriticalSection(&m->hMutex) == TRUE) return true; @@ -107,7 +107,7 @@ bool ramutex_trylock( ramutex m ){ }//end: ramutex_trylock() -void ramutex_unlock( ramutex m ){ +void ramutex_unlock(ramutex *m) { #ifdef WIN32 LeaveCriticalSection(&m->hMutex); #else @@ -124,7 +124,7 @@ void ramutex_unlock( ramutex m ){ // Implementation: // -racond racond_create(){ +racond *racond_create() { struct racond *c; c = (struct racond*)aMalloc( sizeof(struct racond) ); @@ -146,7 +146,7 @@ racond racond_create(){ }//end: racond_create() -void racond_destroy( racond c ){ +void racond_destroy(racond *c) { #ifdef WIN32 CloseHandle( c->events[ EVENT_COND_SIGNAL ] ); CloseHandle( c->events[ EVENT_COND_BROADCAST ] ); @@ -159,7 +159,7 @@ void racond_destroy( racond c ){ }//end: racond_destroy() -void racond_wait( racond c, ramutex m, sysint timeout_ticks){ +void racond_wait(racond *c, ramutex *m, sysint timeout_ticks) { #ifdef WIN32 register DWORD ms; int result; @@ -217,7 +217,7 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks){ }//end: racond_wait() -void racond_signal( racond c ){ +void racond_signal(racond *c) { #ifdef WIN32 // bool has_waiters = false; // EnterCriticalSection(&c->waiters_lock); @@ -233,7 +233,7 @@ void racond_signal( racond c ){ }//end: racond_signal() -void racond_broadcast( racond c ){ +void racond_broadcast(racond *c) { #ifdef WIN32 // bool has_waiters = false; // EnterCriticalSection(&c->waiters_lock); diff --git a/src/common/mutex.h b/src/common/mutex.h index ce13a28b7..ced91ab8e 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -6,29 +6,29 @@ #include "../common/cbasetypes.h" -typedef struct ramutex *ramutex; // Mutex -typedef struct racond *racond; // Condition Var +typedef struct ramutex ramutex; // Mutex +typedef struct racond racond; // Condition Var /** * Creates a Mutex * * @return not NULL */ -ramutex ramutex_create(); +ramutex *ramutex_create(); /** * Destroys a Mutex * * @param m - the mutex to destroy */ -void ramutex_destroy( ramutex m ); +void ramutex_destroy(ramutex *m); /** * Gets a lock * * @param m - the mutex to lock */ -void ramutex_lock( ramutex m); +void ramutex_lock(ramutex *m); /** * Trys to get the Lock @@ -37,14 +37,14 @@ void ramutex_lock( ramutex m); * * @return boolean (true = got the lock) */ -bool ramutex_trylock( ramutex m ); +bool ramutex_trylock(ramutex *m); /** * Unlocks a mutex * * @param m - the mutex to unlock */ -void ramutex_unlock( ramutex m); +void ramutex_unlock(ramutex *m); /** @@ -52,14 +52,14 @@ void ramutex_unlock( ramutex m); * * @return not NULL */ -racond racond_create(); +racond *racond_create(); /** * Destroy a Condition variable * * @param c - the condition variable to destroy */ -void racond_destroy( racond c ); +void racond_destroy(racond *c); /** * Waits Until state is signaled @@ -68,7 +68,7 @@ void racond_destroy( racond c ); * @param m - the mutex used for synchronization * @param timeout_ticks - timeout in ticks ( -1 = INFINITE ) */ -void racond_wait( racond c, ramutex m, sysint timeout_ticks); +void racond_wait(racond *c, ramutex *m, sysint timeout_ticks); /** * Sets the given condition var to signaled state @@ -78,7 +78,7 @@ void racond_wait( racond c, ramutex m, sysint timeout_ticks); * @note: * Only one waiter gets notified. */ -void racond_signal( racond c ); +void racond_signal(racond *c); /** * Sets notifies all waiting threads thats signaled. @@ -87,7 +87,7 @@ void racond_signal( racond c ); * @note: * All Waiters getting notified. */ -void racond_broadcast( racond c ); +void racond_broadcast(racond *c); #endif /* _COMMON_MUTEX_H_ */ diff --git a/src/common/spinlock.h b/src/common/spinlock.h index fe0da6669..5d57c6462 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -28,25 +28,25 @@ typedef struct __declspec( align(64) ) SPIN_LOCK{ volatile LONG lock; volatile LONG nest; volatile LONG sync_lock; -} SPIN_LOCK, *PSPIN_LOCK; +} SPIN_LOCK; #else typedef struct SPIN_LOCK{ volatile int32 lock; volatile int32 nest; // nesting level. volatile int32 sync_lock; -} __attribute__((aligned(64))) SPIN_LOCK, *PSPIN_LOCK; +} __attribute__((aligned(64))) SPIN_LOCK; #endif -static forceinline void InitializeSpinLock(PSPIN_LOCK lck){ +static forceinline void InitializeSpinLock(SPIN_LOCK *lck){ lck->lock = 0; lck->nest = 0; lck->sync_lock = 0; } -static forceinline void FinalizeSpinLock(PSPIN_LOCK lck){ +static forceinline void FinalizeSpinLock(SPIN_LOCK *lck){ return; } @@ -54,7 +54,7 @@ static forceinline void FinalizeSpinLock(PSPIN_LOCK lck){ #define getsynclock(l) do { if(InterlockedCompareExchange((l), 1, 0) == 0) break; rathread_yield(); } while(/*always*/1) #define dropsynclock(l) do { InterlockedExchange((l), 0); } while(0) -static forceinline void EnterSpinLock(PSPIN_LOCK lck){ +static forceinline void EnterSpinLock(SPIN_LOCK *lck){ int tid = rathread_get_tid(); // Get Sync Lock && Check if the requester thread already owns the lock. @@ -84,7 +84,7 @@ static forceinline void EnterSpinLock(PSPIN_LOCK lck){ } -static forceinline void LeaveSpinLock(PSPIN_LOCK lck){ +static forceinline void LeaveSpinLock(SPIN_LOCK *lck){ int tid = rathread_get_tid(); getsynclock(&lck->sync_lock); diff --git a/src/common/thread.c b/src/common/thread.c index 933ee2c0e..d8e0dbf0a 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -98,7 +98,7 @@ void rathread_final(){ // gets called whenever a thread terminated .. -static void rat_thread_terminated(rAthread handle) { +static void rat_thread_terminated(rAthread *handle) { // Preserve handle->myID and handle->hThread, set everything else to its default value handle->param = NULL; handle->proc = NULL; @@ -115,7 +115,7 @@ static void *_raThreadMainRedirector( void *p ){ // Update myID @ TLS to right id. #ifdef HAS_TLS - g_rathread_ID = ((rAthread)p)->myID; + g_rathread_ID = ((rAthread*)p)->myID; #endif #ifndef WIN32 @@ -133,13 +133,13 @@ static void *_raThreadMainRedirector( void *p ){ #endif - ret = ((rAthread)p)->proc( ((rAthread)p)->param ) ; + ret = ((rAthread*)p)->proc( ((rAthread*)p)->param ) ; #ifdef WIN32 - CloseHandle( ((rAthread)p)->hThread ); + CloseHandle( ((rAthread*)p)->hThread ); #endif - rat_thread_terminated( (rAthread)p ); + rat_thread_terminated( (rAthread*)p ); #ifdef WIN32 return (DWORD)ret; #else @@ -154,18 +154,18 @@ static void *_raThreadMainRedirector( void *p ){ /// /// API Level /// -rAthread rathread_create( rAthreadProc entryPoint, void *param ){ +rAthread *rathread_create(rAthreadProc entryPoint, void *param) { return rathread_createEx( entryPoint, param, (1<<23) /*8MB*/, RAT_PRIO_NORMAL ); }//end: rathread_create() -rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio ){ +rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio) { #ifndef WIN32 pthread_attr_t attr; #endif size_t tmp; unsigned int i; - rAthread handle = NULL; + rAthread *handle = NULL; // given stacksize aligned to systems pagesize? @@ -212,7 +212,7 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta }//end: rathread_createEx -void rathread_destroy ( rAthread handle ){ +void rathread_destroy(rAthread *handle) { #ifdef WIN32 if( TerminateThread(handle->hThread, 0) != FALSE){ CloseHandle(handle->hThread); @@ -230,9 +230,9 @@ void rathread_destroy ( rAthread handle ){ #endif }//end: rathread_destroy() -rAthread rathread_self( ){ +rAthread *rathread_self() { #ifdef HAS_TLS - rAthread handle = &l_threads[g_rathread_ID]; + rAthread *handle = &l_threads[g_rathread_ID]; if(handle->proc != NULL) // entry point set, so its used! return handle; @@ -276,7 +276,7 @@ int rathread_get_tid(){ }//end: rathread_get_tid() -bool rathread_wait( rAthread handle, void* *out_exitCode ){ +bool rathread_wait(rAthread *handle, void **out_exitCode) { // Hint: // no thread data cleanup routine call here! @@ -294,13 +294,13 @@ bool rathread_wait( rAthread handle, void* *out_exitCode ){ }//end: rathread_wait() -void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio ){ +void rathread_prio_set(rAthread *handle, RATHREAD_PRIO prio) { handle->prio = RAT_PRIO_NORMAL; //@TODO }//end: rathread_prio_set() -RATHREAD_PRIO rathread_prio_get( rAthread handle){ +RATHREAD_PRIO rathread_prio_get(rAthread *handle) { return handle->prio; }//end: rathread_prio_get() diff --git a/src/common/thread.h b/src/common/thread.h index 992e3e6c8..3b5ce7476 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -6,7 +6,7 @@ #include "../common/cbasetypes.h" -typedef struct rAthread *rAthread; +typedef struct rAthread rAthread; typedef void* (*rAthreadProc)(void*); typedef enum RATHREAD_PRIO { @@ -24,7 +24,7 @@ typedef enum RATHREAD_PRIO { * * @return not NULL if success */ -rAthread rathread_create( rAthreadProc entryPoint, void *param ); +rAthread *rathread_create(rAthreadProc entryPoint, void *param); /** @@ -37,7 +37,7 @@ rAthread rathread_create( rAthreadProc entryPoint, void *param ); * * @return not NULL if success */ -rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio ); +rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack, RATHREAD_PRIO prio); /** @@ -47,7 +47,7 @@ rAthread rathread_createEx( rAthreadProc entryPoint, void *param, size_t szSta * * @param handle - thread to destroy. */ -void rathread_destroy ( rAthread handle ); +void rathread_destroy(rAthread *handle); /** @@ -58,7 +58,7 @@ void rathread_destroy ( rAthread handle ); * * @return not NULL if success */ -rAthread rathread_self( ); +rAthread *rathread_self(); /** @@ -80,7 +80,7 @@ int rathread_get_tid(); * * @return true - if the given thread has been terminated. */ -bool rathread_wait( rAthread handle, void* *out_exitCode ); +bool rathread_wait(rAthread *handle, void **out_exitCode); /** @@ -89,7 +89,7 @@ bool rathread_wait( rAthread handle, void* *out_exitCode ); * @param handle - thread to set prio for * @param rio - the priority (RAT_PRIO_LOW ... ) */ -void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio ); +void rathread_prio_set(rAthread *handle, RATHREAD_PRIO prio); /** @@ -97,7 +97,7 @@ void rathread_prio_set( rAthread handle, RATHREAD_PRIO prio ); * * @param handle - the thread to get the prio for. */ -RATHREAD_PRIO rathread_prio_get( rAthread handle); +RATHREAD_PRIO rathread_prio_get(rAthread *handle); /** diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c index 0c0e3e2ae..2f4c2a5ca 100644 --- a/src/test/test_spinlock.c +++ b/src/test/test_spinlock.c @@ -43,7 +43,7 @@ static void *worker(void *p){ int do_init(int argc, char **argv){ - rAthread t[THRC]; + rAthread *t[THRC]; int j, i; int ok; -- cgit v1.2.3-70-g09d2 From 68e7f53f05dd80e8b4ab9d84c9931df22a6b060c Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 10 Jul 2014 16:59:55 +0200 Subject: Fixed reserved __identifier violations - Complies with CERT DCL37-C - Fixes issue #293 (special thanks to elfring) Signed-off-by: Haru --- src/char/char.h | 6 +- src/char/int_auction.h | 6 +- src/char/int_elemental.h | 6 +- src/char/int_guild.h | 6 +- src/char/int_homun.h | 6 +- src/char/int_mail.h | 6 +- src/char/int_mercenary.h | 6 +- src/char/int_party.h | 6 +- src/char/int_pet.h | 6 +- src/char/int_quest.h | 6 +- src/char/int_storage.h | 6 +- src/char/inter.h | 6 +- src/char/pincode.h | 6 +- src/common/HPM.h | 6 +- src/common/HPMDataCheck.h | 144 ++++++++++++++++++------------------ src/common/HPMi.h | 6 +- src/common/atomic.h | 6 +- src/common/cbasetypes.h | 10 +-- src/common/conf.h | 6 +- src/common/console.h | 6 +- src/common/core.h | 6 +- src/common/db.h | 6 +- src/common/des.h | 6 +- src/common/ers.h | 6 +- src/common/grfio.c | 2 +- src/common/grfio.h | 6 +- src/common/malloc.c | 33 ++++----- src/common/malloc.h | 6 +- src/common/mapindex.h | 6 +- src/common/md5calc.h | 6 +- src/common/mmo.h | 6 +- src/common/mutex.h | 6 +- src/common/nullpo.h | 6 +- src/common/random.h | 6 +- src/common/showmsg.c | 30 ++++---- src/common/showmsg.h | 8 +- src/common/socket.c | 12 +-- src/common/socket.h | 10 +-- src/common/spinlock.h | 6 +- src/common/sql.h | 6 +- src/common/strlib.c | 6 +- src/common/strlib.h | 14 ++-- src/common/sysinfo.h | 6 +- src/common/thread.c | 10 +-- src/common/thread.h | 6 +- src/common/timer.c | 10 +-- src/common/timer.h | 6 +- src/common/utils.h | 6 +- src/config/classes/general.h | 6 +- src/config/const.h | 6 +- src/config/core.h | 6 +- src/config/renewal.h | 6 +- src/config/secure.h | 6 +- src/login/account.h | 6 +- src/login/ipban.h | 6 +- src/login/login.h | 6 +- src/login/loginlog.h | 6 +- src/map/HPMmap.h | 6 +- src/map/atcommand.c | 2 +- src/map/atcommand.h | 6 +- src/map/battle.c | 2 +- src/map/battle.h | 6 +- src/map/battleground.h | 6 +- src/map/buyingstore.h | 6 +- src/map/chat.h | 6 +- src/map/chrif.h | 6 +- src/map/clif.c | 2 +- src/map/clif.h | 6 +- src/map/date.h | 6 +- src/map/duel.h | 6 +- src/map/elemental.h | 6 +- src/map/guild.c | 6 +- src/map/guild.h | 6 +- src/map/homunculus.h | 6 +- src/map/instance.h | 6 +- src/map/intif.c | 2 +- src/map/intif.h | 6 +- src/map/irc-bot.h | 6 +- src/map/itemdb.h | 6 +- src/map/log.h | 6 +- src/map/mail.h | 6 +- src/map/map.h | 10 +-- src/map/mapreg.h | 6 +- src/map/mercenary.h | 6 +- src/map/mob.h | 6 +- src/map/npc.c | 2 +- src/map/npc.h | 6 +- src/map/packets.h | 6 +- src/map/packets_struct.h | 6 +- src/map/party.h | 6 +- src/map/path.h | 6 +- src/map/pc.c | 4 +- src/map/pc.h | 6 +- src/map/pc_groups.h | 6 +- src/map/pet.h | 6 +- src/map/quest.h | 6 +- src/map/script.c | 48 ++++++------ src/map/script.h | 6 +- src/map/searchstore.h | 6 +- src/map/skill.h | 6 +- src/map/status.h | 6 +- src/map/storage.c | 6 +- src/map/storage.h | 8 +- src/map/trade.h | 6 +- src/map/unit.h | 6 +- src/map/vending.h | 6 +- tools/HPMHookGen/HPMDataCheckGen.pl | 8 +- 107 files changed, 441 insertions(+), 446 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/char/char.h b/src/char/char.h index 09a78f6b9..5a70d2ca7 100644 --- a/src/char/char.h +++ b/src/char/char.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_CHAR_H_ -#define _COMMON_CHAR_H_ +#ifndef COMMON_CHAR_H +#define COMMON_CHAR_H #include "../common/core.h" // CORE_ST_LAST #include "../common/db.h" @@ -123,4 +123,4 @@ void global_accreg_to_login_start (int account_id, int char_id); void global_accreg_to_login_send (void); void global_accreg_to_login_add (const char *key, unsigned int index, intptr_t val, bool is_string); -#endif /* _COMMON_CHAR_H_ */ +#endif /* COMMON_CHAR_H */ diff --git a/src/char/int_auction.h b/src/char/int_auction.h index f10794f73..17fd75a58 100644 --- a/src/char/int_auction.h +++ b/src/char/int_auction.h @@ -1,12 +1,12 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_AUCTION_H_ -#define _CHAR_INT_AUCTION_H_ +#ifndef CHAR_INT_AUCTION_H +#define CHAR_INT_AUCTION_H int inter_auction_parse_frommap(int fd); int inter_auction_sql_init(void); void inter_auction_sql_final(void); -#endif /* _CHAR_INT_AUCTION_H_ */ +#endif /* CHAR_INT_AUCTION_H */ diff --git a/src/char/int_elemental.h b/src/char/int_elemental.h index c869e6fc2..e28cfedea 100644 --- a/src/char/int_elemental.h +++ b/src/char/int_elemental.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_ELEMENTAL_H_ -#define _CHAR_INT_ELEMENTAL_H_ +#ifndef CHAR_INT_ELEMENTAL_H +#define CHAR_INT_ELEMENTAL_H #include "../common/cbasetypes.h" @@ -12,4 +12,4 @@ int inter_elemental_parse_frommap(int fd); bool mapif_elemental_delete(int ele_id); -#endif /* _CHAR_INT_ELEMENTAL_H_ */ +#endif /* CHAR_INT_ELEMENTAL_H */ diff --git a/src/char/int_guild.h b/src/char/int_guild.h index 5e657ff06..bc457d86b 100644 --- a/src/char/int_guild.h +++ b/src/char/int_guild.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_GUILD_H_ -#define _CHAR_INT_GUILD_H_ +#ifndef CHAR_INT_GUILD_H +#define CHAR_INT_GUILD_H enum { GS_BASIC = 0x0001, @@ -31,4 +31,4 @@ int inter_guild_charname_changed(int guild_id,int account_id, int char_id, char int inter_guild_CharOnline(int char_id, int guild_id); int inter_guild_CharOffline(int char_id, int guild_id); -#endif /* _CHAR_INT_GUILD_H_ */ +#endif /* CHAR_INT_GUILD_H */ diff --git a/src/char/int_homun.h b/src/char/int_homun.h index 9477f4f03..6fa4f9dc7 100644 --- a/src/char/int_homun.h +++ b/src/char/int_homun.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_HOMUN_H_ -#define _CHAR_INT_HOMUN_H_ +#ifndef CHAR_INT_HOMUN_H +#define CHAR_INT_HOMUN_H #include "../common/cbasetypes.h" @@ -17,4 +17,4 @@ bool mapif_homunculus_load(int homun_id, struct s_homunculus* hd); bool mapif_homunculus_delete(int homun_id); bool mapif_homunculus_rename(char *name); -#endif /* _CHAR_INT_HOMUN_H_ */ +#endif /* CHAR_INT_HOMUN_H */ diff --git a/src/char/int_mail.h b/src/char/int_mail.h index 824ba48a3..8800061d7 100644 --- a/src/char/int_mail.h +++ b/src/char/int_mail.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_MAIL_H_ -#define _CHAR_INT_MAIL_H_ +#ifndef CHAR_INT_MAIL_H +#define CHAR_INT_MAIL_H struct item; struct mail_message; @@ -16,4 +16,4 @@ void inter_mail_sql_final(void); int mail_savemessage(struct mail_message* msg); void mapif_Mail_new(struct mail_message *msg); -#endif /* _CHAR_INT_MAIL_H_ */ +#endif /* CHAR_INT_MAIL_H */ diff --git a/src/char/int_mercenary.h b/src/char/int_mercenary.h index 195a83b34..b03c20de3 100644 --- a/src/char/int_mercenary.h +++ b/src/char/int_mercenary.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_MERCENARY_H_ -#define _CHAR_INT_MERCENARY_H_ +#ifndef CHAR_INT_MERCENARY_H +#define CHAR_INT_MERCENARY_H #include "../common/cbasetypes.h" @@ -19,4 +19,4 @@ bool mercenary_owner_delete(int char_id); bool mapif_mercenary_delete(int merc_id); -#endif /* _CHAR_INT_MERCENARY_H_ */ +#endif /* CHAR_INT_MERCENARY_H */ diff --git a/src/char/int_party.h b/src/char/int_party.h index 33325b46b..2b24b1d1a 100644 --- a/src/char/int_party.h +++ b/src/char/int_party.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_PARTY_H_ -#define _CHAR_INT_PARTY_H_ +#ifndef CHAR_INT_PARTY_H +#define CHAR_INT_PARTY_H //Party Flags on what to save/delete. enum { @@ -21,4 +21,4 @@ int inter_party_leave(int party_id,int account_id, int char_id); int inter_party_CharOnline(int char_id, int party_id); int inter_party_CharOffline(int char_id, int party_id); -#endif /* _CHAR_INT_PARTY_H_ */ +#endif /* CHAR_INT_PARTY_H */ diff --git a/src/char/int_pet.h b/src/char/int_pet.h index a16cb7a37..52642fc54 100644 --- a/src/char/int_pet.h +++ b/src/char/int_pet.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_PET_H_ -#define _CHAR_INT_PET_H_ +#ifndef CHAR_INT_PET_H +#define CHAR_INT_PET_H struct s_pet; @@ -18,4 +18,4 @@ int inter_pet_sql_init(void); //Exported for use in the TXT-SQL converter. int inter_pet_tosql(int pet_id, struct s_pet *p); -#endif /* _CHAR_INT_PET_H_ */ +#endif /* CHAR_INT_PET_H */ diff --git a/src/char/int_quest.h b/src/char/int_quest.h index 6267c74ad..f0dd370ea 100644 --- a/src/char/int_quest.h +++ b/src/char/int_quest.h @@ -1,10 +1,10 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_QUEST_H_ -#define _CHAR_QUEST_H_ +#ifndef CHAR_QUEST_H +#define CHAR_QUEST_H int inter_quest_parse_frommap(int fd); -#endif /* _CHAR_QUEST_H_ */ +#endif /* CHAR_QUEST_H */ diff --git a/src/char/int_storage.h b/src/char/int_storage.h index 1693499a5..1cef94d98 100644 --- a/src/char/int_storage.h +++ b/src/char/int_storage.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _CHAR_INT_STORAGE_H_ -#define _CHAR_INT_STORAGE_H_ +#ifndef CHAR_INT_STORAGE_H +#define CHAR_INT_STORAGE_H struct storage_data; struct guild_storage; @@ -19,4 +19,4 @@ int storage_fromsql(int account_id, struct storage_data* p); int storage_tosql(int account_id,struct storage_data *p); int guild_storage_tosql(int guild_id, struct guild_storage *p); -#endif /* _CHAR_INT_STORAGE_H_ */ +#endif /* CHAR_INT_STORAGE_H */ diff --git a/src/char/inter.h b/src/char/inter.h index 5e655237e..ab2478ae6 100644 --- a/src/char/inter.h +++ b/src/char/inter.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _CHAR_INTER_H_ -#define _CHAR_INTER_H_ +#ifndef CHAR_INTER_H +#define CHAR_INTER_H #include "char.h" #include "../common/sql.h" @@ -30,4 +30,4 @@ extern Sql* lsql_handle; int inter_accreg_tosql(int account_id, int char_id, struct accreg *reg, int type); -#endif /* _CHAR_INTER_H_ */ +#endif /* CHAR_INTER_H */ diff --git a/src/char/pincode.h b/src/char/pincode.h index 3b71eec7c..1ed05095e 100644 --- a/src/char/pincode.h +++ b/src/char/pincode.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _CHAR_PINCODE_H_ -#define _CHAR_PINCODE_H_ +#ifndef CHAR_PINCODE_H +#define CHAR_PINCODE_H #include "char.h" @@ -40,4 +40,4 @@ struct pincode_interface *pincode; void pincode_defaults(void); -#endif /* _CHAR_PINCODE_H_ */ +#endif /* CHAR_PINCODE_H */ diff --git a/src/common/HPM.h b/src/common/HPM.h index 5667f605a..fe8d45066 100644 --- a/src/common/HPM.h +++ b/src/common/HPM.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#ifndef _COMMON_HPM_H_ -#define _COMMON_HPM_H_ +#ifndef COMMON_HPM_H +#define COMMON_HPM_H #ifndef HERCULES_CORE #error You should never include HPM.h from a plugin. @@ -158,4 +158,4 @@ struct HPM_interface *HPM; void hpm_defaults(void); -#endif /* _COMMON_HPM_H_ */ +#endif /* COMMON_HPM_H */ diff --git a/src/common/HPMDataCheck.h b/src/common/HPMDataCheck.h index c5ec3771d..79ec36472 100644 --- a/src/common/HPMDataCheck.h +++ b/src/common/HPMDataCheck.h @@ -3,140 +3,140 @@ // // NOTE: This file was auto-generated and should never be manually edited, // as it will get overwritten. -#ifndef _HPM_DATA_CHECK_H_ -#define _HPM_DATA_CHECK_H_ +#ifndef HPM_DATA_CHECK_H +#define HPM_DATA_CHECK_H HPExport const struct s_HPMDataCheck HPMDataCheck[] = { - #ifdef _COMMON_CONF_H_ + #ifdef COMMON_CONF_H { "libconfig_interface", sizeof(struct libconfig_interface) }, #else - #define _COMMON_CONF_H_ - #endif // _COMMON_CONF_H_ - #ifdef _COMMON_DB_H_ + #define COMMON_CONF_H + #endif // COMMON_CONF_H + #ifdef COMMON_DB_H { "DBData", sizeof(struct DBData) }, { "DBIterator", sizeof(struct DBIterator) }, { "DBMap", sizeof(struct DBMap) }, #else - #define _COMMON_DB_H_ - #endif // _COMMON_DB_H_ - #ifdef _COMMON_DES_H_ + #define COMMON_DB_H + #endif // COMMON_DB_H + #ifdef COMMON_DES_H { "BIT64", sizeof(struct BIT64) }, #else - #define _COMMON_DES_H_ - #endif // _COMMON_DES_H_ - #ifdef _COMMON_ERS_H_ + #define COMMON_DES_H + #endif // COMMON_DES_H + #ifdef COMMON_ERS_H { "eri", sizeof(struct eri) }, #else - #define _COMMON_ERS_H_ - #endif // _COMMON_ERS_H_ - #ifdef _COMMON_MAPINDEX_H_ + #define COMMON_ERS_H + #endif // COMMON_ERS_H + #ifdef COMMON_MAPINDEX_H { "mapindex_interface", sizeof(struct mapindex_interface) }, #else - #define _COMMON_MAPINDEX_H_ - #endif // _COMMON_MAPINDEX_H_ - #ifdef _COMMON_MMO_H_ + #define COMMON_MAPINDEX_H + #endif // COMMON_MAPINDEX_H + #ifdef COMMON_MMO_H { "quest", sizeof(struct quest) }, #else - #define _COMMON_MMO_H_ - #endif // _COMMON_MMO_H_ - #ifdef _COMMON_SOCKET_H_ + #define COMMON_MMO_H + #endif // COMMON_MMO_H + #ifdef COMMON_SOCKET_H { "socket_interface", sizeof(struct socket_interface) }, #else - #define _COMMON_SOCKET_H_ - #endif // _COMMON_SOCKET_H_ - #ifdef _COMMON_STRLIB_H_ + #define COMMON_SOCKET_H + #endif // COMMON_SOCKET_H + #ifdef COMMON_STRLIB_H { "StringBuf", sizeof(struct StringBuf) }, { "s_svstate", sizeof(struct s_svstate) }, #else - #define _COMMON_STRLIB_H_ - #endif // _COMMON_STRLIB_H_ - #ifdef _COMMON_SYSINFO_H_ + #define COMMON_STRLIB_H + #endif // COMMON_STRLIB_H + #ifdef COMMON_SYSINFO_H { "sysinfo_interface", sizeof(struct sysinfo_interface) }, #else - #define _COMMON_SYSINFO_H_ - #endif // _COMMON_SYSINFO_H_ - #ifdef _MAP_ATCOMMAND_H_ + #define COMMON_SYSINFO_H + #endif // COMMON_SYSINFO_H + #ifdef MAP_ATCOMMAND_H { "AliasInfo", sizeof(struct AliasInfo) }, { "atcommand_interface", sizeof(struct atcommand_interface) }, #else - #define _MAP_ATCOMMAND_H_ - #endif // _MAP_ATCOMMAND_H_ - #ifdef _MAP_BATTLE_H_ + #define MAP_ATCOMMAND_H + #endif // MAP_ATCOMMAND_H + #ifdef MAP_BATTLE_H { "Damage", sizeof(struct Damage) }, { "battle_interface", sizeof(struct battle_interface) }, #else - #define _MAP_BATTLE_H_ - #endif // _MAP_BATTLE_H_ - #ifdef _MAP_BUYINGSTORE_H_ + #define MAP_BATTLE_H + #endif // MAP_BATTLE_H + #ifdef MAP_BUYINGSTORE_H { "buyingstore_interface", sizeof(struct buyingstore_interface) }, { "s_buyingstore_item", sizeof(struct s_buyingstore_item) }, #else - #define _MAP_BUYINGSTORE_H_ - #endif // _MAP_BUYINGSTORE_H_ - #ifdef _MAP_CHRIF_H_ + #define MAP_BUYINGSTORE_H + #endif // MAP_BUYINGSTORE_H + #ifdef MAP_CHRIF_H { "auth_node", sizeof(struct auth_node) }, #else - #define _MAP_CHRIF_H_ - #endif // _MAP_CHRIF_H_ - #ifdef _MAP_CLIF_H_ + #define MAP_CHRIF_H + #endif // MAP_CHRIF_H + #ifdef MAP_CLIF_H { "clif_interface", sizeof(struct clif_interface) }, #else - #define _MAP_CLIF_H_ - #endif // _MAP_CLIF_H_ - #ifdef _MAP_ELEMENTAL_H_ + #define MAP_CLIF_H + #endif // MAP_CLIF_H + #ifdef MAP_ELEMENTAL_H { "elemental_skill", sizeof(struct elemental_skill) }, #else - #define _MAP_ELEMENTAL_H_ - #endif // _MAP_ELEMENTAL_H_ - #ifdef _MAP_GUILD_H_ + #define MAP_ELEMENTAL_H + #endif // MAP_ELEMENTAL_H + #ifdef MAP_GUILD_H { "eventlist", sizeof(struct eventlist) }, { "guardian_data", sizeof(struct guardian_data) }, #else - #define _MAP_GUILD_H_ - #endif // _MAP_GUILD_H_ - #ifdef _MAP_MAPREG_H_ + #define MAP_GUILD_H + #endif // MAP_GUILD_H + #ifdef MAP_MAPREG_H { "mapreg_save", sizeof(struct mapreg_save) }, #else - #define _MAP_MAPREG_H_ - #endif // _MAP_MAPREG_H_ - #ifdef _MAP_MAP_H_ + #define MAP_MAPREG_H + #endif // MAP_MAPREG_H + #ifdef MAP_MAP_H { "map_data_other_server", sizeof(struct map_data_other_server) }, #else - #define _MAP_MAP_H_ - #endif // _MAP_MAP_H_ - #ifdef _MAP_PACKETS_STRUCT_H_ + #define MAP_MAP_H + #endif // MAP_MAP_H + #ifdef MAP_PACKETS_STRUCT_H { "EQUIPSLOTINFO", sizeof(struct EQUIPSLOTINFO) }, #else - #define _MAP_PACKETS_STRUCT_H_ - #endif // _MAP_PACKETS_STRUCT_H_ - #ifdef _MAP_PC_H_ + #define MAP_PACKETS_STRUCT_H + #endif // MAP_PACKETS_STRUCT_H + #ifdef MAP_PC_H { "autotrade_vending", sizeof(struct autotrade_vending) }, { "item_cd", sizeof(struct item_cd) }, #else - #define _MAP_PC_H_ - #endif // _MAP_PC_H_ - #ifdef _MAP_SCRIPT_H_ + #define MAP_PC_H + #endif // MAP_PC_H + #ifdef MAP_SCRIPT_H { "Script_Config", sizeof(struct Script_Config) }, { "reg_db", sizeof(struct reg_db) }, { "script_interface", sizeof(struct script_interface) }, #else - #define _MAP_SCRIPT_H_ - #endif // _MAP_SCRIPT_H_ - #ifdef _MAP_SEARCHSTORE_H_ + #define MAP_SCRIPT_H + #endif // MAP_SCRIPT_H + #ifdef MAP_SEARCHSTORE_H { "searchstore_interface", sizeof(struct searchstore_interface) }, #else - #define _MAP_SEARCHSTORE_H_ - #endif // _MAP_SEARCHSTORE_H_ - #ifdef _MAP_SKILL_H_ + #define MAP_SEARCHSTORE_H + #endif // MAP_SEARCHSTORE_H + #ifdef MAP_SKILL_H { "skill_cd", sizeof(struct skill_cd) }, { "skill_condition", sizeof(struct skill_condition) }, { "skill_interface", sizeof(struct skill_interface) }, { "skill_unit_save", sizeof(struct skill_unit_save) }, #else - #define _MAP_SKILL_H_ - #endif // _MAP_SKILL_H_ + #define MAP_SKILL_H + #endif // MAP_SKILL_H }; HPExport unsigned int HPMDataCheckLen = ARRAYLENGTH(HPMDataCheck); -#endif /* _HPM_DATA_CHECK_H_ */ +#endif /* HPM_DATA_CHECK_H */ diff --git a/src/common/HPMi.h b/src/common/HPMi.h index b98e87d90..478cfbdd9 100644 --- a/src/common/HPMi.h +++ b/src/common/HPMi.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#ifndef _COMMON_HPMI_H_ -#define _COMMON_HPMI_H_ +#ifndef COMMON_HPMI_H +#define COMMON_HPMI_H #include "../common/cbasetypes.h" #include "../common/console.h" @@ -184,4 +184,4 @@ HPExport struct HPMi_interface { HPExport struct HPMi_interface *HPMi; #endif -#endif /* _COMMON_HPMI_H_ */ +#endif /* COMMON_HPMI_H */ diff --git a/src/common/atomic.h b/src/common/atomic.h index 526811a09..e73b1c464 100644 --- a/src/common/atomic.h +++ b/src/common/atomic.h @@ -1,8 +1,8 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _COMMON_ATOMIC_H_ -#define _COMMON_ATOMIC_H_ +#ifndef COMMON_ATOMIC_H +#define COMMON_ATOMIC_H // Atomic Operations // (Interlocked CompareExchange, Add .. and so on ..) @@ -146,4 +146,4 @@ static forceinline int32 InterlockedExchange(volatile int32 *target, int32 val){ #endif //endif compiler decision -#endif /* _COMMON_ATOMIC_H_ */ +#endif /* COMMON_ATOMIC_H */ diff --git a/src/common/cbasetypes.h b/src/common/cbasetypes.h index ac65b08a8..42075de8e 100644 --- a/src/common/cbasetypes.h +++ b/src/common/cbasetypes.h @@ -1,5 +1,5 @@ -#ifndef _COMMON_CBASETYPES_H_ -#define _COMMON_CBASETYPES_H_ +#ifndef COMMON_CBASETYPES_H +#define COMMON_CBASETYPES_H /* +--------+-----------+--------+---------+ * | ILP32 | LP64 | ILP64 | (LL)P64 | @@ -444,9 +444,9 @@ void SET_FUNCPOINTER(T1& var, T2 p) /* pointer size fix which fixes several gcc warnings */ #ifdef __64BIT__ - #define __64BPTRSIZE(y) ((intptr)(y)) + #define h64BPTRSIZE(y) ((intptr)(y)) #else - #define __64BPTRSIZE(y) (y) + #define h64BPTRSIZE(y) (y) #endif -#endif /* _COMMON_CBASETYPES_H_ */ +#endif /* COMMON_CBASETYPES_H */ diff --git a/src/common/conf.h b/src/common/conf.h index 7c275bec2..c232a035c 100644 --- a/src/common/conf.h +++ b/src/common/conf.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_CONF_H_ -#define _COMMON_CONF_H_ +#ifndef COMMON_CONF_H +#define COMMON_CONF_H #include "../common/cbasetypes.h" @@ -95,4 +95,4 @@ struct libconfig_interface *libconfig; void libconfig_defaults(void); -#endif // _COMMON_CONF_H_ +#endif // COMMON_CONF_H diff --git a/src/common/console.h b/src/common/console.h index 55a9a767c..062d48bbe 100644 --- a/src/common/console.h +++ b/src/common/console.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#ifndef _COMMON_CONSOLE_H_ -#define _COMMON_CONSOLE_H_ +#ifndef COMMON_CONSOLE_H +#define COMMON_CONSOLE_H #include "../config/core.h" // MAX_CONSOLE_INPUT @@ -93,4 +93,4 @@ struct console_interface *console; void console_defaults(void); -#endif /* _COMMON_CONSOLE_H_ */ +#endif /* COMMON_CONSOLE_H */ diff --git a/src/common/core.h b/src/common/core.h index ba75e6b01..a8337e1b9 100644 --- a/src/common/core.h +++ b/src/common/core.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_CORE_H_ -#define _COMMON_CORE_H_ +#ifndef COMMON_CORE_H +#define COMMON_CORE_H #include "../common/db.h" #include "../common/mmo.h" @@ -47,4 +47,4 @@ enum E_CORE_ST { /// If NULL, runflag is set to CORE_ST_STOP instead. extern void (*shutdown_callback)(void); -#endif /* _COMMON_CORE_H_ */ +#endif /* COMMON_CORE_H */ diff --git a/src/common/db.h b/src/common/db.h index 4f8d6be79..ed87e474b 100644 --- a/src/common/db.h +++ b/src/common/db.h @@ -39,8 +39,8 @@ * @encoding US-ASCII * * @see common#db.c * \*****************************************************************************/ -#ifndef _COMMON_DB_H_ -#define _COMMON_DB_H_ +#ifndef COMMON_DB_H +#define COMMON_DB_H #include @@ -1549,4 +1549,4 @@ void linkdb_foreach (struct linkdb_node** head, LinkDBFunc func, ...); -#endif /* _COMMON_DB_H_ */ +#endif /* COMMON_DB_H */ diff --git a/src/common/des.h b/src/common/des.h index 0f908a15b..2c7190f23 100644 --- a/src/common/des.h +++ b/src/common/des.h @@ -1,7 +1,7 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _COMMON_DES_H_ -#define _COMMON_DES_H_ +#ifndef COMMON_DES_H +#define COMMON_DES_H #include "../common/cbasetypes.h" @@ -13,4 +13,4 @@ void des_decrypt_block(BIT64* block); void des_decrypt(unsigned char* data, size_t size); -#endif // _COMMON_DES_H_ +#endif // COMMON_DES_H diff --git a/src/common/ers.h b/src/common/ers.h index e11f7f37e..904f7fb81 100644 --- a/src/common/ers.h +++ b/src/common/ers.h @@ -37,8 +37,8 @@ * @author Flavio @ Amazon Project * * @encoding US-ASCII * \*****************************************************************************/ -#ifndef _COMMON_ERS_H_ -#define _COMMON_ERS_H_ +#ifndef COMMON_ERS_H +#define COMMON_ERS_H #include "../common/cbasetypes.h" @@ -175,4 +175,4 @@ void ers_report(void); void ers_final(void); #endif /* DISABLE_ERS / not DISABLE_ERS */ -#endif /* _COMMON_ERS_H_ */ +#endif /* COMMON_ERS_H */ diff --git a/src/common/grfio.c b/src/common/grfio.c index f592812f6..6e628a512 100644 --- a/src/common/grfio.c +++ b/src/common/grfio.c @@ -23,7 +23,7 @@ //---------------------------- // file entry table struct //---------------------------- -typedef struct _FILELIST { +typedef struct FILELIST { int srclen; ///< compressed size int srclen_aligned; int declen; ///< original size diff --git a/src/common/grfio.h b/src/common/grfio.h index 930ed7e36..15659c17c 100644 --- a/src/common/grfio.h +++ b/src/common/grfio.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _COMMON_GRFIO_H_ -#define _COMMON_GRFIO_H_ +#ifndef COMMON_GRFIO_H +#define COMMON_GRFIO_H void grfio_init(const char* fname); void grfio_final(void); @@ -14,4 +14,4 @@ unsigned long grfio_crc32(const unsigned char *buf, unsigned int len); int decode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen); int encode_zip(void* dest, unsigned long* destLen, const void* source, unsigned long sourceLen); -#endif /* _COMMON_GRFIO_H_ */ +#endif /* COMMON_GRFIO_H */ diff --git a/src/common/malloc.c b/src/common/malloc.c index fbe8e2d9d..3c9fa9c54 100644 --- a/src/common/malloc.c +++ b/src/common/malloc.c @@ -235,14 +235,13 @@ static size_t hash2size( unsigned short hash ) } } -void* _mmalloc(size_t size, const char *file, int line, const char *func ) -{ +void *mmalloc_(size_t size, const char *file, int line, const char *func) { struct block *block; short size_hash = size2hash( size ); struct unit_head *head; if (((long) size) < 0) { - ShowError("_mmalloc: %d\n", size); + ShowError("mmalloc_: %d\n", size); return NULL; } @@ -341,15 +340,13 @@ void* _mmalloc(size_t size, const char *file, int line, const char *func ) return (char *)head + sizeof(struct unit_head) - sizeof(long); } -void* _mcalloc(size_t num, size_t size, const char *file, int line, const char *func ) -{ +void *mcalloc_(size_t num, size_t size, const char *file, int line, const char *func) { void *p = iMalloc->malloc(num * size,file,line,func); memset(p,0,num * size); return p; } -void* _mrealloc(void *memblock, size_t size, const char *file, int line, const char *func ) -{ +void *mrealloc_(void *memblock, size_t size, const char *file, int line, const char *func) { size_t old_size; if(memblock == NULL) { return iMalloc->malloc(size,file,line,func); @@ -373,8 +370,8 @@ void* _mrealloc(void *memblock, size_t size, const char *file, int line, const c } } -/* a _mrealloc clone with the difference it 'z'eroes the newly created memory */ -void* _mreallocz(void *memblock, size_t size, const char *file, int line, const char *func ) { +/* a mrealloc_ clone with the difference it 'z'eroes the newly created memory */ +void *mreallocz_(void *memblock, size_t size, const char *file, int line, const char *func) { size_t old_size; void *p = NULL; @@ -404,8 +401,7 @@ void* _mreallocz(void *memblock, size_t size, const char *file, int line, const } -char* _mstrdup(const char *p, const char *file, int line, const char *func ) -{ +char *mstrdup_(const char *p, const char *file, int line, const char *func) { if(p == NULL) { return NULL; } else { @@ -416,8 +412,7 @@ char* _mstrdup(const char *p, const char *file, int line, const char *func ) } } -void _mfree(void *ptr, const char *file, int line, const char *func ) -{ +void mfree_(void *ptr, const char *file, int line, const char *func) { struct unit_head *head; if (ptr == NULL) @@ -852,12 +847,12 @@ void malloc_defaults(void) { // Athena's built-in Memory Manager #ifdef USE_MEMMGR - iMalloc->malloc = _mmalloc; - iMalloc->calloc = _mcalloc; - iMalloc->realloc = _mrealloc; - iMalloc->reallocz= _mreallocz; - iMalloc->astrdup = _mstrdup; - iMalloc->free = _mfree; + iMalloc->malloc = mmalloc_; + iMalloc->calloc = mcalloc_; + iMalloc->realloc = mrealloc_; + iMalloc->reallocz= mreallocz_; + iMalloc->astrdup = mstrdup_; + iMalloc->free = mfree_; #else iMalloc->malloc = aMalloc_; iMalloc->calloc = aCalloc_; diff --git a/src/common/malloc.h b/src/common/malloc.h index 7309bb0f7..8dace2d68 100644 --- a/src/common/malloc.h +++ b/src/common/malloc.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _COMMON_MALLOC_H_ -#define _COMMON_MALLOC_H_ +#ifndef COMMON_MALLOC_H +#define COMMON_MALLOC_H #include "../common/cbasetypes.h" @@ -88,4 +88,4 @@ struct malloc_interface { void memmgr_report (int extra); struct malloc_interface *iMalloc; -#endif /* _COMMON_MALLOC_H_ */ +#endif /* COMMON_MALLOC_H */ diff --git a/src/common/mapindex.h b/src/common/mapindex.h index fa9b9e920..446a2422d 100644 --- a/src/common/mapindex.h +++ b/src/common/mapindex.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_MAPINDEX_H_ -#define _COMMON_MAPINDEX_H_ +#ifndef COMMON_MAPINDEX_H +#define COMMON_MAPINDEX_H #include "../common/db.h" #include "../common/mmo.h" @@ -90,4 +90,4 @@ struct mapindex_interface *mapindex; void mapindex_defaults(void); -#endif /* _COMMON_MAPINDEX_H_ */ +#endif /* COMMON_MAPINDEX_H */ diff --git a/src/common/md5calc.h b/src/common/md5calc.h index d0caf6787..740e2edcc 100644 --- a/src/common/md5calc.h +++ b/src/common/md5calc.h @@ -1,8 +1,8 @@ -#ifndef _COMMON_MD5CALC_H_ -#define _COMMON_MD5CALC_H_ +#ifndef COMMON_MD5CALC_H +#define COMMON_MD5CALC_H void MD5_String(const char * string, char * output); void MD5_Binary(const char * string, unsigned char * output); void MD5_Salt(unsigned int len, char * output); -#endif /* _COMMON_MD5CALC_H_ */ +#endif /* COMMON_MD5CALC_H */ diff --git a/src/common/mmo.h b/src/common/mmo.h index 8e57eee85..feeb06524 100644 --- a/src/common/mmo.h +++ b/src/common/mmo.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_MMO_H_ -#define _COMMON_MMO_H_ +#ifndef COMMON_MMO_H +#define COMMON_MMO_H #include @@ -932,4 +932,4 @@ enum e_pc_reg_loading { #error MAX_ZENY is too big #endif -#endif /* _COMMON_MMO_H_ */ +#endif /* COMMON_MMO_H */ diff --git a/src/common/mutex.h b/src/common/mutex.h index ced91ab8e..d298c05af 100644 --- a/src/common/mutex.h +++ b/src/common/mutex.h @@ -1,8 +1,8 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _COMMON_MUTEX_H_ -#define _COMMON_MUTEX_H_ +#ifndef COMMON_MUTEX_H +#define COMMON_MUTEX_H #include "../common/cbasetypes.h" @@ -90,4 +90,4 @@ void racond_signal(racond *c); void racond_broadcast(racond *c); -#endif /* _COMMON_MUTEX_H_ */ +#endif /* COMMON_MUTEX_H */ diff --git a/src/common/nullpo.h b/src/common/nullpo.h index fb1cf0feb..581252cca 100644 --- a/src/common/nullpo.h +++ b/src/common/nullpo.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_NULLPO_H_ -#define _COMMON_NULLPO_H_ +#ifndef COMMON_NULLPO_H +#define COMMON_NULLPO_H #include "../common/cbasetypes.h" @@ -125,4 +125,4 @@ void assert_report(const char *file, int line, const char *func, const char *targetname, const char *title); -#endif /* _COMMON_NULLPO_H_ */ +#endif /* COMMON_NULLPO_H */ diff --git a/src/common/random.h b/src/common/random.h index ab83fb4d4..15d7f8ab1 100644 --- a/src/common/random.h +++ b/src/common/random.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _COMMON_RANDOM_H_ -#define _COMMON_RANDOM_H_ +#ifndef COMMON_RANDOM_H +#define COMMON_RANDOM_H #include "../common/cbasetypes.h" @@ -15,4 +15,4 @@ int32 rnd_value(int32 min, int32 max);// [min, max] double rnd_uniform(void);// [0.0, 1.0) double rnd_uniform53(void);// [0.0, 1.0) -#endif /* _COMMON_RANDOM_H_ */ +#endif /* COMMON_RANDOM_H */ diff --git a/src/common/showmsg.c b/src/common/showmsg.c index ece10c1a8..b9bcef9b2 100644 --- a/src/common/showmsg.c +++ b/src/common/showmsg.c @@ -654,7 +654,7 @@ int FPRINTF(FILE *file, const char *fmt, ...) char timestamp_format[20] = ""; //For displaying Timestamps -int _vShowMessage(enum msg_type flag, const char *string, va_list ap) +int vShowMessage_(enum msg_type flag, const char *string, va_list ap) { va_list apcopy; char prefix[100]; @@ -663,7 +663,7 @@ int _vShowMessage(enum msg_type flag, const char *string, va_list ap) #endif if (!string || *string == '\0') { - ShowError("Empty string passed to _vShowMessage().\n"); + ShowError("Empty string passed to vShowMessage_().\n"); return 1; } if( @@ -734,7 +734,7 @@ int _vShowMessage(enum msg_type flag, const char *string, va_list ap) strcat(prefix,CL_RED"[Fatal Error]"CL_RESET":"); break; default: - ShowError("In function _vShowMessage() -> Invalid flag passed.\n"); + ShowError("In function vShowMessage_() -> Invalid flag passed.\n"); return 1; } @@ -782,12 +782,12 @@ void ClearScreen(void) ShowMessage(CL_CLS); // to prevent empty string passed messages #endif } -int _ShowMessage(enum msg_type flag, const char *string, ...) +int ShowMessage_(enum msg_type flag, const char *string, ...) { int ret; va_list ap; va_start(ap, string); - ret = _vShowMessage(flag, string, ap); + ret = vShowMessage_(flag, string, ap); va_end(ap); return ret; } @@ -796,37 +796,37 @@ int _ShowMessage(enum msg_type flag, const char *string, ...) void ShowMessage(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_NONE, string, ap); + vShowMessage_(MSG_NONE, string, ap); va_end(ap); } void ShowStatus(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_STATUS, string, ap); + vShowMessage_(MSG_STATUS, string, ap); va_end(ap); } void ShowSQL(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_SQL, string, ap); + vShowMessage_(MSG_SQL, string, ap); va_end(ap); } void ShowInfo(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_INFORMATION, string, ap); + vShowMessage_(MSG_INFORMATION, string, ap); va_end(ap); } void ShowNotice(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_NOTICE, string, ap); + vShowMessage_(MSG_NOTICE, string, ap); va_end(ap); } void ShowWarning(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_WARNING, string, ap); + vShowMessage_(MSG_WARNING, string, ap); va_end(ap); } void ShowConfigWarning(config_setting_t *config, const char *string, ...) @@ -837,25 +837,25 @@ void ShowConfigWarning(config_setting_t *config, const char *string, ...) StrBuf->AppendStr(&buf, string); StrBuf->Printf(&buf, " (%s:%d)\n", config_setting_source_file(config), config_setting_source_line(config)); va_start(ap, string); - _vShowMessage(MSG_WARNING, StrBuf->Value(&buf), ap); + vShowMessage_(MSG_WARNING, StrBuf->Value(&buf), ap); va_end(ap); StrBuf->Destroy(&buf); } void ShowDebug(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_DEBUG, string, ap); + vShowMessage_(MSG_DEBUG, string, ap); va_end(ap); } void ShowError(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_ERROR, string, ap); + vShowMessage_(MSG_ERROR, string, ap); va_end(ap); } void ShowFatalError(const char *string, ...) { va_list ap; va_start(ap, string); - _vShowMessage(MSG_FATALERROR, string, ap); + vShowMessage_(MSG_FATALERROR, string, ap); va_end(ap); } diff --git a/src/common/showmsg.h b/src/common/showmsg.h index 8008acf5a..83eb0ad89 100644 --- a/src/common/showmsg.h +++ b/src/common/showmsg.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_SHOWMSG_H_ -#define _COMMON_SHOWMSG_H_ +#ifndef COMMON_SHOWMSG_H +#define COMMON_SHOWMSG_H #include @@ -115,6 +115,6 @@ extern void ClearScreen(void); HPExport void (*ShowFatalError) (const char *, ...); #endif -extern int _vShowMessage(enum msg_type flag, const char *string, va_list ap); +extern int vShowMessage_(enum msg_type flag, const char *string, va_list ap); -#endif /* _COMMON_SHOWMSG_H_ */ +#endif /* COMMON_SHOWMSG_H */ diff --git a/src/common/socket.c b/src/common/socket.c index 58c2d5bf9..85f0aa0ce 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -5,9 +5,9 @@ #define HERCULES_CORE #include "../config/core.h" // SHOW_SERVER_STATS -#define _H_SOCKET_C_ +#define H_SOCKET_C #include "socket.h" -#undef _H_SOCKET_C_ +#undef H_SOCKET_C #include #include @@ -909,20 +909,20 @@ int do_sockets(int next) ////////////////////////////// // IP rules and DDoS protection -typedef struct _connect_history { - struct _connect_history* next; +typedef struct connect_history { + struct connect_history* next; uint32 ip; int64 tick; int count; unsigned ddos : 1; } ConnectHistory; -typedef struct _access_control { +typedef struct access_control { uint32 ip; uint32 mask; } AccessControl; -enum _aco { +enum aco { ACO_DENY_ALLOW, ACO_ALLOW_DENY, ACO_MUTUAL_FAILURE diff --git a/src/common/socket.h b/src/common/socket.h index 804b9284f..42b0efe3b 100644 --- a/src/common/socket.h +++ b/src/common/socket.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_SOCKET_H_ -#define _COMMON_SOCKET_H_ +#ifndef COMMON_SOCKET_H +#define COMMON_SOCKET_H #include @@ -174,7 +174,7 @@ struct socket_interface *sockt; void socket_defaults(void); /* the purpose of these macros is simply to not make calling them be an annoyance */ -#ifndef _H_SOCKET_C_ +#ifndef H_SOCKET_C #define make_listen_bind(ip, port) ( sockt->make_listen_bind(ip, port) ) #define make_connection(ip, port, opt) ( sockt->make_connection(ip, port, opt) ) #define realloc_fifo(fd, rfifo_size, wfifo_size) ( sockt->realloc_fifo(fd, rfifo_size, wfifo_size) ) @@ -194,6 +194,6 @@ void socket_defaults(void); #define ntows(netshort) ( sockt->ntows(netshort) ) #define getips(ips, max) ( sockt->getips(ips, max) ) #define set_eof(fd) ( sockt->set_eof(fd) ) -#endif /* _H_SOCKET_C_ */ +#endif /* H_SOCKET_C */ -#endif /* _COMMON_SOCKET_H_ */ +#endif /* COMMON_SOCKET_H */ diff --git a/src/common/spinlock.h b/src/common/spinlock.h index 5d57c6462..bde36b8e5 100644 --- a/src/common/spinlock.h +++ b/src/common/spinlock.h @@ -1,5 +1,5 @@ -#ifndef _COMMON_SPINLOCK_H_ -#define _COMMON_SPINLOCK_H_ +#ifndef COMMON_SPINLOCK_H +#define COMMON_SPINLOCK_H // // CAS based Spinlock Implementation @@ -100,4 +100,4 @@ static forceinline void LeaveSpinLock(SPIN_LOCK *lck){ -#endif /* _COMMON_SPINLOCK_H_ */ +#endif /* COMMON_SPINLOCK_H */ diff --git a/src/common/sql.h b/src/common/sql.h index 3bdb76c74..f9593978c 100644 --- a/src/common/sql.h +++ b/src/common/sql.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_SQL_H_ -#define _COMMON_SQL_H_ +#ifndef COMMON_SQL_H +#define COMMON_SQL_H #include // va_list @@ -291,4 +291,4 @@ void Sql_HerculesUpdateSkip(Sql* self,const char *filename); void Sql_Init(void); -#endif /* _COMMON_SQL_H_ */ +#endif /* COMMON_SQL_H */ diff --git a/src/common/strlib.c b/src/common/strlib.c index 2ce8fd347..e2382e6fc 100644 --- a/src/common/strlib.c +++ b/src/common/strlib.c @@ -4,9 +4,9 @@ #define HERCULES_CORE -#define _H_STRLIB_C_ +#define H_STRLIB_C #include "strlib.h" -#undef _H_STRLIB_C_ +#undef H_STRLIB_C #include #include @@ -224,7 +224,7 @@ const char* stristr(const char* haystack, const char* needle) } #ifdef __WIN32 -char* _strtok_r(char *s1, const char *s2, char **lasts) { +char* strtok_r_(char *s1, const char *s2, char **lasts) { char *ret; if (s1 == NULL) diff --git a/src/common/strlib.h b/src/common/strlib.h index f39f27789..7f84d2893 100644 --- a/src/common/strlib.h +++ b/src/common/strlib.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_STRLIB_H_ -#define _COMMON_STRLIB_H_ +#ifndef COMMON_STRLIB_H +#define COMMON_STRLIB_H #include #include @@ -12,8 +12,8 @@ #ifdef WIN32 #define HAVE_STRTOK_R - #define strtok_r(s,delim,save_ptr) _strtok_r((s),(delim),(save_ptr)) - char *_strtok_r(char* s1, const char* s2, char** lasts); + #define strtok_r(s,delim,save_ptr) strtok_r_((s),(delim),(save_ptr)) + char *strtok_r_(char* s1, const char* s2, char** lasts); #endif /// Bitfield determining the behavior of sv_parse and sv_split. @@ -159,7 +159,7 @@ struct sv_interface *sv; void strlib_defaults(void); /* the purpose of these macros is simply to not make calling them be an annoyance */ -#ifndef _H_STRLIB_C_ +#ifndef H_STRLIB_C #define jstrescape(pt) (strlib->jstrescape(pt)) #define jstrescapecpy(pt,spt) (strlib->jstrescapecpy((pt),(spt))) #define jmemescapecpy(pt,spt,size) (strlib->jmemescapecpy((pt),(spt),(size))) @@ -183,6 +183,6 @@ void strlib_defaults(void); #define safesnprintf(buf,sz,fmt,...) (strlib->safesnprintf((buf),(sz),(fmt),##__VA_ARGS__)) #define strline(str,pos) (strlib->strline((str),(pos))) #define bin2hex(output,input,count) (strlib->bin2hex((output),(input),(count))) -#endif /* _H_STRLIB_C_ */ +#endif /* H_STRLIB_C */ -#endif /* _COMMON_STRLIB_H_ */ +#endif /* COMMON_STRLIB_H */ diff --git a/src/common/sysinfo.h b/src/common/sysinfo.h index 24f794cb4..600206a21 100644 --- a/src/common/sysinfo.h +++ b/src/common/sysinfo.h @@ -2,8 +2,8 @@ // See the LICENSE file // Base Author: Haru @ http://hercules.ws -#ifndef _COMMON_SYSINFO_H_ -#define _COMMON_SYSINFO_H_ +#ifndef COMMON_SYSINFO_H +#define COMMON_SYSINFO_H /** * Provides various bits of information about the system Hercules is running on @@ -48,4 +48,4 @@ struct sysinfo_interface *sysinfo; void sysinfo_defaults(void); -#endif /* _COMMON_SYSINFO_H_ */ +#endif /* COMMON_SYSINFO_H */ diff --git a/src/common/thread.c b/src/common/thread.c index d8e0dbf0a..d680d0347 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -106,9 +106,9 @@ static void rat_thread_terminated(rAthread *handle) { }//end: rat_thread_terminated() #ifdef WIN32 -DWORD WINAPI _raThreadMainRedirector(LPVOID p){ +DWORD WINAPI raThreadMainRedirector(LPVOID p){ #else -static void *_raThreadMainRedirector( void *p ){ +static void *raThreadMainRedirector( void *p ){ sigset_t set; // on Posix Thread platforms #endif void *ret; @@ -145,7 +145,7 @@ static void *_raThreadMainRedirector( void *p ){ #else return ret; #endif -}//end: _raThreadMainRedirector() +}//end: raThreadMainRedirector() @@ -193,12 +193,12 @@ rAthread *rathread_createEx(rAthreadProc entryPoint, void *param, size_t szStack handle->param = param; #ifdef WIN32 - handle->hThread = CreateThread(NULL, szStack, _raThreadMainRedirector, (void*)handle, 0, NULL); + handle->hThread = CreateThread(NULL, szStack, raThreadMainRedirector, (void*)handle, 0, NULL); #else pthread_attr_init(&attr); pthread_attr_setstacksize(&attr, szStack); - if(pthread_create(&handle->hThread, &attr, _raThreadMainRedirector, (void*)handle) != 0){ + if(pthread_create(&handle->hThread, &attr, raThreadMainRedirector, (void*)handle) != 0){ handle->proc = NULL; handle->param = NULL; return NULL; diff --git a/src/common/thread.h b/src/common/thread.h index 3b5ce7476..f781cfbd0 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -1,8 +1,8 @@ // Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _COMMON_THREAD_H_ -#define _COMMON_THREAD_H_ +#ifndef COMMON_THREAD_H +#define COMMON_THREAD_H #include "../common/cbasetypes.h" @@ -115,4 +115,4 @@ void rathread_init(); void rathread_final(); -#endif /* _COMMON_THREAD_H_ */ +#endif /* COMMON_THREAD_H */ diff --git a/src/common/timer.c b/src/common/timer.c index ab0471d51..128fc4daf 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -107,7 +107,7 @@ char* search_timer_func_list(TimerFunc func) #if defined(ENABLE_RDTSC) static uint64 RDTSC_BEGINTICK = 0, RDTSC_CLOCK = 0; -static __inline uint64 _rdtsc(){ +static __inline uint64 rdtsc_() { register union{ uint64 qw; uint32 dw[2]; @@ -127,14 +127,14 @@ static void rdtsc_calibrate(){ RDTSC_CLOCK = 0; for(i = 0; i < 5; i++){ - t1 = _rdtsc(); + t1 = rdtsc_(); usleep(1000000); //1000 MS - t2 = _rdtsc(); + t2 = rdtsc_(); RDTSC_CLOCK += (t2 - t1) / 1000; } RDTSC_CLOCK /= 5; - RDTSC_BEGINTICK = _rdtsc(); + RDTSC_BEGINTICK = rdtsc_(); ShowMessage(" done. (Frequency: %u Mhz)\n", (uint32)(RDTSC_CLOCK/1000) ); } @@ -175,7 +175,7 @@ static int64 sys_tick(void) { #elif defined(ENABLE_RDTSC) // RDTSC: Returns the number of CPU cycles since reset. Unreliable if // the CPU frequency is variable. - return (int64)((_rdtsc() - RDTSC_BEGINTICK) / RDTSC_CLOCK); + return (int64)((rdtsc_() - RDTSC_BEGINTICK) / RDTSC_CLOCK); #elif defined(HAVE_MONOTONIC_CLOCK) // Monotonic clock: Implementation-defined. // Clock that cannot be set and represents monotonic time since some diff --git a/src/common/timer.h b/src/common/timer.h index a07f81612..d0927adde 100644 --- a/src/common/timer.h +++ b/src/common/timer.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_TIMER_H_ -#define _COMMON_TIMER_H_ +#ifndef COMMON_TIMER_H +#define COMMON_TIMER_H #include "../common/cbasetypes.h" @@ -67,4 +67,4 @@ struct timer_interface *timer; void timer_defaults(void); -#endif /* _COMMON_TIMER_H_ */ +#endif /* COMMON_TIMER_H */ diff --git a/src/common/utils.h b/src/common/utils.h index 823651163..421698d95 100644 --- a/src/common/utils.h +++ b/src/common/utils.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _COMMON_UTILS_H_ -#define _COMMON_UTILS_H_ +#ifndef COMMON_UTILS_H +#define COMMON_UTILS_H #include // FILE* #include @@ -65,4 +65,4 @@ struct HCache_interface *HCache; void HCache_defaults(void); -#endif /* _COMMON_UTILS_H_ */ +#endif /* COMMON_UTILS_H */ diff --git a/src/config/classes/general.h b/src/config/classes/general.h index 147fddb55..b3da4a475 100644 --- a/src/config/classes/general.h +++ b/src/config/classes/general.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _CONFIG_GENERAL_H_ -#define _CONFIG_GENERAL_H_ +#ifndef CONFIG_GENERAL_H +#define CONFIG_GENERAL_H /** * Hercules configuration file (http://hercules.ws) @@ -31,4 +31,4 @@ * No settings past this point **/ -#endif // _CONFIG_GENERAL_H_ +#endif // CONFIG_GENERAL_H diff --git a/src/config/const.h b/src/config/const.h index 23467bfa6..2b5b180c4 100644 --- a/src/config/const.h +++ b/src/config/const.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _CONFIG_CONSTANTS_H_ -#define _CONFIG_CONSTANTS_H_ +#ifndef CONFIG_CONSTANTS_H +#define CONFIG_CONSTANTS_H /** * Hercules configuration file (http://hercules.ws) @@ -103,4 +103,4 @@ /** * End of File **/ -#endif /* _CONFIG_CONSTANTS_H_ */ +#endif /* CONFIG_CONSTANTS_H */ diff --git a/src/config/core.h b/src/config/core.h index 24e9de710..ac59563b5 100644 --- a/src/config/core.h +++ b/src/config/core.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _CONFIG_CORE_H_ -#define _CONFIG_CORE_H_ +#ifndef CONFIG_CORE_H +#define CONFIG_CORE_H /// Max number of items on @autolootid list #define AUTOLOOTITEM_SIZE 10 @@ -79,4 +79,4 @@ **/ #include "./const.h" -#endif // _CONFIG_CORE_H_ +#endif // CONFIG_CORE_H diff --git a/src/config/renewal.h b/src/config/renewal.h index 1c48b9f8a..939ad9b73 100644 --- a/src/config/renewal.h +++ b/src/config/renewal.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _CONFIG_RENEWAL_H_ -#define _CONFIG_RENEWAL_H_ +#ifndef CONFIG_RENEWAL_H +#define CONFIG_RENEWAL_H /** * Hercules configuration file (http://hercules.ws) @@ -86,4 +86,4 @@ #endif // DISABLE_RENEWAL #undef DISABLE_RENEWAL -#endif // _CONFIG_RENEWAL_H_ +#endif // CONFIG_RENEWAL_H diff --git a/src/config/secure.h b/src/config/secure.h index 1a89e36cf..418d24751 100644 --- a/src/config/secure.h +++ b/src/config/secure.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _CONFIG_SECURE_H_ -#define _CONFIG_SECURE_H_ +#ifndef CONFIG_SECURE_H +#define CONFIG_SECURE_H /** * Hercules configuration file (http://hercules.ws) @@ -58,4 +58,4 @@ **/ #define ANTI_MAYAP_CHEAT -#endif // _CONFIG_SECURE_H_ +#endif // CONFIG_SECURE_H diff --git a/src/login/account.h b/src/login/account.h index a14595519..e15143ce9 100644 --- a/src/login/account.h +++ b/src/login/account.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _LOGIN_ACCOUNT_H_ -#define _LOGIN_ACCOUNT_H_ +#ifndef LOGIN_ACCOUNT_H +#define LOGIN_ACCOUNT_H #include "../common/cbasetypes.h" #include "../common/mmo.h" // ACCOUNT_REG2_NUM @@ -140,4 +140,4 @@ Sql *account_db_sql_up(AccountDB* self); void mmo_send_accreg2(AccountDB* self, int fd, int account_id, int char_id); void mmo_save_accreg2(AccountDB* self, int fd, int account_id, int char_id); -#endif /* _LOGIN_ACCOUNT_H_ */ +#endif /* LOGIN_ACCOUNT_H */ diff --git a/src/login/ipban.h b/src/login/ipban.h index e6851d8dd..b4f3ac51b 100644 --- a/src/login/ipban.h +++ b/src/login/ipban.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _LOGIN_IPBAN_H_ -#define _LOGIN_IPBAN_H_ +#ifndef LOGIN_IPBAN_H +#define LOGIN_IPBAN_H #include "../common/cbasetypes.h" @@ -22,4 +22,4 @@ void ipban_log(uint32 ip); bool ipban_config_read(const char* key, const char* value); -#endif /* _LOGIN_IPBAN_H_ */ +#endif /* LOGIN_IPBAN_H */ diff --git a/src/login/login.h b/src/login/login.h index 447301ea4..9b9d1e82c 100644 --- a/src/login/login.h +++ b/src/login/login.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _LOGIN_LOGIN_H_ -#define _LOGIN_LOGIN_H_ +#ifndef LOGIN_LOGIN_H +#define LOGIN_LOGIN_H #include "../common/core.h" // CORE_ST_LAST #include "../common/mmo.h" // NAME_LENGTH,SEX_* @@ -100,4 +100,4 @@ extern struct mmo_char_server server[MAX_SERVERS]; extern struct Login_Config login_config; -#endif /* _LOGIN_LOGIN_H_ */ +#endif /* LOGIN_LOGIN_H */ diff --git a/src/login/loginlog.h b/src/login/loginlog.h index a86ad431c..52e18f3d1 100644 --- a/src/login/loginlog.h +++ b/src/login/loginlog.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _LOGIN_LOGINLOG_H_ -#define _LOGIN_LOGINLOG_H_ +#ifndef LOGIN_LOGINLOG_H +#define LOGIN_LOGINLOG_H #include "../common/cbasetypes.h" @@ -12,4 +12,4 @@ bool loginlog_init(void); bool loginlog_final(void); bool loginlog_config_read(const char* w1, const char* w2); -#endif /* _LOGIN_LOGINLOG_H_ */ +#endif /* LOGIN_LOGINLOG_H */ diff --git a/src/map/HPMmap.h b/src/map/HPMmap.h index f291575fb..99c4224ff 100644 --- a/src/map/HPMmap.h +++ b/src/map/HPMmap.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file -#ifndef _MAP_HPMMAP_H_ -#define _MAP_HPMMAP_H_ +#ifndef MAP_HPMMAP_H +#define MAP_HPMMAP_H #include "../common/cbasetypes.h" #include "../map/atcommand.h" @@ -26,4 +26,4 @@ bool HPM_map_DataCheck(struct s_HPMDataCheck *src, unsigned int size, char *name void HPM_map_do_init(void); -#endif /* _MAP_HPMMAP_H_ */ +#endif /* MAP_HPMMAP_H */ diff --git a/src/map/atcommand.c b/src/map/atcommand.c index d36e98c41..e22e2101c 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -8434,7 +8434,7 @@ ACMD(set) { if( is_str ) script->set_var(sd, reg, (void*) val); else - script->set_var(sd, reg, (void*)__64BPTRSIZE((atoi(val)))); + script->set_var(sd, reg, (void*)h64BPTRSIZE((atoi(val)))); } diff --git a/src/map/atcommand.h b/src/map/atcommand.h index c8a1863af..356487bd1 100644 --- a/src/map/atcommand.h +++ b/src/map/atcommand.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_ATCOMMAND_H_ -#define _MAP_ATCOMMAND_H_ +#ifndef MAP_ATCOMMAND_H +#define MAP_ATCOMMAND_H #include "pc_groups.h" #include "../common/conf.h" @@ -121,4 +121,4 @@ void atcommand_defaults(void); /* stay here */ #define ACMD(x) static bool atcommand_ ## x (const int fd, struct map_session_data* sd, const char* command, const char* message, struct AtCommandInfo *info) -#endif /* _MAP_ATCOMMAND_H_ */ +#endif /* MAP_ATCOMMAND_H */ diff --git a/src/map/battle.c b/src/map/battle.c index e40d44549..7610d97b2 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -6357,7 +6357,7 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range return path->search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL); } -static const struct _battle_data { +static const struct battle_data { const char* str; int* val; int defval; diff --git a/src/map/battle.h b/src/map/battle.h index fc916597d..aab94420a 100644 --- a/src/map/battle.h +++ b/src/map/battle.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_BATTLE_H_ -#define _MAP_BATTLE_H_ +#ifndef MAP_BATTLE_H +#define MAP_BATTLE_H #include "map.h" //ELE_MAX #include "../common/cbasetypes.h" @@ -603,4 +603,4 @@ struct battle_interface { struct battle_interface *battle; void battle_defaults(void); -#endif /* _MAP_BATTLE_H_ */ +#endif /* MAP_BATTLE_H */ diff --git a/src/map/battleground.h b/src/map/battleground.h index ec0a86f14..c1d3be054 100644 --- a/src/map/battleground.h +++ b/src/map/battleground.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_BATTLEGROUND_H_ -#define _MAP_BATTLEGROUND_H_ +#ifndef MAP_BATTLEGROUND_H +#define MAP_BATTLEGROUND_H #include "clif.h" #include "guild.h" @@ -122,4 +122,4 @@ struct battleground_interface *bg; void battleground_defaults(void); -#endif /* _MAP_BATTLEGROUND_H_ */ +#endif /* MAP_BATTLEGROUND_H */ diff --git a/src/map/buyingstore.h b/src/map/buyingstore.h index 914631872..c981cc444 100644 --- a/src/map/buyingstore.h +++ b/src/map/buyingstore.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_BUYINGSTORE_H_ -#define _MAP_BUYINGSTORE_H_ +#ifndef MAP_BUYINGSTORE_H +#define MAP_BUYINGSTORE_H #include "../common/cbasetypes.h" #include "../common/mmo.h" // MAX_SLOTS @@ -75,4 +75,4 @@ struct buyingstore_interface *buyingstore; void buyingstore_defaults (void); -#endif // _MAP_BUYINGSTORE_H_ +#endif // MAP_BUYINGSTORE_H diff --git a/src/map/chat.h b/src/map/chat.h index 6e4fae1c0..e055c04ed 100644 --- a/src/map/chat.h +++ b/src/map/chat.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_CHAT_H_ -#define _MAP_CHAT_H_ +#ifndef MAP_CHAT_H +#define MAP_CHAT_H #include "map.h" // struct block_list, CHATROOM_TITLE_SIZE #include "../common/cbasetypes.h" @@ -60,4 +60,4 @@ struct chat_interface *chat; void chat_defaults(void); -#endif /* _MAP_CHAT_H_ */ +#endif /* MAP_CHAT_H */ diff --git a/src/map/chrif.h b/src/map/chrif.h index 51ab0e9b9..11baaf5ff 100644 --- a/src/map/chrif.h +++ b/src/map/chrif.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_CHRIF_H_ -#define _MAP_CHRIF_H_ +#ifndef MAP_CHRIF_H +#define MAP_CHRIF_H #include @@ -154,4 +154,4 @@ void chrif_defaults(void); // There's no need for another function when a simple macro can do exactly the same effect #define chrif_char_offline(x) chrif->char_offline_nsd((x)->status.account_id,(x)->status.char_id) -#endif /* _MAP_CHRIF_H_ */ +#endif /* MAP_CHRIF_H */ diff --git a/src/map/clif.c b/src/map/clif.c index 750689816..9e105e4a9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -5651,7 +5651,7 @@ void clif_displaymessage_sprintf(const int fd, const char* mes, ...) { if( map->cpsd_active && fd == 0 ) { ShowInfo("HCP: "); va_start(ap,mes); - _vShowMessage(MSG_NONE,mes,ap); + vShowMessage_(MSG_NONE,mes,ap); va_end(ap); ShowMessage("\n"); } else if ( fd > 0 ) { diff --git a/src/map/clif.h b/src/map/clif.h index e1af44881..48316427f 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_CLIF_H_ -#define _MAP_CLIF_H_ +#ifndef MAP_CLIF_H +#define MAP_CLIF_H #include @@ -1290,4 +1290,4 @@ struct clif_interface *clif; void clif_defaults(void); -#endif /* _MAP_CLIF_H_ */ +#endif /* MAP_CLIF_H */ diff --git a/src/map/date.h b/src/map/date.h index b3ed59b2f..c3f353f64 100644 --- a/src/map/date.h +++ b/src/map/date.h @@ -1,8 +1,8 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#ifndef _MAP_DATE_H_ -#define _MAP_DATE_H_ +#ifndef MAP_DATE_H +#define MAP_DATE_H #include "../common/cbasetypes.h" @@ -17,4 +17,4 @@ bool is_day_of_sun(void); bool is_day_of_moon(void); bool is_day_of_star(void); -#endif /* _MAP_DATE_H_ */ +#endif /* MAP_DATE_H */ diff --git a/src/map/duel.h b/src/map/duel.h index 91dfa8f83..de2bd1bf6 100644 --- a/src/map/duel.h +++ b/src/map/duel.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_DUEL_H_ -#define _MAP_DUEL_H_ +#ifndef MAP_DUEL_H +#define MAP_DUEL_H #include "../common/cbasetypes.h" @@ -46,4 +46,4 @@ struct duel_interface *duel; void duel_defaults(void); -#endif /* _MAP_DUEL_H_ */ +#endif /* MAP_DUEL_H */ diff --git a/src/map/elemental.h b/src/map/elemental.h index beddd3ea1..0c8fff8b3 100644 --- a/src/map/elemental.h +++ b/src/map/elemental.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_ELEMENTAL_H_ -#define _MAP_ELEMENTAL_H_ +#ifndef MAP_ELEMENTAL_H +#define MAP_ELEMENTAL_H #include "status.h" // struct status_data, struct status_change #include "unit.h" // struct unit_data @@ -121,4 +121,4 @@ struct elemental_interface *elemental; void elemental_defaults(void); -#endif /* _MAP_ELEMENTAL_H_ */ +#endif /* MAP_ELEMENTAL_H */ diff --git a/src/map/guild.c b/src/map/guild.c index 642c8993c..af29dc64e 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -2015,8 +2015,8 @@ int guild_castledatasave(int castle_id, int index, int value) void guild_castle_reconnect_sub(void *key, void *data, va_list ap) { - int castle_id = GetWord((int)__64BPTRSIZE(key), 0); - int index = GetWord((int)__64BPTRSIZE(key), 1); + int castle_id = GetWord((int)h64BPTRSIZE(key), 0); + int index = GetWord((int)h64BPTRSIZE(key), 1); intif->guild_castle_datasave(castle_id, index, *(int *)data); aFree(data); } @@ -2037,7 +2037,7 @@ void guild_castle_reconnect(int castle_id, int index, int value) int *data; CREATE(data, int, 1); *data = value; - linkdb_replace(&gc_save_pending, (void*)__64BPTRSIZE((MakeDWord(castle_id, index))), data); + linkdb_replace(&gc_save_pending, (void*)h64BPTRSIZE((MakeDWord(castle_id, index))), data); } } diff --git a/src/map/guild.h b/src/map/guild.h index f9d97241d..126325eef 100644 --- a/src/map/guild.h +++ b/src/map/guild.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_GUILD_H_ -#define _MAP_GUILD_H_ +#ifndef MAP_GUILD_H +#define MAP_GUILD_H #include "map.h" // EVENT_NAME_LENGTH, TBL_PC #include "../common/cbasetypes.h" @@ -167,4 +167,4 @@ struct guild_interface *guild; void guild_defaults(void); -#endif /* _MAP_GUILD_H_ */ +#endif /* MAP_GUILD_H */ diff --git a/src/map/homunculus.h b/src/map/homunculus.h index 9eef6af5b..25ccabf48 100644 --- a/src/map/homunculus.h +++ b/src/map/homunculus.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_HOMUNCULUS_H_ -#define _MAP_HOMUNCULUS_H_ +#ifndef MAP_HOMUNCULUS_H +#define MAP_HOMUNCULUS_H #include "pc.h" #include "status.h" // struct status_data, struct status_change @@ -148,4 +148,4 @@ struct homunculus_interface *homun; void homunculus_defaults(void); -#endif /* _MAP_HOMUNCULUS_H_ */ +#endif /* MAP_HOMUNCULUS_H */ diff --git a/src/map/instance.h b/src/map/instance.h index ae649eda7..2ee77d3e3 100644 --- a/src/map/instance.h +++ b/src/map/instance.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_INSTANCE_H_ -#define _MAP_INSTANCE_H_ +#ifndef MAP_INSTANCE_H +#define MAP_INSTANCE_H #include "script.h" // struct reg_db #include "../common/cbasetypes.h" @@ -88,4 +88,4 @@ struct instance_interface *instance; void instance_defaults(void); -#endif /* _MAP_INSTANCE_H_ */ +#endif /* MAP_INSTANCE_H */ diff --git a/src/map/intif.c b/src/map/intif.c index 4dd0fa448..432154f04 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1067,7 +1067,7 @@ void intif_parse_Registers(int fd) ival = RFIFOL(fd, cursor); cursor += 4; - script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, (void*)__64BPTRSIZE(ival), NULL); + script->set_reg(NULL,sd,reference_uid(script->add_str(key), index), key, (void*)h64BPTRSIZE(ival), NULL); } } diff --git a/src/map/intif.h b/src/map/intif.h index 42a38ad41..fe47d6537 100644 --- a/src/map/intif.h +++ b/src/map/intif.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_INTIF_H_ -#define _MAP_INTIF_H_ +#ifndef MAP_INTIF_H +#define MAP_INTIF_H #include "../common/cbasetypes.h" @@ -186,4 +186,4 @@ struct intif_interface *intif; void intif_defaults(void); -#endif /* _MAP_INTIF_H_ */ +#endif /* MAP_INTIF_H */ diff --git a/src/map/irc-bot.h b/src/map/irc-bot.h index 60f03fca5..0c26c3cd8 100644 --- a/src/map/irc-bot.h +++ b/src/map/irc-bot.h @@ -3,8 +3,8 @@ // Base Author: shennetsind @ http://hercules.ws -#ifndef _MAP_IRC_BOT_H_ -#define _MAP_IRC_BOT_H_ +#ifndef MAP_IRC_BOT_H +#define MAP_IRC_BOT_H #include "../common/cbasetypes.h" @@ -63,4 +63,4 @@ struct irc_bot_interface *ircbot; void ircbot_defaults(void); -#endif /* _MAP_IRC_BOT_H_ */ +#endif /* MAP_IRC_BOT_H */ diff --git a/src/map/itemdb.h b/src/map/itemdb.h index 246ca1f54..2ad596ce1 100644 --- a/src/map/itemdb.h +++ b/src/map/itemdb.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_ITEMDB_H_ -#define _MAP_ITEMDB_H_ +#ifndef MAP_ITEMDB_H +#define MAP_ITEMDB_H #include "map.h" #include "../common/cbasetypes.h" @@ -609,4 +609,4 @@ struct itemdb_interface *itemdb; void itemdb_defaults(void); -#endif /* _MAP_ITEMDB_H_ */ +#endif /* MAP_ITEMDB_H */ diff --git a/src/map/log.h b/src/map/log.h index ecfedeac2..6ab142f87 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_LOG_H_ -#define _MAP_LOG_H_ +#ifndef MAP_LOG_H +#define MAP_LOG_H #include "../common/cbasetypes.h" #include "../common/sql.h" @@ -133,4 +133,4 @@ struct log_interface *logs; void log_defaults(void); -#endif /* _MAP_LOG_H_ */ +#endif /* MAP_LOG_H */ diff --git a/src/map/mail.h b/src/map/mail.h index 30b032ef4..64b0f9779 100644 --- a/src/map/mail.h +++ b/src/map/mail.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_MAIL_H_ -#define _MAP_MAIL_H_ +#ifndef MAP_MAIL_H +#define MAP_MAIL_H #include "../common/cbasetypes.h" @@ -27,4 +27,4 @@ struct mail_interface *mail; void mail_defaults(void); -#endif /* _MAP_MAIL_H_ */ +#endif /* MAP_MAIL_H */ diff --git a/src/map/map.h b/src/map/map.h index 38167597a..35fe0d7e1 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_MAP_H_ -#define _MAP_MAP_H_ +#ifndef MAP_MAP_H +#define MAP_MAP_H #include @@ -342,7 +342,7 @@ struct flooritem_data { struct item item_data; }; -enum _sp { +enum status_point_types { SP_SPEED,SP_BASEEXP,SP_JOBEXP,SP_KARMA,SP_MANNER,SP_HP,SP_MAXHP,SP_SP, // 0-7 SP_MAXSP,SP_STATUSPOINT,SP_0a,SP_BASELEVEL,SP_SKILLPOINT,SP_STR,SP_AGI,SP_VIT, // 8-15 SP_INT,SP_DEX,SP_LUK,SP_CLASS,SP_ZENY,SP_SEX,SP_NEXTBASEEXP,SP_NEXTJOBEXP, // 16-23 @@ -415,7 +415,7 @@ enum _sp { SP_LAST_KNOWN, }; -enum _look { +enum look { LOOK_BASE, LOOK_HAIR, LOOK_WEAPON, @@ -1071,4 +1071,4 @@ struct map_interface *map; void map_defaults(void); -#endif /* _MAP_MAP_H_ */ +#endif /* MAP_MAP_H */ diff --git a/src/map/mapreg.h b/src/map/mapreg.h index 2aa2943a2..59d226cda 100644 --- a/src/map/mapreg.h +++ b/src/map/mapreg.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_MAPREG_H_ -#define _MAP_MAPREG_H_ +#ifndef MAP_MAPREG_H +#define MAP_MAPREG_H #include "script.h" // struct reg_db #include "../common/cbasetypes.h" @@ -50,4 +50,4 @@ struct mapreg_interface *mapreg; void mapreg_defaults(void); -#endif /* _MAP_MAPREG_H_ */ +#endif /* MAP_MAPREG_H */ diff --git a/src/map/mercenary.h b/src/map/mercenary.h index 22399e289..270245e96 100644 --- a/src/map/mercenary.h +++ b/src/map/mercenary.h @@ -1,8 +1,8 @@ // Copyright (c) Hercules Dev Team, licensed under GNU GPL. // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_MERCENARY_H_ -#define _MAP_MERCENARY_H_ +#ifndef MAP_MERCENARY_H +#define MAP_MERCENARY_H #include "status.h" // struct status_data, struct status_change #include "unit.h" // struct unit_data @@ -99,4 +99,4 @@ struct mercenary_interface *mercenary; void mercenary_defaults(void); -#endif /* _MAP_MERCENARY_H_ */ +#endif /* MAP_MERCENARY_H */ diff --git a/src/map/mob.h b/src/map/mob.h index 7e222fa74..c8d43dbb2 100644 --- a/src/map/mob.h +++ b/src/map/mob.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_MOB_H_ -#define _MAP_MOB_H_ +#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 @@ -363,4 +363,4 @@ struct mob_interface *mob; void mob_defaults(void); -#endif /* _MAP_MOB_H_ */ +#endif /* MAP_MOB_H */ diff --git a/src/map/npc.c b/src/map/npc.c index bfac2b9d5..417aa6c61 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -3368,7 +3368,7 @@ int npc_do_atcmd_event(struct map_session_data* sd, const char* command, const c } } - script->setd_sub(st, NULL, ".@atcmd_numparameters", 0, (void *)__64BPTRSIZE(j), NULL); + script->setd_sub(st, NULL, ".@atcmd_numparameters", 0, (void *)h64BPTRSIZE(j), NULL); aFree(temp); script->run_main(st); diff --git a/src/map/npc.h b/src/map/npc.h index 06a9312b5..4c904e1ac 100644 --- a/src/map/npc.h +++ b/src/map/npc.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_NPC_H_ -#define _MAP_NPC_H_ +#ifndef MAP_NPC_H +#define MAP_NPC_H #include "map.h" // struct block_list #include "status.h" // struct status_change @@ -347,4 +347,4 @@ struct pcre_interface *libpcre; void npc_chat_defaults(void); #endif -#endif /* _MAP_NPC_H_ */ +#endif /* MAP_NPC_H */ diff --git a/src/map/packets.h b/src/map/packets.h index e995643d4..810f341d4 100644 --- a/src/map/packets.h +++ b/src/map/packets.h @@ -3,8 +3,8 @@ //Included directly by clif.h in packet_loaddb() -#ifndef _MAP_PACKETS_H_ -#define _MAP_PACKETS_H_ +#ifndef MAP_PACKETS_H +#define MAP_PACKETS_H #ifndef packet #define packet(a,b,...) @@ -3002,4 +3002,4 @@ packet(0x020d,-1); packetKeys(OBFUSCATIONKEY1,OBFUSCATIONKEY2,OBFUSCATIONKEY3); #endif -#endif /* _MAP_PACKETS_H_ */ +#endif /* MAP_PACKETS_H */ diff --git a/src/map/packets_struct.h b/src/map/packets_struct.h index 403ab6fa3..55ab0c66a 100644 --- a/src/map/packets_struct.h +++ b/src/map/packets_struct.h @@ -3,8 +3,8 @@ /* Hercules Renewal: Phase Two http://hercules.ws/board/topic/383-hercules-renewal-phase-two/ */ -#ifndef _MAP_PACKETS_STRUCT_H_ -#define _MAP_PACKETS_STRUCT_H_ +#ifndef MAP_PACKETS_STRUCT_H +#define MAP_PACKETS_STRUCT_H #include "../common/mmo.h" @@ -962,4 +962,4 @@ struct packet_wis_end { #pragma pack(pop) #endif // not NetBSD < 6 / Solaris -#endif /* _MAP_PACKETS_STRUCT_H_ */ +#endif /* MAP_PACKETS_STRUCT_H */ diff --git a/src/map/party.h b/src/map/party.h index 1c58301d1..d62db23a7 100644 --- a/src/map/party.h +++ b/src/map/party.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_PARTY_H_ -#define _MAP_PARTY_H_ +#ifndef MAP_PARTY_H +#define MAP_PARTY_H #include @@ -143,4 +143,4 @@ struct party_interface *party; void party_defaults(void); -#endif /* _MAP_PARTY_H_ */ +#endif /* MAP_PARTY_H */ diff --git a/src/map/path.h b/src/map/path.h index b48ff05fb..8d02e6558 100644 --- a/src/map/path.h +++ b/src/map/path.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_PATH_H_ -#define _MAP_PATH_H_ +#ifndef MAP_PATH_H +#define MAP_PATH_H #include "map.h" // enum cell_chk #include "../common/cbasetypes.h" @@ -47,4 +47,4 @@ struct path_interface *path; void path_defaults(void); -#endif /* _MAP_PATH_H_ */ +#endif /* MAP_PATH_H */ diff --git a/src/map/pc.c b/src/map/pc.c index b8b6cda46..104a3cde0 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -6230,7 +6230,7 @@ int pc_maxparameterincrease(struct map_session_data* sd, int type) { * Subtracts status points according to the cost of the increased stat points. * * @param sd The target character. - * @param type The stat to change (see enum _sp) + * @param type The stat to change (see enum status_point_types) * @param increase The stat increase (strictly positive) amount. * @retval true if the stat was increased by any amount. * @retval false if there were no changes. @@ -6289,7 +6289,7 @@ bool pc_statusup(struct map_session_data* sd, int type, int increase) { * Does not subtract status points for the cost of the modified stat points. * * @param sd The target character. - * @param type The stat to change (see enum _sp) + * @param type The stat to change (see enum status_point_types) * @param val The stat increase (or decrease) amount. * @return the stat increase amount. * @retval 0 if no changes were made. diff --git a/src/map/pc.h b/src/map/pc.h index 1789a8a7b..f33127036 100644 --- a/src/map/pc.h +++ b/src/map/pc.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_PC_H_ -#define _MAP_PC_H_ +#ifndef MAP_PC_H +#define MAP_PC_H #include "../config/core.h" // AUTOLOOTITEM_SIZE, RENEWAL, SECURE_NPCTIMEOUT @@ -1026,4 +1026,4 @@ struct pc_interface *pc; void pc_defaults(void); -#endif /* _MAP_PC_H_ */ +#endif /* MAP_PC_H */ diff --git a/src/map/pc_groups.h b/src/map/pc_groups.h index 7c8cdd82a..f52e2ba22 100644 --- a/src/map/pc_groups.h +++ b/src/map/pc_groups.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_PC_GROUPS_H_ -#define _MAP_PC_GROUPS_H_ +#ifndef MAP_PC_GROUPS_H +#define MAP_PC_GROUPS_H #include "../common/cbasetypes.h" #include "../common/conf.h" @@ -96,4 +96,4 @@ struct pc_groups_interface *pcg; void pc_groups_defaults(void); -#endif /* _MAP_PC_GROUPS_H_ */ +#endif /* MAP_PC_GROUPS_H */ diff --git a/src/map/pet.h b/src/map/pet.h index 8dde0fac2..5c890ef85 100644 --- a/src/map/pet.h +++ b/src/map/pet.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_PET_H_ -#define _MAP_PET_H_ +#ifndef MAP_PET_H +#define MAP_PET_H #include "map.h" // struct block_list #include "status.h" // enum sc_type @@ -158,4 +158,4 @@ struct pet_interface *pet; void pet_defaults(void); -#endif /* _MAP_PET_H_ */ +#endif /* MAP_PET_H */ diff --git a/src/map/quest.h b/src/map/quest.h index 87894d639..9d617e369 100644 --- a/src/map/quest.h +++ b/src/map/quest.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_QUEST_H_ -#define _MAP_QUEST_H_ +#ifndef MAP_QUEST_H +#define MAP_QUEST_H #include "map.h" // TBL_PC #include "../common/cbasetypes.h" @@ -52,4 +52,4 @@ struct quest_interface *quest; void quest_defaults(void); -#endif /* _MAP_QUEST_H_ */ +#endif /* MAP_QUEST_H */ diff --git a/src/map/script.c b/src/map/script.c index c7e1dc1d2..8fb3975f8 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -1502,9 +1502,9 @@ const char* parse_syntax(const char* p) script->set_label(l,script->pos,p); } // check duplication of case label [Rayce] - if(linkdb_search(&script->syntax.curly[pos].case_label, (void*)__64BPTRSIZE(v)) != NULL) + if(linkdb_search(&script->syntax.curly[pos].case_label, (void*)h64BPTRSIZE(v)) != NULL) disp_error_message("parse_syntax: dup 'case'",p); - linkdb_insert(&script->syntax.curly[pos].case_label, (void*)__64BPTRSIZE(v), (void*)1); + linkdb_insert(&script->syntax.curly[pos].case_label, (void*)h64BPTRSIZE(v), (void*)1); sprintf(label,"set $@__SW%x_VAL,0;",script->syntax.curly[pos].index); script->syntax.curly[script->syntax.curly_count++].type = TYPE_NULL; @@ -2627,7 +2627,7 @@ void* get_val2(struct script_state* st, int64 uid, struct reg_db *ref) { script->push_val(st->stack, C_NAME, uid, ref); data = script_getdatatop(st, -1); script->get_val(st, data); - return (data->type == C_INT ? (void*)__64BPTRSIZE((int32)data->u.num) : (void*)__64BPTRSIZE(data->u.str)); // u.num is int32 because it comes from script->get_val + return (data->type == C_INT ? (void*)h64BPTRSIZE((int32)data->u.num) : (void*)h64BPTRSIZE(data->u.str)); // u.num is int32 because it comes from script->get_val } /** * Because, currently, array members with key 0 are indifferenciable from normal variables, we should ensure its actually in @@ -2648,7 +2648,7 @@ void script_array_ensure_zero(struct script_state *st, struct map_session_data * insert = true; script_removetop(st, -1, 0); } else { - int32 num = (int32)__64BPTRSIZE(script->get_val2(st, uid, ref)); + int32 num = (int32)h64BPTRSIZE(script->get_val2(st, uid, ref)); if( num ) insert = true; script_removetop(st, -1, 0); @@ -2917,7 +2917,7 @@ int set_reg(struct script_state* st, TBL_PC* sd, int64 num, const char* name, co } else {// integer variable // FIXME: This isn't safe, in 32bits systems we're converting a 64bit pointer // to a 32bit int, this will lead to overflows! [Panikon] - int val = (int)__64BPTRSIZE(value); + int val = (int)h64BPTRSIZE(value); if(script->str_data[script_getvarid(num)].type == C_PARAM) { if( pc->setparam(sd, script->str_data[script_getvarid(num)].val, val) == 0 ) { @@ -5665,7 +5665,7 @@ BUILDIN(input) else { int amount = sd->npc_amount; - script->set_reg(st, sd, uid, name, (void*)__64BPTRSIZE(cap_value(amount,min,max)), script_getref(st,2)); + script->set_reg(st, sd, uid, name, (void*)h64BPTRSIZE(cap_value(amount,min,max)), script_getref(st,2)); script_pushint(st, (amount > max ? 1 : amount < min ? -1 : 0)); } st->state = RUN; @@ -5753,7 +5753,7 @@ BUILDIN(setr) { if( is_string_variable(name) ) script->set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2)); else - script->set_reg(st,sd,num,name,(void*)__64BPTRSIZE(script_getnum(st,3)),script_getref(st,2)); + script->set_reg(st,sd,num,name,(void*)h64BPTRSIZE(script_getnum(st,3)),script_getref(st,2)); return true; } @@ -5808,7 +5808,7 @@ BUILDIN(setarray) else {// int array for( i = 3; start < end; ++start, ++i ) - script->set_reg(st, sd, reference_uid(id, start), name, (void*)__64BPTRSIZE(script_getnum(st,i)), reference_getref(data)); + script->set_reg(st, sd, reference_uid(id, start), name, (void*)h64BPTRSIZE(script_getnum(st,i)), reference_getref(data)); } return true; } @@ -5850,7 +5850,7 @@ BUILDIN(cleararray) if( is_string_variable(name) ) v = (void*)script_getstr(st, 3); else - v = (void*)__64BPTRSIZE(script_getnum(st, 3)); + v = (void*)h64BPTRSIZE(script_getnum(st, 3)); end = start + script_getnum(st, 4); if( end > SCRIPT_MAX_ARRAYSIZE ) @@ -6425,9 +6425,9 @@ BUILDIN(checkweight2) slots = pc->inventoryblank(sd); for(i=0; iget_val2(st,reference_uid(id_it,idx_it+i),reference_getref(data_it))); + nameid = (int32)h64BPTRSIZE(script->get_val2(st,reference_uid(id_it,idx_it+i),reference_getref(data_it))); script_removetop(st, -1, 0); - amount = (int32)__64BPTRSIZE(script->get_val2(st,reference_uid(id_nb,idx_nb+i),reference_getref(data_nb))); + amount = (int32)h64BPTRSIZE(script->get_val2(st,reference_uid(id_nb,idx_nb+i),reference_getref(data_nb))); script_removetop(st, -1, 0); if(fail) continue; //cpntonie to depop rest @@ -12412,18 +12412,18 @@ BUILDIN(undisguise) } /*========================================== - * Transform a bl to another _class, + * Transform a bl to another class, * @type unused *------------------------------------------*/ BUILDIN(classchange) { - int _class,type; + int class_,type; struct block_list *bl=map->id2bl(st->oid); if(bl==NULL) return true; - _class=script_getnum(st,2); + class_=script_getnum(st,2); type=script_getnum(st,3); - clif->class_change(bl,_class,type); + clif->class_change(bl,class_,type); return true; } @@ -13439,7 +13439,7 @@ BUILDIN(getmapxy) sd=script->rid2sd(st); else sd=NULL; - script->set_reg(st,sd,num,name,(void*)__64BPTRSIZE(x),script_getref(st,3)); + script->set_reg(st,sd,num,name,(void*)h64BPTRSIZE(x),script_getref(st,3)); //Set MapY num=st->stack->stack_data[st->start+4].u.num; @@ -13450,7 +13450,7 @@ BUILDIN(getmapxy) sd=script->rid2sd(st); else sd=NULL; - script->set_reg(st,sd,num,name,(void*)__64BPTRSIZE(y),script_getref(st,4)); + script->set_reg(st,sd,num,name,(void*)h64BPTRSIZE(y),script_getref(st,4)); //Return Success value script_pushint(st,0); @@ -13476,7 +13476,7 @@ BUILDIN(logmes) BUILDIN(summon) { - int _class, timeout=0; + int class_, timeout=0; const char *str,*event=""; TBL_PC *sd; struct mob_data *md; @@ -13486,7 +13486,7 @@ BUILDIN(summon) if (!sd) return true; str = script_getstr(st,2); - _class = script_getnum(st,3); + class_ = script_getnum(st,3); if( script_hasdata(st,4) ) timeout=script_getnum(st,4); if( script_hasdata(st,5) ) { @@ -13496,7 +13496,7 @@ BUILDIN(summon) clif->skill_poseffect(&sd->bl,AM_CALLHOMUN,1,sd->bl.x,sd->bl.y,tick); - md = mob->once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, _class, event, SZ_MEDIUM, AI_NONE); + md = mob->once_spawn_sub(&sd->bl, sd->bl.m, sd->bl.x, sd->bl.y, str, class_, event, SZ_MEDIUM, AI_NONE); if (md) { md->master_id=sd->bl.id; md->special_state.ai = AI_ATTACK; @@ -14400,7 +14400,7 @@ BUILDIN(sscanf) { if(sscanf(str, buf, &ref_int)==0) { break; } - script->set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)__64BPTRSIZE(ref_int), reference_getref(data)); + script->set_reg(st, sd, reference_uid( reference_getid(data), reference_getindex(data) ), buf_p, (void *)h64BPTRSIZE(ref_int), reference_getref(data)); } arg++; @@ -14767,7 +14767,7 @@ BUILDIN(setd) if( is_string_variable(varname) ) { script->setd_sub(st, sd, varname, elem, (void *)script_getstr(st, 3), NULL); } else { - script->setd_sub(st, sd, varname, elem, (void *)__64BPTRSIZE(script_getnum(st, 3)), NULL); + script->setd_sub(st, sd, varname, elem, (void *)h64BPTRSIZE(script_getnum(st, 3)), NULL); } return true; @@ -14841,7 +14841,7 @@ int buildin_query_sql_sub(struct script_state* st, Sql* handle) if( is_string_variable(name) ) script->setd_sub(st, sd, name, i, (void *)(str?str:""), reference_getref(data)); else - script->setd_sub(st, sd, name, i, (void *)__64BPTRSIZE((str?atoi(str):0)), reference_getref(data)); + script->setd_sub(st, sd, name, i, (void *)h64BPTRSIZE((str?atoi(str):0)), reference_getref(data)); } } if( i == max_rows && max_rows < SQL->NumRows(handle) ) { @@ -15395,7 +15395,7 @@ BUILDIN(searchitem) for( i = 0; i < count; ++start, ++i ) {// Set array - void* v = (void*)__64BPTRSIZE((int)items[i]->nameid); + void* v = (void*)h64BPTRSIZE((int)items[i]->nameid); script->set_reg(st, sd, reference_uid(id, start), name, v, reference_getref(data)); } diff --git a/src/map/script.h b/src/map/script.h index bb6cd6e11..48abf1487 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_SCRIPT_H_ -#define _MAP_SCRIPT_H_ +#ifndef MAP_SCRIPT_H +#define MAP_SCRIPT_H #include #include @@ -715,4 +715,4 @@ struct script_interface *script; void script_defaults(void); -#endif /* _MAP_SCRIPT_H_ */ +#endif /* MAP_SCRIPT_H */ diff --git a/src/map/searchstore.h b/src/map/searchstore.h index c9b93ba54..d8abde615 100644 --- a/src/map/searchstore.h +++ b/src/map/searchstore.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_SEARCHSTORE_H_ -#define _MAP_SEARCHSTORE_H_ +#ifndef MAP_SEARCHSTORE_H +#define MAP_SEARCHSTORE_H #include @@ -99,4 +99,4 @@ struct searchstore_interface *searchstore; void searchstore_defaults (void); -#endif /* _MAP_SEARCHSTORE_H_ */ +#endif /* MAP_SEARCHSTORE_H */ diff --git a/src/map/skill.h b/src/map/skill.h index 6666fbbf2..70e5f4911 100644 --- a/src/map/skill.h +++ b/src/map/skill.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_SKILL_H_ -#define _MAP_SKILL_H_ +#ifndef MAP_SKILL_H +#define MAP_SKILL_H #include "../config/core.h" // RENEWAL_CAST @@ -2021,4 +2021,4 @@ struct skill_interface *skill; void skill_defaults(void); -#endif /* _MAP_SKILL_H_ */ +#endif /* MAP_SKILL_H */ diff --git a/src/map/status.h b/src/map/status.h index 13d0a7841..bed0d9fbf 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_STATUS_H_ -#define _MAP_STATUS_H_ +#ifndef MAP_STATUS_H +#define MAP_STATUS_H #include "../config/core.h" // defType, RENEWAL, RENEWAL_ASPD @@ -2047,4 +2047,4 @@ struct status_interface *status; void status_defaults(void); -#endif /* _MAP_STATUS_H_ */ +#endif /* MAP_STATUS_H */ diff --git a/src/map/storage.c b/src/map/storage.c index f2f0d8986..217f14a3a 100644 --- a/src/map/storage.c +++ b/src/map/storage.c @@ -31,10 +31,10 @@ struct guild_storage_interface gstorage_s; /*========================================== * Sort items in the warehouse *------------------------------------------*/ -int storage_comp_item(const void *_i1, const void *_i2) +int storage_comp_item(const void *i1_, const void *i2_) { - struct item *i1 = (struct item *)_i1; - struct item *i2 = (struct item *)_i2; + struct item *i1 = (struct item *)i1_; + struct item *i2 = (struct item *)i2_; if (i1->nameid == i2->nameid) return 0; diff --git a/src/map/storage.h b/src/map/storage.h index 5edb68cfc..186f21263 100644 --- a/src/map/storage.h +++ b/src/map/storage.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_STORAGE_H_ -#define _MAP_STORAGE_H_ +#ifndef MAP_STORAGE_H +#define MAP_STORAGE_H #include "../common/cbasetypes.h" #include "../common/db.h" @@ -25,7 +25,7 @@ struct storage_interface { int (*gettocart) (struct map_session_data *sd,int index,int amount); void (*close) (struct map_session_data *sd); void (*pc_quit) (struct map_session_data *sd, int flag); - int (*comp_item) (const void *_i1, const void *_i2); + int (*comp_item) (const void *i1_, const void *i2_); void (*sortitem) (struct item* items, unsigned int size); int (*reconnect_sub) (DBKey key, DBData *data, va_list ap); }; @@ -60,4 +60,4 @@ struct guild_storage_interface *gstorage; void storage_defaults(void); void gstorage_defaults(void); -#endif /* _MAP_STORAGE_H_ */ +#endif /* MAP_STORAGE_H */ diff --git a/src/map/trade.h b/src/map/trade.h index 143f26d74..f91ccd4a2 100644 --- a/src/map/trade.h +++ b/src/map/trade.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_TRADE_H_ -#define _MAP_TRADE_H_ +#ifndef MAP_TRADE_H +#define MAP_TRADE_H //Max distance from traders to enable a trade to take place. //TODO: battle_config candidate? @@ -27,4 +27,4 @@ struct trade_interface *trade; void trade_defaults(void); -#endif /* _MAP_TRADE_H_ */ +#endif /* MAP_TRADE_H */ diff --git a/src/map/unit.h b/src/map/unit.h index f29a6903a..9b95bae41 100644 --- a/src/map/unit.h +++ b/src/map/unit.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_UNIT_H_ -#define _MAP_UNIT_H_ +#ifndef MAP_UNIT_H +#define MAP_UNIT_H #include "clif.h" // clr_type #include "path.h" // struct walkpath_data @@ -124,4 +124,4 @@ struct unit_interface *unit; void unit_defaults(void); -#endif /* _MAP_UNIT_H_ */ +#endif /* MAP_UNIT_H */ diff --git a/src/map/vending.h b/src/map/vending.h index b65e888e3..63cb632a9 100644 --- a/src/map/vending.h +++ b/src/map/vending.h @@ -2,8 +2,8 @@ // See the LICENSE file // Portions Copyright (c) Athena Dev Teams -#ifndef _MAP_VENDING_H_ -#define _MAP_VENDING_H_ +#ifndef MAP_VENDING_H +#define MAP_VENDING_H #include "../common/cbasetypes.h" #include "../common/db.h" @@ -36,4 +36,4 @@ struct vending_interface *vending; void vending_defaults(void); -#endif /* _MAP_VENDING_H_ */ +#endif /* MAP_VENDING_H */ diff --git a/tools/HPMHookGen/HPMDataCheckGen.pl b/tools/HPMHookGen/HPMDataCheckGen.pl index a79811c47..7ec1ba7e4 100644 --- a/tools/HPMHookGen/HPMDataCheckGen.pl +++ b/tools/HPMHookGen/HPMDataCheckGen.pl @@ -24,7 +24,7 @@ foreach my $file (@files) { my @filepath = split(/[\/\\]/, $data->{compounddef}->{location}->{file}); my $foldername = uc($filepath[-2]); my $filename = uc($filepath[-1]); $filename =~ s/-/_/g; $filename =~ s/\.[^.]*$//; - my $name = "_${foldername}_${filename}_H_"; + my $name = "${foldername}_${filename}_H"; push @{ $out{$name} }, $data->{compounddef}->{compoundname}; } @@ -37,8 +37,8 @@ print FH <<"EOF"; // // NOTE: This file was auto-generated and should never be manually edited, // as it will get overwritten. -#ifndef _HPM_DATA_CHECK_H_ -#define _HPM_DATA_CHECK_H_ +#ifndef HPM_DATA_CHECK_H +#define HPM_DATA_CHECK_H HPExport const struct s_HPMDataCheck HPMDataCheck[] = { @@ -63,6 +63,6 @@ print FH <<"EOF"; }; HPExport unsigned int HPMDataCheckLen = ARRAYLENGTH(HPMDataCheck); -#endif /* _HPM_DATA_CHECK_H_ */ +#endif /* HPM_DATA_CHECK_H */ EOF close(FH); -- cgit v1.2.3-70-g09d2 From 46aa529396625efebdd637f540e9e104059866b6 Mon Sep 17 00:00:00 2001 From: Haru Date: Thu, 10 Jul 2014 18:24:50 +0200 Subject: Explicitly specify 'void' when a function expects no arguments - See CERT DCL20-C. Signed-off-by: Haru --- src/common/core.c | 2 +- src/common/mutex.c | 4 ++-- src/common/thread.c | 10 +++++----- src/common/thread.h | 10 +++++----- src/common/timer.c | 4 ++-- src/test/test_spinlock.c | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/common/thread.c') diff --git a/src/common/core.c b/src/common/core.c index 28c84e2cf..99dbc36ec 100644 --- a/src/common/core.c +++ b/src/common/core.c @@ -99,7 +99,7 @@ static BOOL WINAPI console_handler(DWORD c_event) { return TRUE; } -static void cevents_init() { +static void cevents_init(void) { if (SetConsoleCtrlHandler(console_handler,TRUE)==FALSE) ShowWarning ("Unable to install the console handler!\n"); } diff --git a/src/common/mutex.c b/src/common/mutex.c index 6707df7e6..ea3e0f8ce 100644 --- a/src/common/mutex.c +++ b/src/common/mutex.c @@ -50,7 +50,7 @@ struct racond{ // -ramutex *ramutex_create() { +ramutex *ramutex_create(void) { struct ramutex *m; m = (struct ramutex*)aMalloc( sizeof(struct ramutex) ); @@ -124,7 +124,7 @@ void ramutex_unlock(ramutex *m) { // Implementation: // -racond *racond_create() { +racond *racond_create(void) { struct racond *c; c = (struct racond*)aMalloc( sizeof(struct racond) ); diff --git a/src/common/thread.c b/src/common/thread.c index d680d0347..1d0285302 100644 --- a/src/common/thread.c +++ b/src/common/thread.c @@ -59,7 +59,7 @@ __thread int g_rathread_ID = -1; /// static struct rAthread l_threads[RA_THREADS_MAX]; -void rathread_init(){ +void rathread_init(void) { register unsigned int i; memset(&l_threads, 0x00, RA_THREADS_MAX * sizeof(struct rAthread) ); @@ -78,7 +78,7 @@ void rathread_init(){ -void rathread_final(){ +void rathread_final(void) { register unsigned int i; // Unterminated Threads Left? @@ -230,7 +230,7 @@ void rathread_destroy(rAthread *handle) { #endif }//end: rathread_destroy() -rAthread *rathread_self() { +rAthread *rathread_self(void) { #ifdef HAS_TLS rAthread *handle = &l_threads[g_rathread_ID]; @@ -259,7 +259,7 @@ rAthread *rathread_self() { }//end: rathread_self() -int rathread_get_tid(){ +int rathread_get_tid(void) { #ifdef HAS_TLS return g_rathread_ID; @@ -305,7 +305,7 @@ RATHREAD_PRIO rathread_prio_get(rAthread *handle) { }//end: rathread_prio_get() -void rathread_yield(){ +void rathread_yield(void) { #ifdef WIN32 SwitchToThread(); #else diff --git a/src/common/thread.h b/src/common/thread.h index f781cfbd0..c7582366d 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -58,7 +58,7 @@ void rathread_destroy(rAthread *handle); * * @return not NULL if success */ -rAthread *rathread_self(); +rAthread *rathread_self(void); /** @@ -69,7 +69,7 @@ rAthread *rathread_self(); * * @return -1 when fails, otherwise >= 0 */ -int rathread_get_tid(); +int rathread_get_tid(void); /** @@ -107,12 +107,12 @@ RATHREAD_PRIO rathread_prio_get(rAthread *handle); * it just allows the OS to spent the remaining time * of the slice to another thread. */ -void rathread_yield(); +void rathread_yield(void); -void rathread_init(); -void rathread_final(); +void rathread_init(void); +void rathread_final(void); #endif /* COMMON_THREAD_H */ diff --git a/src/common/timer.c b/src/common/timer.c index 128fc4daf..370eafd4c 100644 --- a/src/common/timer.c +++ b/src/common/timer.c @@ -107,7 +107,7 @@ char* search_timer_func_list(TimerFunc func) #if defined(ENABLE_RDTSC) static uint64 RDTSC_BEGINTICK = 0, RDTSC_CLOCK = 0; -static __inline uint64 rdtsc_() { +static __inline uint64 rdtsc_(void) { register union{ uint64 qw; uint32 dw[2]; @@ -118,7 +118,7 @@ static __inline uint64 rdtsc_() { return t.qw; } -static void rdtsc_calibrate(){ +static void rdtsc_calibrate(void){ uint64 t1, t2; int32 i; diff --git a/src/test/test_spinlock.c b/src/test/test_spinlock.c index 2f4c2a5ca..19a25f9d2 100644 --- a/src/test/test_spinlock.c +++ b/src/test/test_spinlock.c @@ -98,16 +98,16 @@ return 0; }//end: do_init() -void do_abort(){ +void do_abort(void) { }//end: do_abort() -void set_server_type(){ +void set_server_type(void) { SERVER_TYPE = SERVER_TYPE_UNKNOWN; }//end: set_server_type() -int do_final(){ +int do_final(void) { return EXIT_SUCCESS; }//end: do_final() -- cgit v1.2.3-70-g09d2