summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-01-21 21:50:36 -0800
committerBen Longbons <b.r.longbons@gmail.com>2013-02-01 12:36:51 -0800
commit90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee (patch)
tree42667ee8211853727c14645c05280e2500a7a994 /src/map
parentb3ca4bccc4fa6b7f5d637bdecb4fac6ca9649f3c (diff)
downloadtmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.tar.gz
tmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.tar.bz2
tmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.tar.xz
tmwa-90f2d2aeffdb345e9fdfc5c3e56fffa71281f2ee.zip
Remove unnecessary includes, speeding up recompilation
Diffstat (limited to 'src/map')
-rw-r--r--src/map/atcommand.cpp15
-rw-r--r--src/map/atcommand.hpp4
-rw-r--r--src/map/battle.cpp6
-rw-r--r--src/map/battle.hpp8
-rw-r--r--src/map/battle.t.hpp2
-rw-r--r--src/map/chat.cpp3
-rw-r--r--src/map/chat.hpp4
-rw-r--r--src/map/chrif.cpp12
-rw-r--r--src/map/chrif.hpp10
-rw-r--r--src/map/clif.cpp31
-rw-r--r--src/map/clif.hpp40
-rw-r--r--src/map/intif.cpp14
-rw-r--r--src/map/intif.hpp6
-rw-r--r--src/map/itemdb.cpp8
-rw-r--r--src/map/itemdb.hpp4
-rw-r--r--src/map/magic-expr-eval.hpp8
-rw-r--r--src/map/magic-expr.cpp6
-rw-r--r--src/map/magic-expr.hpp1
-rw-r--r--src/map/magic-interpreter-base.cpp10
-rw-r--r--src/map/magic-interpreter-lexer.lpp5
-rw-r--r--src/map/magic-interpreter-parser.ypp5
-rw-r--r--src/map/magic-interpreter.hpp27
-rw-r--r--src/map/magic-interpreter.t.hpp2
-rw-r--r--src/map/magic-stmt.cpp7
-rw-r--r--src/map/magic.cpp6
-rw-r--r--src/map/magic.hpp3
-rw-r--r--src/map/map.cpp6
-rw-r--r--src/map/map.hpp23
-rw-r--r--src/map/map.t.hpp2
-rw-r--r--src/map/mob.cpp5
-rw-r--r--src/map/mob.hpp21
-rw-r--r--src/map/npc.cpp6
-rw-r--r--src/map/npc.hpp10
-rw-r--r--src/map/party.cpp4
-rw-r--r--src/map/party.hpp12
-rw-r--r--src/map/path.cpp5
-rw-r--r--src/map/pc.cpp16
-rw-r--r--src/map/pc.hpp15
-rw-r--r--src/map/script.cpp10
-rw-r--r--src/map/skill-pools.cpp18
-rw-r--r--src/map/skill.cpp7
-rw-r--r--src/map/skill.hpp17
-rw-r--r--src/map/skill.t.hpp2
-rw-r--r--src/map/storage.cpp4
-rw-r--r--src/map/storage.hpp2
-rw-r--r--src/map/tmw.cpp14
-rw-r--r--src/map/tmw.hpp2
-rw-r--r--src/map/trade.cpp4
-rw-r--r--src/map/trade.hpp2
49 files changed, 152 insertions, 302 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp
index 968e428..211baac 100644
--- a/src/map/atcommand.cpp
+++ b/src/map/atcommand.cpp
@@ -1,26 +1,16 @@
#include "atcommand.hpp"
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <cctype>
#include <cmath>
-#include <cstdio>
-#include <cstdlib>
#include <cstring>
#include <ctime>
-#include <array>
-
#include "../common/core.hpp"
#include "../common/cxxstdio.hpp"
+#include "../common/mmo.hpp"
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
+#include "../common/utils2.hpp"
#include "battle.hpp"
#include "chrif.hpp"
@@ -34,6 +24,7 @@
#include "pc.hpp"
#include "script.hpp"
#include "skill.hpp"
+#include "storage.hpp"
#include "tmw.hpp"
#include "trade.hpp"
diff --git a/src/map/atcommand.hpp b/src/map/atcommand.hpp
index 4d3b592..5db9287 100644
--- a/src/map/atcommand.hpp
+++ b/src/map/atcommand.hpp
@@ -1,7 +1,7 @@
#ifndef ATCOMMAND_HPP
#define ATCOMMAND_HPP
-#include "map.hpp"
+#include "../common/const_array.hpp"
enum AtCommandType
{
@@ -187,7 +187,7 @@ typedef struct AtCommandInfo
const char *command;
int level;
int(*proc)(const int, struct map_session_data *,
- const char *command, const char *message);
+ const char *command, const char *message);
} AtCommandInfo;
bool is_atcommand(const int fd, struct map_session_data *sd,
diff --git a/src/map/battle.cpp b/src/map/battle.cpp
index 9d51486..33941f6 100644
--- a/src/map/battle.cpp
+++ b/src/map/battle.cpp
@@ -1,16 +1,12 @@
#include "battle.hpp"
-#include <cmath>
-#include <cstdio>
-#include <cstdlib>
#include <cstring>
#include <fstream>
+#include "../common/cxxstdio.hpp"
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
-#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "clif.hpp"
#include "itemdb.hpp"
diff --git a/src/map/battle.hpp b/src/map/battle.hpp
index 04ca656..56b3a9f 100644
--- a/src/map/battle.hpp
+++ b/src/map/battle.hpp
@@ -3,8 +3,6 @@
#include "battle.t.hpp"
-#include "../common/utils.hpp"
-
#include "map.t.hpp"
#include "skill.t.hpp"
@@ -31,9 +29,9 @@ struct Damage battle_calc_attack(BF attack_type,
// 実際にHPを増減
int battle_damage(struct block_list *bl, struct block_list *target,
- int damage, int flag);
+ int damage, int flag);
int battle_heal(struct block_list *bl, struct block_list *target, int hp,
- int sp, int flag);
+ int sp, int flag);
// 攻撃や移動を止める
int battle_stopattack(struct block_list *bl);
@@ -83,7 +81,7 @@ int battle_check_undead(int race, int element);
int battle_check_target(struct block_list *src, struct block_list *target,
BCT flag);
int battle_check_range(struct block_list *src, struct block_list *bl,
- int range);
+ int range);
extern struct Battle_Config
{
diff --git a/src/map/battle.t.hpp b/src/map/battle.t.hpp
index b84d1f2..f88fb71 100644
--- a/src/map/battle.t.hpp
+++ b/src/map/battle.t.hpp
@@ -1,7 +1,7 @@
#ifndef BATTLE_T_HPP
#define BATTLE_T_HPP
-#include "../common/utils.hpp"
+#include "../common/utils2.hpp"
namespace e
{
diff --git a/src/map/chat.cpp b/src/map/chat.cpp
index dcb6e51..1f9f433 100644
--- a/src/map/chat.cpp
+++ b/src/map/chat.cpp
@@ -1,13 +1,10 @@
#include "chat.hpp"
-#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include "../common/db.hpp"
#include "../common/nullpo.hpp"
-#include "clif.hpp"
#include "map.hpp"
#include "npc.hpp"
#include "pc.hpp"
diff --git a/src/map/chat.hpp b/src/map/chat.hpp
index 28cc623..ead7b49 100644
--- a/src/map/chat.hpp
+++ b/src/map/chat.hpp
@@ -1,12 +1,10 @@
#ifndef CHAT_HPP
#define CHAT_HPP
-#include "map.hpp"
-
int chat_leavechat(struct map_session_data *);
int chat_createnpcchat(struct npc_data *nd, int limit, int pub, int trigger,
- const char *title, int titlelen, const char *ev);
+ const char *title, int titlelen, const char *ev);
int chat_deletenpcchat(struct npc_data *nd);
int chat_enableevent(struct chat_data *cd);
int chat_disableevent(struct chat_data *cd);
diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp
index 1f70a02..018c659 100644
--- a/src/map/chrif.cpp
+++ b/src/map/chrif.cpp
@@ -1,21 +1,13 @@
#include "chrif.hpp"
#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <cstdio>
-#include <cstdlib>
#include <cstring>
-#include <ctime>
#include "../common/cxxstdio.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
+#include "../common/utils.hpp"
#include "battle.hpp"
#include "clif.hpp"
@@ -24,6 +16,7 @@
#include "map.hpp"
#include "npc.hpp"
#include "pc.hpp"
+#include "storage.hpp"
#include "../poison.hpp"
@@ -1056,7 +1049,6 @@ void chrif_parse(int fd)
fd);
char_fd = -1;
}
- close(fd);
delete_session(fd);
return;
}
diff --git a/src/map/chrif.hpp b/src/map/chrif.hpp
index dce1ae3..2816e9f 100644
--- a/src/map/chrif.hpp
+++ b/src/map/chrif.hpp
@@ -14,16 +14,16 @@ int chrif_authreq(struct map_session_data *);
int chrif_save(struct map_session_data *);
int chrif_charselectreq(struct map_session_data *);
-int chrif_changemapserver(struct map_session_data *sd, char *name, int x,
- int y, struct in_addr ip, short port);
+int chrif_changemapserver(struct map_session_data *sd,
+ char *name, int x, int y,
+ struct in_addr ip, short port);
int chrif_searchcharid(int char_id);
int chrif_changegm(int id, const char *pass, int len);
int chrif_changeemail(int id, const char *actual_email,
- const char *new_email);
+ const char *new_email);
int chrif_char_ask_name(int id, char *character_name, short operation_type,
- int year, int month, int day, int hour, int minute,
- int second);
+ int year, int month, int day, int hour, int minute, int second);
int chrif_saveaccountreg2(struct map_session_data *sd);
int chrif_reloadGMdb(void);
int chrif_send_divorce(int char_id);
diff --git a/src/map/clif.cpp b/src/map/clif.cpp
index e26e64e..99447ea 100644
--- a/src/map/clif.cpp
+++ b/src/map/clif.cpp
@@ -1,14 +1,7 @@
#include "clif.hpp"
#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include <cctype>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
@@ -18,22 +11,18 @@
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "../common/version.hpp"
#include "atcommand.hpp"
#include "battle.hpp"
-#include "chat.hpp"
#include "chrif.hpp"
#include "intif.hpp"
#include "itemdb.hpp"
#include "magic.hpp"
#include "map.hpp"
-#include "mob.hpp"
#include "npc.hpp"
#include "party.hpp"
#include "pc.hpp"
-#include "script.hpp"
#include "skill.hpp"
#include "storage.hpp"
#include "tmw.hpp"
@@ -6140,8 +6129,6 @@ void clif_parse(int fd)
map_deliddb(&sd->bl); // account_id has been included in the DB before auth answer
}
if (fd)
- close(fd);
- if (fd)
delete_session(fd);
return;
}
@@ -6297,24 +6284,8 @@ void clif_parse(int fd)
*/
int do_init_clif (void)
{
- int i;
-
set_defaultparse(clif_parse);
- for (i = 0; i < 10; i++)
- {
- if (make_listen_port(map_port))
- break;
-#ifdef LCCWIN32
- Sleep(20000);
-#else
- sleep(20);
-#endif
- }
- if (i == 10)
- {
- PRINTF("cant bind game port\n");
- exit(1);
- }
+ make_listen_port(map_port);
return 0;
}
diff --git a/src/map/clif.hpp b/src/map/clif.hpp
index 75dc73d..51ee4aa 100644
--- a/src/map/clif.hpp
+++ b/src/map/clif.hpp
@@ -1,17 +1,13 @@
#ifndef CLIF_HPP
#define CLIF_HPP
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <sys/types.h>
+#include <functional>
#include "../common/const_array.hpp"
+#include "map.t.hpp"
#include "pc.t.hpp"
-
-#include "map.hpp"
-#include "storage.hpp"
+#include "skill.t.hpp"
void clif_setip(const char *);
void clif_setport(int);
@@ -33,7 +29,7 @@ int clif_clearchar_id(int, int, int);
int clif_spawnpc(struct map_session_data *); //area
int clif_spawnnpc(struct npc_data *); // area
int clif_spawn_fake_npc_for_player(struct map_session_data *sd,
- int fake_npc_id);
+ int fake_npc_id);
int clif_spawnmob(struct mob_data *); // area
int clif_walkok(struct map_session_data *); // self
int clif_movechar(struct map_session_data *); // area
@@ -77,9 +73,9 @@ void clif_sitting(int fd, struct map_session_data *sd);
int clif_traderequest(struct map_session_data *sd, const char *name);
int clif_tradestart(struct map_session_data *sd, int type);
int clif_tradeadditem(struct map_session_data *sd,
- struct map_session_data *tsd, int index, int amount);
+ struct map_session_data *tsd, int index, int amount);
int clif_tradeitemok(struct map_session_data *sd, int index, int amount,
- int fail);
+ int fail);
int clif_tradedeal_lock(struct map_session_data *sd, int fail);
int clif_tradecancelled(struct map_session_data *sd);
int clif_tradecompleted(struct map_session_data *sd, int fail);
@@ -87,13 +83,13 @@ int clif_tradecompleted(struct map_session_data *sd, int fail);
// storage
int clif_storageitemlist(struct map_session_data *sd, struct storage *stor);
int clif_storageequiplist(struct map_session_data *sd,
- struct storage *stor);
+ struct storage *stor);
int clif_updatestorageamount(struct map_session_data *sd,
- struct storage *stor);
+ struct storage *stor);
int clif_storageitemadded(struct map_session_data *sd, struct storage *stor,
- int index, int amount);
+ int index, int amount);
int clif_storageitemremoved(struct map_session_data *sd, int index,
- int amount);
+ int amount);
int clif_storageclose(struct map_session_data *sd);
// map_forallinmovearea callbacks
@@ -103,16 +99,16 @@ void clif_mobinsight(struct block_list *, struct mob_data *);
void clif_moboutsight(struct block_list *, struct mob_data *);
int clif_skillinfo(struct map_session_data *sd, SkillID skillid, int type,
- int range);
+ int range);
int clif_skillinfoblock(struct map_session_data *sd);
int clif_skillup(struct map_session_data *sd, SkillID skill_num);
int clif_skillcastcancel(struct block_list *bl);
int clif_skill_fail(struct map_session_data *sd, SkillID skill_id, int type,
- int btype);
+ int btype);
int clif_skill_damage(struct block_list *src, struct block_list *dst,
- unsigned int tick, int sdelay, int ddelay, int damage,
- int div, SkillID skill_id, int skill_lv, int type);
+ unsigned int tick, int sdelay, int ddelay, int damage,
+ int div, SkillID skill_id, int skill_lv, int type);
int clif_status_change(struct block_list *bl,
StatusChange type, int flag);
@@ -131,12 +127,12 @@ int clif_movetoattack(struct map_session_data *sd, struct block_list *bl);
int clif_party_created(struct map_session_data *sd, int flag);
int clif_party_info(struct party *p, int fd);
int clif_party_invite(struct map_session_data *sd,
- struct map_session_data *tsd);
+ struct map_session_data *tsd);
int clif_party_inviteack(struct map_session_data *sd, const char *nick, int flag);
int clif_party_option(struct party *p, struct map_session_data *sd,
- int flag);
+ int flag);
int clif_party_leaved(struct party *p, struct map_session_data *sd,
- int account_id, const char *name, int flag);
+ int account_id, const char *name, int flag);
int clif_party_message(struct party *p, int account_id, const char *mes, int len);
int clif_party_xy(struct party *p, struct map_session_data *sd);
int clif_party_hp(struct party *p, struct map_session_data *sd);
@@ -150,7 +146,7 @@ int clif_specialeffect(struct block_list *bl, int type, int flag); // special
int clif_message(struct block_list *bl, const char *msg); // messages (from mobs/npcs) [Valaris]
int clif_GM_kick(struct map_session_data *sd, struct map_session_data *tsd,
- int type);
+ int type);
int clif_foreachclient(std::function<void(struct map_session_data *)>);
diff --git a/src/map/intif.cpp b/src/map/intif.cpp
index 7c42cfc..8a869e1 100644
--- a/src/map/intif.cpp
+++ b/src/map/intif.cpp
@@ -1,23 +1,11 @@
#include "intif.hpp"
-#include <arpa/inet.h>
-#include <netinet/in.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <sys/types.h>
-
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <csignal>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include "../common/cxxstdio.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "battle.hpp"
#include "chrif.hpp"
diff --git a/src/map/intif.hpp b/src/map/intif.hpp
index 7a03483..25f69e3 100644
--- a/src/map/intif.hpp
+++ b/src/map/intif.hpp
@@ -8,9 +8,9 @@ int intif_parse(int fd);
void intif_GMmessage(const_string mes, int flag);
int intif_wis_message(struct map_session_data *sd, const char *nick, const char *mes,
- int mes_len);
+ int mes_len);
int intif_wis_message_to_gm(const char *Wisp_name, int min_gm_level, const char *mes,
- int mes_len);
+ int mes_len);
int intif_saveaccountreg(struct map_session_data *sd);
int intif_request_accountreg(struct map_session_data *sd);
@@ -22,7 +22,7 @@ int intif_create_party(struct map_session_data *sd, const char *name);
int intif_request_partyinfo(int party_id);
int intif_party_addmember(int party_id, int account_id);
int intif_party_changeoption(int party_id, int account_id, int exp,
- int item);
+ int item);
int intif_party_leave(int party_id, int accound_id);
int intif_party_changemap(struct map_session_data *sd, int online);
int intif_party_message(int party_id, int account_id, const char *mes, int len);
diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp
index 7ca6055..b6a841e 100644
--- a/src/map/itemdb.cpp
+++ b/src/map/itemdb.cpp
@@ -1,20 +1,14 @@
#include "itemdb.hpp"
-#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include "../common/cxxstdio.hpp"
#include "../common/db.hpp"
-#include "../common/grfio.hpp"
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "battle.hpp"
-#include "map.hpp"
-#include "pc.hpp"
-#include "script.hpp"
-
#include "../poison.hpp"
#define MAX_RANDITEM 2000
diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp
index e503d9a..540fced 100644
--- a/src/map/itemdb.hpp
+++ b/src/map/itemdb.hpp
@@ -1,7 +1,9 @@
#ifndef ITEMDB_HPP
#define ITEMDB_HPP
-#include "map.hpp"
+#include "../common/mmo.hpp"
+
+#include "map.t.hpp"
#include "script.hpp"
struct item_data
diff --git a/src/map/magic-expr-eval.hpp b/src/map/magic-expr-eval.hpp
index 0bf9ee4..ae9699d 100644
--- a/src/map/magic-expr-eval.hpp
+++ b/src/map/magic-expr-eval.hpp
@@ -1,6 +1,10 @@
#ifndef MAGIC_EXPR_EVAL_HPP
#define MAGIC_EXPR_EVAL_HPP
+#include "../common/utils2.hpp"
+
+#include "magic-interpreter.hpp"
+
/* Helper definitions for dealing with functions and operations */
static
@@ -11,10 +15,10 @@ earray<int, DIR, DIR::COUNT> heading_y //=
{{ 1, 1, 0, -1, -1, -1, 0, 1 }};
int magic_signature_check(const char *opname, const char *funname, const char *signature,
- int args_nr, val_t *args, int line, int column);
+ int args_nr, val_t *args, int line, int column);
void magic_area_rect(int *m, int *x, int *y, int *width, int *height,
- area_t *area);
+ area_t *area);
#define ARGINT(x) args[x].v.v_int
#define ARGDIR(x) args[x].v.v_dir
diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp
index def1ece..6ad2cef 100644
--- a/src/map/magic-expr.cpp
+++ b/src/map/magic-expr.cpp
@@ -1,12 +1,16 @@
+#include "magic-expr-eval.hpp"
#include "magic-expr.hpp"
+#include "magic-interpreter-aux.hpp"
#include <cmath>
#include "../common/cxxstdio.hpp"
#include "../common/mt_rand.hpp"
+#include "battle.hpp"
+#include "npc.hpp"
+#include "pc.hpp"
#include "itemdb.hpp"
-#include "magic-expr-eval.hpp"
#include "../poison.hpp"
diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp
index 4fd6041..4d2ea3c 100644
--- a/src/map/magic-expr.hpp
+++ b/src/map/magic-expr.hpp
@@ -2,7 +2,6 @@
#define MAGIC_EXPR_HPP
#include "magic-interpreter.hpp"
-#include "magic-interpreter-aux.hpp"
/*
* Argument types:
diff --git a/src/map/magic-interpreter-base.cpp b/src/map/magic-interpreter-base.cpp
index 79f77da..0ddc4fd 100644
--- a/src/map/magic-interpreter-base.cpp
+++ b/src/map/magic-interpreter-base.cpp
@@ -1,7 +1,11 @@
-#include "magic.hpp"
-#include "magic-expr.hpp"
-#include "magic-interpreter.hpp"
#include "magic-interpreter-aux.hpp"
+#include "magic-interpreter.hpp"
+
+#include "../common/cxxstdio.hpp"
+
+#include "magic-expr.hpp"
+
+#include "pc.hpp"
#include "../poison.hpp"
diff --git a/src/map/magic-interpreter-lexer.lpp b/src/map/magic-interpreter-lexer.lpp
index 34461f5..ba3372e 100644
--- a/src/map/magic-interpreter-lexer.lpp
+++ b/src/map/magic-interpreter-lexer.lpp
@@ -1,9 +1,10 @@
%{
-#include "magic-interpreter.hpp"
#include "magic-interpreter-parser.hpp"
+#include "../common/cxxstdio.hpp"
+
#ifdef HEADING
-# undef HEADING
+# error "what platform is this? please tell me who #defined HEADING"
#endif
#define FIXLOC magic_frontend_lloc.first_line = magic_frontend_lineno
diff --git a/src/map/magic-interpreter-parser.ypp b/src/map/magic-interpreter-parser.ypp
index 3cabf24..b6486f1 100644
--- a/src/map/magic-interpreter-parser.ypp
+++ b/src/map/magic-interpreter-parser.ypp
@@ -1,5 +1,5 @@
%code requires {
-#include "magic-expr.hpp"
+#include "magic-interpreter.hpp"
}
%code{
#include "magic-interpreter-parser.hpp"
@@ -8,7 +8,8 @@
#include "../common/cxxstdio.hpp"
-#include "magic-interpreter.hpp"
+#include "itemdb.hpp"
+#include "magic-expr.hpp"
#define YYLEX_PARAM 0, 0
diff --git a/src/map/magic-interpreter.hpp b/src/map/magic-interpreter.hpp
index e79f0ab..9b7a035 100644
--- a/src/map/magic-interpreter.hpp
+++ b/src/map/magic-interpreter.hpp
@@ -3,31 +3,10 @@
#include "magic-interpreter.t.hpp"
-#include <cmath>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
-#include "../common/nullpo.hpp"
-#include "../common/socket.hpp"
-#include "../common/timer.hpp"
-
-#include "battle.hpp"
-#include "chat.hpp"
-#include "chrif.hpp"
-#include "clif.hpp"
-#include "intif.hpp"
-#include "itemdb.hpp"
#include "magic.hpp"
#include "map.hpp"
-#include "mob.hpp"
-#include "npc.hpp"
-#include "party.hpp"
-#include "pc.hpp"
#include "script.hpp"
-#include "skill.hpp"
-#include "storage.hpp"
-#include "trade.hpp"
+#include "skill.t.hpp"
struct expr;
struct val;
@@ -371,7 +350,7 @@ teleport_anchor_t *magic_find_anchor(char *name);
* The parameter `param' must have been dynamically allocated; ownership is transferred to the resultant env_t.
*/
env_t *spell_create_env(magic_conf_t *conf, spell_t *spell,
- character_t *caster, int spellpower, char *param);
+ character_t *caster, int spellpower, char *param);
void magic_free_env(env_t *env);
@@ -379,7 +358,7 @@ void magic_free_env(env_t *env);
* near_miss is set to nonzero iff the spell only failed due to ephemereal issues (spell delay in effect, out of mana, out of components)
*/
effect_set_t *spell_trigger(spell_t *spell, character_t *caster,
- env_t *env, int *near_miss);
+ env_t *env, int *near_miss);
invocation_t *spell_instantiate(effect_set_t *effect, env_t *env);
diff --git a/src/map/magic-interpreter.t.hpp b/src/map/magic-interpreter.t.hpp
index f5cb309..49fd3e1 100644
--- a/src/map/magic-interpreter.t.hpp
+++ b/src/map/magic-interpreter.t.hpp
@@ -1,7 +1,7 @@
#ifndef MAGIC_INTERPRETER_T_HPP
#define MAGIC_INTERPRETER_T_HPP
-#include "../common/utils.hpp"
+#include "../common/utils2.hpp"
enum class SPELLARG : uint8_t
{
diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp
index b89b3c4..f39fc1f 100644
--- a/src/map/magic-stmt.cpp
+++ b/src/map/magic-stmt.cpp
@@ -5,6 +5,13 @@
#include "magic-interpreter.hpp"
#include "magic-interpreter-aux.hpp"
+#include "battle.hpp"
+#include "clif.hpp"
+#include "mob.hpp"
+#include "npc.hpp"
+#include "pc.hpp"
+#include "skill.hpp"
+
#include "../poison.hpp"
#define INVISIBLE_NPC 127 /* used for local spell effects */
diff --git a/src/map/magic.cpp b/src/map/magic.cpp
index 09b1928..5e08d30 100644
--- a/src/map/magic.cpp
+++ b/src/map/magic.cpp
@@ -1,9 +1,9 @@
-#include <cmath>
-#include <cstdio>
-#include <cstdlib>
#include <cstring>
+#include "../common/cxxstdio.hpp"
+
#include "magic-interpreter.hpp"
+#include "pc.hpp"
#include "../poison.hpp"
diff --git a/src/map/magic.hpp b/src/map/magic.hpp
index 848ba46..4b567ea 100644
--- a/src/map/magic.hpp
+++ b/src/map/magic.hpp
@@ -1,8 +1,7 @@
#ifndef MAGIC_HPP
#define MAGIC_HPP
-#include "clif.hpp"
-#include "intif.hpp"
+#include "skill.t.hpp"
#define MAGIC_CONFIG_FILE "conf/magic.conf"
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 1fd9bb9..5112ec3 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -1,27 +1,27 @@
#include "map.hpp"
+#include <sys/time.h>
+
#include <netdb.h>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include "../common/core.hpp"
+#include "../common/cxxstdio.hpp"
#include "../common/db.hpp"
#include "../common/grfio.hpp"
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "atcommand.hpp"
#include "battle.hpp"
#include "chat.hpp"
#include "chrif.hpp"
#include "clif.hpp"
-#include "intif.hpp"
#include "itemdb.hpp"
#include "magic.hpp"
#include "mob.hpp"
diff --git a/src/map/map.hpp b/src/map/map.hpp
index 20423ba..32194c0 100644
--- a/src/map/map.hpp
+++ b/src/map/map.hpp
@@ -4,14 +4,10 @@
#include "map.t.hpp"
#include <netinet/in.h>
-#include <sys/time.h>
-#include <cstdio>
-#include <ctime>
+#include <functional>
-#include "../common/cxxstdio.hpp"
#include "../common/db.hpp"
-#include "../common/mmo.hpp"
#include "../common/timer.hpp"
#include "battle.t.hpp"
@@ -686,12 +682,11 @@ void map_log(const_string line);
void map_clearflooritem_timer(timer_id, tick_t, custom_id_t, custom_data_t);
#define map_clearflooritem(id) map_clearflooritem_timer(0,0,id,1)
int map_addflooritem_any(struct item *, int amount, int m, int x, int y,
- struct map_session_data **owners,
- int *owner_protection,
- int lifetime, int dispersal);
+ struct map_session_data **owners, int *owner_protection,
+ int lifetime, int dispersal);
int map_addflooritem(struct item *, int, int, int, int,
- struct map_session_data *, struct map_session_data *,
- struct map_session_data *, int);
+ struct map_session_data *, struct map_session_data *,
+ struct map_session_data *, int);
// キャラid=>キャラ名 変換関連
void map_addchariddb(int charid, const char *name);
@@ -713,10 +708,10 @@ int compare_item(struct item *a, struct item *b);
struct map_session_data *map_get_first_session(void);
struct map_session_data *map_get_last_session(void);
-struct map_session_data *map_get_next_session(struct map_session_data
- *current);
-struct map_session_data *map_get_prev_session(struct map_session_data
- *current);
+struct map_session_data *map_get_next_session(
+ struct map_session_data *current);
+struct map_session_data *map_get_prev_session(
+ struct map_session_data *current);
// gat関連
int map_getcell(int, int, int);
diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp
index 1745ba3..0776788 100644
--- a/src/map/map.t.hpp
+++ b/src/map/map.t.hpp
@@ -2,7 +2,7 @@
#define MAP_T_HPP
#include "../common/mmo.hpp"
-#include "../common/utils.hpp"
+#include "../common/utils2.hpp"
namespace e
{
diff --git a/src/map/mob.cpp b/src/map/mob.cpp
index 46bb71e..3158dc5 100644
--- a/src/map/mob.cpp
+++ b/src/map/mob.cpp
@@ -1,19 +1,16 @@
#include "mob.hpp"
#include <cmath>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include "../common/db.hpp"
+#include "../common/cxxstdio.hpp"
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "battle.hpp"
#include "clif.hpp"
-#include "intif.hpp"
#include "itemdb.hpp"
#include "map.hpp"
#include "npc.hpp"
diff --git a/src/map/mob.hpp b/src/map/mob.hpp
index 357c4fa..8247102 100644
--- a/src/map/mob.hpp
+++ b/src/map/mob.hpp
@@ -3,6 +3,7 @@
#include "mob.t.hpp"
+#include "../common/mmo.hpp"
#include "../common/timer.hpp"
#include "map.hpp"
@@ -61,15 +62,17 @@ extern struct mob_db mob_db[];
int mobdb_searchname(const char *str);
int mobdb_checkid(const int id);
-int mob_once_spawn(struct map_session_data *sd, const char *mapname,
- int x, int y, const char *mobname, int class_, int amount,
- const char *event);
-int mob_once_spawn_area(struct map_session_data *sd, const char *mapname, int x0,
- int y0, int x1, int y1, const char *mobname,
- int class_, int amount, const char *event);
-
-int mob_spawn_guardian(struct map_session_data *sd, const char *mapname, // Spawning Guardians [Valaris]
- int x, int y, const char *mobname, int class_, int amount, const char *event, int guardian); // Spawning Guardians [Valaris]
+int mob_once_spawn(struct map_session_data *sd,
+ const char *mapname, int x, int y,
+ const char *mobname, int class_, int amount, const char *event);
+int mob_once_spawn_area(struct map_session_data *sd,
+ const char *mapname, int x0, int y0, int x1, int y1,
+ const char *mobname, int class_, int amount, const char *event);
+
+int mob_spawn_guardian(struct map_session_data *sd,
+ const char *mapname, int x, int y,
+ const char *mobname, int class_, int amount,
+ const char *event, int guardian); // Spawning Guardians [Valaris]
int mob_target(struct mob_data *md, struct block_list *bl, int dist);
int mob_stop_walking(struct mob_data *md, int type);
diff --git a/src/map/npc.cpp b/src/map/npc.cpp
index 1d10855..c6cab1d 100644
--- a/src/map/npc.cpp
+++ b/src/map/npc.cpp
@@ -1,20 +1,16 @@
#include "npc.hpp"
-#include <cctype>
-#include <cmath>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
+#include "../common/cxxstdio.hpp"
#include "../common/db.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "battle.hpp"
#include "clif.hpp"
-#include "intif.hpp"
#include "itemdb.hpp"
#include "map.hpp"
#include "mob.hpp"
diff --git a/src/map/npc.hpp b/src/map/npc.hpp
index 52758d4..9af2721 100644
--- a/src/map/npc.hpp
+++ b/src/map/npc.hpp
@@ -1,7 +1,7 @@
#ifndef NPC_HPP
#define NPC_HPP
-#include "../common/timer.hpp"
+#include <cstdint>
#define START_NPC_NUM 110000000
@@ -45,10 +45,10 @@ int npc_event_do_oninit(void);
int npc_do_ontimer(int, struct map_session_data *, int);
struct argrec;
-int npc_event_doall_l(const char *name, int rid, int argc,
- struct argrec *argv);
-int npc_event_do_l(const char *name, int rid, int argc,
- struct argrec *argv);
+int npc_event_doall_l(const char *name, int rid,
+ int argc, struct argrec *argv);
+int npc_event_do_l(const char *name, int rid,
+ int argc, struct argrec *argv);
#define npc_event_doall(name) npc_event_doall_l(name, 0, 0, NULL)
#define npc_event_do(name) npc_event_do_l(name, 0, 0, NULL)
diff --git a/src/map/party.cpp b/src/map/party.cpp
index 1b646de..609044a 100644
--- a/src/map/party.cpp
+++ b/src/map/party.cpp
@@ -1,9 +1,8 @@
#include "party.hpp"
-#include <cstdio>
-#include <cstdlib>
#include <cstring>
+#include "../common/cxxstdio.hpp"
#include "../common/db.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
@@ -14,7 +13,6 @@
#include "intif.hpp"
#include "map.hpp"
#include "pc.hpp"
-#include "skill.hpp"
#include "tmw.hpp"
#include "../poison.hpp"
diff --git a/src/map/party.hpp b/src/map/party.hpp
index 8dfd9b5..77e3aaf 100644
--- a/src/map/party.hpp
+++ b/src/map/party.hpp
@@ -18,17 +18,17 @@ int party_invite(struct map_session_data *sd, int account_id);
int party_member_added(int party_id, int account_id, int flag);
int party_leave(struct map_session_data *sd);
int party_removemember(struct map_session_data *sd, int account_id,
- const char *name);
+ const char *name);
int party_member_leaved(int party_id, int account_id, const char *name);
int party_reply_invite(struct map_session_data *sd, int account_id,
- int flag);
+ int flag);
int party_recv_noinfo(int party_id);
int party_recv_info(const struct party *sp);
-int party_recv_movemap(int party_id, int account_id, const char *map, int online,
- int lv);
+int party_recv_movemap(int party_id, int account_id, const char *map,
+ int online, int lv);
int party_broken(int party_id);
int party_optionchanged(int party_id, int account_id, int exp, int item,
- int flag);
+ int flag);
int party_changeoption(struct map_session_data *sd, int exp, int item);
int party_send_movemap(struct map_session_data *sd);
@@ -43,6 +43,6 @@ void party_send_hp_check(struct block_list *bl, int party_id, int *flag);
int party_exp_share(struct party *p, int map, int base_exp, int job_exp);
void party_foreachsamemap(std::function<void(struct block_list *)> func,
- struct map_session_data *sd, int type);
+ struct map_session_data *sd, int type);
#endif // PARTY_HPP
diff --git a/src/map/path.cpp b/src/map/path.cpp
index 1a8b5b9..3766999 100644
--- a/src/map/path.cpp
+++ b/src/map/path.cpp
@@ -1,7 +1,4 @@
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-
+#include "../common/cxxstdio.hpp"
#include "../common/nullpo.hpp"
#include "battle.hpp"
diff --git a/src/map/pc.cpp b/src/map/pc.cpp
index c25392a..118aa1f 100644
--- a/src/map/pc.cpp
+++ b/src/map/pc.cpp
@@ -1,16 +1,12 @@
#include "pc.hpp"
-#include <cctype>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
-#include <ctime>
-#include "../common/db.hpp"
+#include "../common/cxxstdio.hpp"
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "atcommand.hpp"
#include "battle.hpp"
@@ -19,6 +15,7 @@
#include "clif.hpp"
#include "intif.hpp"
#include "itemdb.hpp"
+#include "magic.hpp"
#include "map.hpp"
#include "mob.hpp"
#include "npc.hpp"
@@ -215,7 +212,6 @@ earray<EPOS, EQUIP, EQUIP::COUNT> equip_pos //=
EPOS::ARROW,
}};
-//static struct dbt *gm_account_db;
static
struct gm_account *gm_account = NULL;
static
@@ -237,16 +233,10 @@ void pc_setdead(struct map_session_data *sd)
int pc_isGM(struct map_session_data *sd)
{
-// struct gm_account *p;
int i;
nullpo_ret(sd);
-/* p = numdb_search(gm_account_db, sd->status.account_id);
- if (p == NULL)
- return 0;
- return p->level;*/
-
for (i = 0; i < GM_num; i++)
if (gm_account[i].account_id == sd->status.account_id)
return gm_account[i].level;
@@ -6885,8 +6875,6 @@ int do_init_pc(void)
{
pc_calc_sigma();
-// gm_account_db = numdb_init();
-
add_timer_interval((natural_heal_prev_tick =
gettick() + NATURAL_HEAL_INTERVAL), pc_natural_heal,
0, 0, NATURAL_HEAL_INTERVAL);
diff --git a/src/map/pc.hpp b/src/map/pc.hpp
index a775385..6670293 100644
--- a/src/map/pc.hpp
+++ b/src/map/pc.hpp
@@ -47,8 +47,9 @@ bool pc_is90overweight(struct map_session_data *sd)
return sd->weight*10 >= sd->max_weight*9;
}
-void pc_touch_all_relevant_npcs(struct map_session_data *sd); /* Checks all npcs/warps at the same location to see whether they
- ** should do something with the specified player. */
+// Checks all npcs/warps at the same location to see whether they
+// should do something with the specified player.
+void pc_touch_all_relevant_npcs(struct map_session_data *sd);
int pc_isGM(struct map_session_data *sd);
int pc_iskiller(struct map_session_data *src, struct map_session_data *target); // [MouseJstr]
@@ -86,8 +87,8 @@ int pc_getzeny(struct map_session_data *, int);
int pc_delitem(struct map_session_data *, int, int, int);
int pc_checkitem(struct map_session_data *);
int pc_count_all_items(struct map_session_data *player, int item_id);
-int pc_remove_items(struct map_session_data *player, int item_id,
- int count);
+int pc_remove_items(struct map_session_data *player,
+ int item_id, int count);
int pc_takeitem(struct map_session_data *, struct flooritem_data *);
int pc_dropitem(struct map_session_data *, int, int);
@@ -147,17 +148,17 @@ int pc_readaccountreg2(struct map_session_data *, const char *);
int pc_setaccountreg2(struct map_session_data *, const char *, int);
int pc_addeventtimer(struct map_session_data *sd, int tick,
- const char *name);
+ const char *name);
int pc_deleventtimer(struct map_session_data *sd, const char *name);
int pc_cleareventtimer(struct map_session_data *sd);
int pc_addeventtimercount(struct map_session_data *sd, const char *name,
- int tick);
+ int tick);
int pc_calc_pvprank(struct map_session_data *sd);
void pc_calc_pvprank_timer(timer_id, tick_t, custom_id_t, custom_data_t);
int pc_marriage(struct map_session_data *sd,
- struct map_session_data *dstsd);
+ struct map_session_data *dstsd);
int pc_divorce(struct map_session_data *sd);
struct map_session_data *pc_get_partner(struct map_session_data *sd);
int pc_set_gm_level(int account_id, int level);
diff --git a/src/map/script.cpp b/src/map/script.cpp
index 093ced9..4304640 100644
--- a/src/map/script.cpp
+++ b/src/map/script.cpp
@@ -1,31 +1,28 @@
#include "script.hpp"
-#include <sys/time.h>
-
-#include <cassert>
#include <cctype>
#include <cmath>
-#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
+#include "../common/cxxstdio.hpp"
#include "../common/db.hpp"
#include "../common/extract.hpp"
#include "../common/lock.hpp"
#include "../common/mt_rand.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
+#include "../common/utils.hpp"
#include "atcommand.hpp"
#include "battle.hpp"
-#include "chat.hpp"
#include "chrif.hpp"
#include "clif.hpp"
#include "intif.hpp"
#include "itemdb.hpp"
+#include "magic.hpp"
#include "map.hpp"
#include "mob.hpp"
#include "npc.hpp"
@@ -211,6 +208,7 @@ int add_str(const char *p)
int i;
char *lowcase;
+ // TODO remove lowcase
lowcase = strdup(p);
for (i = 0; lowcase[i]; i++)
lowcase[i] = tolower(lowcase[i]);
diff --git a/src/map/skill-pools.cpp b/src/map/skill-pools.cpp
index 6f2db8a..78d3f34 100644
--- a/src/map/skill-pools.cpp
+++ b/src/map/skill-pools.cpp
@@ -1,25 +1,9 @@
#include "skill.hpp"
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <ctime>
-
-#include "../common/mt_rand.hpp"
-#include "../common/nullpo.hpp"
-#include "../common/socket.hpp"
-#include "../common/timer.hpp"
+#include "../common/cxxstdio.hpp"
#include "battle.hpp"
-#include "clif.hpp"
-#include "intif.hpp"
-#include "itemdb.hpp"
-#include "magic.hpp"
-#include "map.hpp"
-#include "mob.hpp"
-#include "party.hpp"
#include "pc.hpp"
-#include "script.hpp"
#include "../poison.hpp"
diff --git a/src/map/skill.cpp b/src/map/skill.cpp
index 68ceaff..c07cfca 100644
--- a/src/map/skill.cpp
+++ b/src/map/skill.cpp
@@ -1,25 +1,20 @@
#include "skill.hpp"
-#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
+#include "../common/cxxstdio.hpp"
#include "../common/mt_rand.hpp"
#include "../common/nullpo.hpp"
#include "../common/socket.hpp"
-#include "../common/timer.hpp"
#include "battle.hpp"
#include "clif.hpp"
-#include "intif.hpp"
-#include "itemdb.hpp"
#include "magic.hpp"
#include "map.hpp"
#include "mob.hpp"
-#include "party.hpp"
#include "pc.hpp"
-#include "script.hpp"
#include "../poison.hpp"
diff --git a/src/map/skill.hpp b/src/map/skill.hpp
index e5bae65..7c870a3 100644
--- a/src/map/skill.hpp
+++ b/src/map/skill.hpp
@@ -3,10 +3,7 @@
#include "skill.t.hpp"
-#include "../common/timer.hpp"
-
#include "map.hpp"
-#include "magic.hpp"
#define MAX_SKILL_PRODUCE_DB 150
#define MAX_SKILL_ARROW_DB 150
@@ -80,23 +77,23 @@ int skill_get_blewcount(SkillID id, int lv);
int skill_use_id(struct map_session_data *sd, int target_id,
SkillID skill_num, int skill_lv);
int skill_use_pos(struct map_session_data *sd,
- int skill_x, int skill_y, SkillID skill_num, int skill_lv);
+ int skill_x, int skill_y, SkillID skill_num, int skill_lv);
int skill_castend_map(struct map_session_data *sd, SkillID skill_num,
- const char *map);
+ const char *map);
int skill_cleartimerskill(struct block_list *src);
// 追加効果
int skill_additional_effect(struct block_list *src, struct block_list *bl,
- SkillID skillid, int skilllv, BF attack_type,
- unsigned int tick);
+ SkillID skillid, int skilllv, BF attack_type,
+ unsigned int tick);
int skill_delunit(struct skill_unit *unit);
int skill_clear_unitgroup(struct block_list *src);
int skill_unit_ondamaged(struct skill_unit *src, struct block_list *bl,
- int damage, unsigned int tick);
+ int damage, unsigned int tick);
int skill_castfix(struct block_list *bl, int time);
int skill_delayfix(struct block_list *bl, int time);
@@ -104,8 +101,8 @@ int skill_check_unit_range(int m, int x, int y, int range, SkillID skillid);
int skill_check_unit_range2(int m, int x, int y, int range);
int skill_unit_out_all(struct block_list *bl, unsigned int tick, int range);
int skill_unit_move(struct block_list *bl, unsigned int tick, int range);
-int skill_unit_move_unit_group(struct skill_unit_group *group, int m,
- int dx, int dy);
+int skill_unit_move_unit_group(struct skill_unit_group *group,
+ int m, int dx, int dy);
void skill_stop_dancing(struct block_list *src, int flag);
diff --git a/src/map/skill.t.hpp b/src/map/skill.t.hpp
index 0bdee8f..36090d5 100644
--- a/src/map/skill.t.hpp
+++ b/src/map/skill.t.hpp
@@ -3,7 +3,7 @@
#include <cstdint>
-#include "../common/utils.hpp"
+#include "../common/utils2.hpp"
// TODO remove most of these as their corresponding SkillIDs get deleted.
enum class StatusChange : uint16_t
diff --git a/src/map/storage.cpp b/src/map/storage.cpp
index 151c8b4..0f3cd10 100644
--- a/src/map/storage.cpp
+++ b/src/map/storage.cpp
@@ -3,19 +3,17 @@
#include "storage.hpp"
-#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "../common/db.hpp"
#include "../common/nullpo.hpp"
-#include "atcommand.hpp"
-#include "battle.hpp"
#include "chrif.hpp"
#include "clif.hpp"
#include "intif.hpp"
#include "itemdb.hpp"
+#include "map.hpp"
#include "pc.hpp"
#include "../poison.hpp"
diff --git a/src/map/storage.hpp b/src/map/storage.hpp
index 6dd2178..9daa446 100644
--- a/src/map/storage.hpp
+++ b/src/map/storage.hpp
@@ -4,8 +4,6 @@
#ifndef STORAGE_HPP
#define STORAGE_HPP
-#include "../common/mmo.hpp"
-
int storage_storageopen(struct map_session_data *sd);
int storage_storageadd(struct map_session_data *sd, int index, int amount);
int storage_storageget(struct map_session_data *sd, int index, int amount);
diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp
index 84c84ef..0229f17 100644
--- a/src/map/tmw.cpp
+++ b/src/map/tmw.cpp
@@ -3,28 +3,16 @@
#include <cctype>
#include <cstring>
+#include "../common/cxxstdio.hpp"
#include "../common/nullpo.hpp"
-#include "../common/socket.hpp"
-#include "../common/timer.hpp"
-#include "../common/version.hpp"
#include "atcommand.hpp"
#include "battle.hpp"
-#include "chat.hpp"
#include "chrif.hpp"
#include "clif.hpp"
#include "intif.hpp"
-#include "itemdb.hpp"
-#include "magic.hpp"
#include "map.hpp"
-#include "mob.hpp"
-#include "npc.hpp"
-#include "party.hpp"
#include "pc.hpp"
-#include "script.hpp"
-#include "skill.hpp"
-#include "storage.hpp"
-#include "trade.hpp"
#include "../poison.hpp"
diff --git a/src/map/tmw.hpp b/src/map/tmw.hpp
index a5b198c..d64f45e 100644
--- a/src/map/tmw.hpp
+++ b/src/map/tmw.hpp
@@ -1,7 +1,7 @@
#ifndef TMW_HPP
#define TMW_HPP
-#include "map.hpp"
+#include "../common/const_array.hpp"
int tmw_CheckChatSpam(struct map_session_data *sd, const char *message);
void tmw_GmHackMsg(const_string line);
diff --git a/src/map/trade.cpp b/src/map/trade.cpp
index 8881ea1..b255298 100644
--- a/src/map/trade.cpp
+++ b/src/map/trade.cpp
@@ -1,8 +1,6 @@
#include "trade.hpp"
-#include <cstdio>
-#include <cstring>
-
+#include "../common/cxxstdio.hpp"
#include "../common/nullpo.hpp"
#include "battle.hpp"
diff --git a/src/map/trade.hpp b/src/map/trade.hpp
index a05981f..0edca9c 100644
--- a/src/map/trade.hpp
+++ b/src/map/trade.hpp
@@ -1,8 +1,6 @@
#ifndef TRADE_HPP
#define TRADE_HPP
-#include "map.hpp"
-
void trade_traderequest(struct map_session_data *sd, int target_id);
void trade_tradeack(struct map_session_data *sd, int type);
void trade_tradeadditem(struct map_session_data *sd, int index, int amount);