diff options
Diffstat (limited to 'src/map')
50 files changed, 188 insertions, 151 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 3cfeb42..2f08627 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -20,10 +20,10 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cmath> -#include <cstring> #include <ctime> +#include <algorithm> + #include "../conf/version.hpp" #include "../compat/nullpo.hpp" @@ -35,6 +35,7 @@ #include "../strings/xstring.hpp" #include "../strings/vstring.hpp" +#include "../generic/db.hpp" #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" @@ -45,9 +46,11 @@ #include "../mmo/core.hpp" #include "../mmo/extract.hpp" #include "../mmo/human_time_diff.hpp" +#include "../mmo/ids.hpp" #include "../mmo/mmo.hpp" #include "../mmo/socket.hpp" #include "../mmo/timer.hpp" +#include "../mmo/utils.hpp" #include "../mmo/version.hpp" #include "battle.hpp" @@ -60,7 +63,6 @@ #include "npc.hpp" #include "party.hpp" #include "pc.hpp" -#include "script.hpp" #include "skill.hpp" #include "storage.hpp" #include "tmw.hpp" diff --git a/src/map/atcommand.hpp b/src/map/atcommand.hpp index df3448b..0a24163 100644 --- a/src/map/atcommand.hpp +++ b/src/map/atcommand.hpp @@ -25,7 +25,8 @@ # include "../strings/fwd.hpp" -# include "map.hpp" +# include "../mmo/fwd.hpp" +# include "../mmo/dumb_ptr.hpp" bool is_atcommand(Session *s, dumb_ptr<map_session_data> sd, ZString message, GmLevel gmlvl); diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 09910c6..02f5bdc 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -21,13 +21,13 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cstring> +#include <algorithm> -#include "../compat/alg.hpp" #include "../compat/nullpo.hpp" #include "../strings/astring.hpp" #include "../strings/zstring.hpp" +#include "../strings/xstring.hpp" #include "../generic/random.hpp" diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 94d0b45..6e73e70 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -27,6 +27,7 @@ # include "../strings/fwd.hpp" +# include "../mmo/dumb_ptr.hpp" # include "../mmo/timer.t.hpp" # include "magic-interpreter.t.hpp" @@ -44,10 +45,6 @@ struct Damage ATK dmg_lv; }; -struct map_session_data; -struct mob_data; -struct block_list; - // ダメージ計算 struct Damage battle_calc_attack(BF attack_type, diff --git a/src/map/battle.t.hpp b/src/map/battle.t.hpp index 45d75b8..d0d3389 100644 --- a/src/map/battle.t.hpp +++ b/src/map/battle.t.hpp @@ -23,6 +23,8 @@ # include "fwd.hpp" +# include <cstdint> + # include "../generic/enum.hpp" namespace e diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 3c2ac63..50c62a8 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -20,10 +20,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <arpa/inet.h> - -#include <cstring> - #include "../compat/fun.hpp" #include "../compat/nullpo.hpp" @@ -32,6 +28,9 @@ #include "../io/cxxstdio.hpp" +#include "../mmo/human_time_diff.hpp" +#include "../mmo/ip.hpp" +#include "../mmo/mmo.hpp" #include "../mmo/socket.hpp" #include "../mmo/timer.hpp" #include "../mmo/utils.hpp" diff --git a/src/map/chrif.hpp b/src/map/chrif.hpp index f3fc152..7ac16e5 100644 --- a/src/map/chrif.hpp +++ b/src/map/chrif.hpp @@ -25,11 +25,8 @@ # include "../strings/fwd.hpp" +# include "../mmo/fwd.hpp" # include "../mmo/dumb_ptr.hpp" -# include "../mmo/human_time_diff.hpp" -# include "../mmo/ip.hpp" - -# include "map.hpp" void chrif_setuserid(AccountName); void chrif_setpasswd(AccountPass); diff --git a/src/map/clif.cpp b/src/map/clif.cpp index bdb8609..b19c7eb 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -20,13 +20,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <arpa/inet.h> - -#include <cstdlib> -#include <cstring> +#include <cassert> #include <ctime> -#include "../compat/alg.hpp" +#include <algorithm> + #include "../compat/attr.hpp" #include "../compat/fun.hpp" #include "../compat/nullpo.hpp" @@ -37,14 +35,14 @@ #include "../strings/zstring.hpp" #include "../strings/xstring.hpp" -#include "../generic/random.hpp" - #include "../io/cxxstdio.hpp" #include "../io/write.hpp" +#include "../mmo/ip.hpp" #include "../mmo/md5more.hpp" #include "../mmo/socket.hpp" #include "../mmo/timer.hpp" +#include "../mmo/utils.hpp" #include "../mmo/version.hpp" #include "atcommand.hpp" diff --git a/src/map/clif.hpp b/src/map/clif.hpp index cb84ee9..19d5fd3 100644 --- a/src/map/clif.hpp +++ b/src/map/clif.hpp @@ -29,11 +29,13 @@ # include "../strings/fwd.hpp" -# include "../mmo/ip.hpp" +# include "../mmo/fwd.hpp" +# include "../mmo/dumb_ptr.hpp" +# include "../mmo/mmo.hpp" # include "../mmo/timer.t.hpp" # include "battle.t.hpp" -# include "map.hpp" +# include "map.t.hpp" # include "pc.t.hpp" # include "skill.t.hpp" diff --git a/src/map/fwd.hpp b/src/map/fwd.hpp index 9801f5c..b4ced2d 100644 --- a/src/map/fwd.hpp +++ b/src/map/fwd.hpp @@ -22,6 +22,30 @@ # include "../sanity.hpp" // meh, add more when I feel like it +class BlockId; +struct block_list; struct map_session_data; +struct npc_data; +struct mob_data; +struct flooritem_data; +struct invocation; +struct map_local; +class npc_data_script; +class npc_data_shop; +class npc_data_warp; +class npc_data_message; +struct NpcEvent; + +struct item_data; + +// magic +struct fun_t; +struct op_t; +struct expr_t; +struct val_t; +struct location_t; +struct area_t; +struct spell_t; +struct invocation; #endif // TMWA_MAP_FWD_HPP diff --git a/src/map/grfio.cpp b/src/map/grfio.cpp index b03456c..c5ca9a1 100644 --- a/src/map/grfio.cpp +++ b/src/map/grfio.cpp @@ -20,25 +20,23 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <sys/stat.h> - #include <fcntl.h> #include <unistd.h> #include <cassert> -#include <cstdio> -#include <cstring> #include <map> #include "../strings/mstring.hpp" #include "../strings/rstring.hpp" #include "../strings/astring.hpp" +#include "../strings/zstring.hpp" #include "../io/cxxstdio.hpp" #include "../io/read.hpp" #include "../mmo/extract.hpp" +#include "../mmo/mmo.hpp" #include "../poison.hpp" diff --git a/src/map/grfio.hpp b/src/map/grfio.hpp index 3083f8c..d9329d3 100644 --- a/src/map/grfio.hpp +++ b/src/map/grfio.hpp @@ -27,7 +27,9 @@ # include <vector> -# include "../mmo/mmo.hpp" +# include "../strings/fwd.hpp" + +# include "../mmo/fwd.hpp" bool load_resnametable(ZString filename); diff --git a/src/map/intif.cpp b/src/map/intif.cpp index 52ea8b0..d0b1ea0 100644 --- a/src/map/intif.cpp +++ b/src/map/intif.cpp @@ -20,17 +20,16 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cstdlib> -#include <cstring> - #include "../compat/nullpo.hpp" #include "../strings/astring.hpp" #include "../strings/zstring.hpp" #include "../strings/xstring.hpp" +#include "../strings/literal.hpp" #include "../io/cxxstdio.hpp" +#include "../mmo/mmo.hpp" #include "../mmo/socket.hpp" #include "battle.hpp" diff --git a/src/map/intif.hpp b/src/map/intif.hpp index 529c42e..e05d00f 100644 --- a/src/map/intif.hpp +++ b/src/map/intif.hpp @@ -25,7 +25,8 @@ # include "../strings/fwd.hpp" -# include "map.hpp" +# include "../mmo/fwd.hpp" +# include "../mmo/dumb_ptr.hpp" int intif_parse(Session *); diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index 810c488..c88a201 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -20,24 +20,19 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cstdlib> -#include <cstring> - -#include "../compat/nullpo.hpp" +#include <algorithm> #include "../strings/astring.hpp" #include "../strings/zstring.hpp" #include "../strings/xstring.hpp" #include "../generic/db.hpp" -#include "../generic/random.hpp" #include "../io/cxxstdio.hpp" #include "../io/read.hpp" #include "../mmo/config_parse.hpp" #include "../mmo/extract.hpp" -#include "../mmo/socket.hpp" #include "../poison.hpp" diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index 06a4af9..1d132ad 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -23,6 +23,7 @@ # include "fwd.hpp" +# include "../mmo/ids.hpp" # include "../mmo/mmo.hpp" # include "map.t.hpp" diff --git a/src/map/magic-expr-eval.hpp b/src/map/magic-expr-eval.hpp index e19c896..ae86774 100644 --- a/src/map/magic-expr-eval.hpp +++ b/src/map/magic-expr-eval.hpp @@ -24,9 +24,10 @@ # include "../range/slice.hpp" +# include "../strings/fwd.hpp" # include "../strings/zstring.hpp" -# include "magic-interpreter.hpp" +# include "magic-interpreter.t.hpp" /* Helper definitions for dealing with functions and operations */ @@ -36,6 +37,7 @@ int magic_signature_check(ZString opname, ZString funname, ZString signature, void magic_area_rect(map_local **m, int *x, int *y, int *width, int *height, area_t& area); +// TODO kill this like I killed VAR # define ARGINT(x) args[x].v.v_int # define ARGDIR(x) args[x].v.v_dir # define ARGSTR(x) ZString(args[x].v.v_string) diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index 6a411b7..9f3f63e 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -22,24 +22,28 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <cassert> -#include <cmath> -#include "../compat/alg.hpp" +#include <algorithm> #include "../strings/mstring.hpp" #include "../strings/astring.hpp" #include "../strings/zstring.hpp" #include "../strings/vstring.hpp" +#include "../strings/literal.hpp" #include "../generic/random.hpp" #include "../io/cxxstdio.hpp" +#include "../mmo/dumb_ptr.hpp" + #include "battle.hpp" #include "npc.hpp" #include "pc.hpp" #include "itemdb.hpp" +#include "magic-interpreter.hpp" + #include "../poison.hpp" static diff --git a/src/map/magic-expr.hpp b/src/map/magic-expr.hpp index bbe8bbf..007491c 100644 --- a/src/map/magic-expr.hpp +++ b/src/map/magic-expr.hpp @@ -24,10 +24,12 @@ # include "magic-interpreter.hpp" -# include "../range/slice.hpp" +# include "../mmo/dumb_ptr.hpp" + +# include "../range/fwd.hpp" -# include "../strings/fwd.hpp" # include "../strings/zstring.hpp" +# include "../strings/literal.hpp" /* * Argument types: diff --git a/src/map/magic-interpreter-base.cpp b/src/map/magic-interpreter-base.cpp index 5d8aa35..a7c5496 100644 --- a/src/map/magic-interpreter-base.cpp +++ b/src/map/magic-interpreter-base.cpp @@ -1,4 +1,5 @@ #include "magic-interpreter-base.hpp" +#include "magic.hpp" // magic-interpreter-base.cpp - Core of the old magic system. // // Copyright © 2004-2011 The Mana World Development Team @@ -19,7 +20,8 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include "magic-interpreter-aux.hpp" +#include <algorithm> + #include "magic-interpreter.hpp" #include "../strings/astring.hpp" @@ -296,7 +298,7 @@ int spellguard_can_satisfy(spellguard_check_t *check, dumb_ptr<map_session_data> interval_t casttime = check->casttime; if (env->VAR(VAR_MIN_CASTTIME).ty == TYPE::INT) - casttime = max(casttime, static_cast<interval_t>(env->VAR(VAR_MIN_CASTTIME).v.v_int)); + casttime = std::max(casttime, static_cast<interval_t>(env->VAR(VAR_MIN_CASTTIME).v.v_int)); caster->cast_tick = tick + casttime; /* Make sure not to cast too frequently */ diff --git a/src/map/magic-interpreter.hpp b/src/map/magic-interpreter.hpp index 65c64e3..16fc447 100644 --- a/src/map/magic-interpreter.hpp +++ b/src/map/magic-interpreter.hpp @@ -26,23 +26,20 @@ # include <cassert> +# include <memory> + # include "../strings/fwd.hpp" # include "../strings/rstring.hpp" -# include "magic.hpp" +# include "../mmo/dumb_ptr.hpp" +# include "../mmo/ids.hpp" +# include "../mmo/timer.t.hpp" +# include "../mmo/utils.hpp" + # include "map.hpp" # include "script.hpp" # include "skill.t.hpp" -struct fun_t; -struct op_t; -struct expr_t; -struct val_t; -struct location_t; -struct area_t; -struct spell_t; -struct invocation; - struct location_t { map_local *m; @@ -319,8 +316,6 @@ struct magic_conf_t # define VAR_SCRIPTTARGET 7 # define VAR_LOCATION 8 -struct magic_config; - struct env_t { magic_conf_t *base_env; diff --git a/src/map/magic-stmt.cpp b/src/map/magic-stmt.cpp index 8e4751d..5710828 100644 --- a/src/map/magic-stmt.cpp +++ b/src/map/magic-stmt.cpp @@ -1,4 +1,5 @@ #include "magic-stmt.hpp" +#include "magic.hpp" // magic-stmt.cpp - Imperative commands for the magic backend. // // Copyright © 2004-2011 The Mana World Development Team @@ -35,7 +36,6 @@ #include "magic-expr.hpp" #include "magic-expr-eval.hpp" #include "magic-interpreter.hpp" -#include "magic-interpreter-aux.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/magic-v2.cpp b/src/map/magic-v2.cpp index 288e512..0239438 100644 --- a/src/map/magic-v2.cpp +++ b/src/map/magic-v2.cpp @@ -18,14 +18,25 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <cstddef> + +#include <algorithm> +#include <map> #include <set> +#include "../strings/rstring.hpp" +#include "../strings/literal.hpp" + +#include "../io/cxxstdio.hpp" +#include "../io/line.hpp" + #include "../sexpr/parser.hpp" #include "../mmo/dumb_ptr.hpp" #include "itemdb.hpp" #include "magic-expr.hpp" +#include "magic-interpreter.hpp" #include "../poison.hpp" diff --git a/src/map/magic.cpp b/src/map/magic.cpp index 4ca5c4f..fec8372 100644 --- a/src/map/magic.cpp +++ b/src/map/magic.cpp @@ -18,14 +18,18 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cstring> +#include <algorithm> +#include <utility> #include "../strings/xstring.hpp" #include "../io/cxxstdio.hpp" +#include "../mmo/dumb_ptr.hpp" + #include "magic-interpreter.hpp" +#include "map.hpp" #include "pc.hpp" #include "magic-expr.hpp" diff --git a/src/map/magic.hpp b/src/map/magic.hpp index 7a1a6e0..642ae21 100644 --- a/src/map/magic.hpp +++ b/src/map/magic.hpp @@ -26,11 +26,9 @@ # include "../mmo/dumb_ptr.hpp" -# include "map.hpp" +# include "map.t.hpp" # include "skill.t.hpp" -struct invocation; /* Spell invocation */ - /** * Try to cast magic. * diff --git a/src/map/main.cpp b/src/map/main.cpp index 2db1408..8354f1c 100644 --- a/src/map/main.cpp +++ b/src/map/main.cpp @@ -1,4 +1,3 @@ -#include "map.hpp" // map/main.cpp - dummy file to make Make dependencies work // // Copyright © 2013 Ben Longbons <b.r.longbons@gmail.com> @@ -18,4 +17,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. +#include "map.hpp" + #include "../poison.hpp" diff --git a/src/map/map.cpp b/src/map/map.cpp index 8ca0ba7..c98c315 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -29,7 +29,6 @@ #include <cassert> #include <cstdlib> -#include <cstring> #include "../compat/nullpo.hpp" #include "../compat/fun.hpp" @@ -40,6 +39,7 @@ #include "../strings/zstring.hpp" #include "../strings/xstring.hpp" #include "../strings/vstring.hpp" +#include "../strings/literal.hpp" #include "../generic/db.hpp" #include "../generic/random2.hpp" @@ -54,6 +54,7 @@ #include "../mmo/extract.hpp" #include "../mmo/socket.hpp" #include "../mmo/timer.hpp" +#include "../mmo/utils.hpp" #include "../mmo/version.hpp" #include "atcommand.hpp" @@ -63,7 +64,7 @@ #include "grfio.hpp" #include "itemdb.hpp" #include "magic.hpp" -#include "magic-interpreter.hpp" +#include "magic-interpreter.hpp" // for is_spell inline body #include "magic-v2.hpp" #include "mob.hpp" #include "npc.hpp" @@ -114,6 +115,10 @@ void SessionDeleter::operator()(SessionData *sd) really_delete1 static_cast<map_session_data *>(sd); } +VString<49> convert_for_printf(NpcEvent ev) +{ + return STRNPRINTF(50, "%s::%s"_fmt, ev.npc, ev.label); +} bool extract(XString str, NpcEvent *ev) { XString mid; diff --git a/src/map/map.hpp b/src/map/map.hpp index 620dc52..2bc8e45 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -25,8 +25,7 @@ # include "map.t.hpp" -# include <netinet/in.h> - +# include <chrono> # include <functional> # include <list> @@ -40,10 +39,9 @@ # include "../generic/db.hpp" # include "../generic/matrix.hpp" -# include "../io/cxxstdio.hpp" - # include "../mmo/socket.hpp" # include "../mmo/timer.t.hpp" +# include "../mmo/utils.hpp" # include "battle.t.hpp" # include "magic-interpreter.t.hpp" @@ -91,20 +89,10 @@ struct NpcEvent return l.npc < r.npc || (l.npc == r.npc && l.label < r.label); } - friend VString<49> convert_for_printf(NpcEvent ev) - { - return STRNPRINTF(50, "%s::%s"_fmt, ev.npc, ev.label); - } + friend VString<49> convert_for_printf(NpcEvent ev); }; bool extract(XString str, NpcEvent *ev); -struct map_session_data; -struct npc_data; -struct mob_data; -struct flooritem_data; -struct invocation; -struct map_local; - struct block_list { dumb_ptr<block_list> bl_next, bl_prev; @@ -146,11 +134,6 @@ struct status_change BlockId spell_invocation; /* [Fate] If triggered by a spell, record here */ }; -struct invocation; - -struct npc_data; -struct item_data; - struct quick_regeneration { // [Fate] int amount; // Amount of HP/SP left to regenerate @@ -358,14 +341,12 @@ struct npc_item_list int value; }; -class npc_data_script; -class npc_data_shop; -class npc_data_warp; -class npc_data_message; struct npc_data : block_list { NpcSubtype npc_subtype; short n; + // TODO This *should* be a Species, but the script files give -1 for + // event-only which is not valid unsigned short npc_class; DIR dir; interval_t speed; diff --git a/src/map/map.t.hpp b/src/map/map.t.hpp index d90bdab..10aeb75 100644 --- a/src/map/map.t.hpp +++ b/src/map/map.t.hpp @@ -23,8 +23,12 @@ # include "fwd.hpp" +# include <cstdint> + # include "../strings/vstring.hpp" +# include "../generic/enum.hpp" + # include "../mmo/ids.hpp" # include "../mmo/mmo.hpp" diff --git a/src/map/mapflag.hpp b/src/map/mapflag.hpp index c8eec1d..5e36055 100644 --- a/src/map/mapflag.hpp +++ b/src/map/mapflag.hpp @@ -21,9 +21,9 @@ # include "fwd.hpp" -# include "../mmo/extract.hpp" // TODO remove this (requires specializing the *other* half) +# include <cstdint> -# include "../strings/xstring.hpp" +# include "../mmo/extract.hpp" // TODO remove this (requires specializing the *other* half) // originally from script.cpp // These are part of the script API, so they can't change ever, diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 122fa98..923b369 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -23,8 +23,6 @@ #include <cassert> #include <cmath> -#include <cstdlib> -#include <cstring> #include <algorithm> @@ -32,6 +30,7 @@ #include "../compat/nullpo.hpp" #include "../strings/astring.hpp" +#include "../strings/zstring.hpp" #include "../strings/xstring.hpp" #include "../generic/random.hpp" diff --git a/src/map/mob.hpp b/src/map/mob.hpp index d39a2ac..48d7df5 100644 --- a/src/map/mob.hpp +++ b/src/map/mob.hpp @@ -26,10 +26,11 @@ # include "mob.t.hpp" # include "../generic/random.t.hpp" +# include "../generic/enum.hpp" -# include "../mmo/mmo.hpp" # include "../mmo/timer.t.hpp" +# include "battle.t.hpp" # include "clif.t.hpp" # include "map.hpp" # include "skill.t.hpp" diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 9f606de..32711d0 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -21,10 +21,9 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <cassert> -#include <cstdlib> -#include <cstring> #include <ctime> +#include <algorithm> #include <list> #include "../compat/fun.hpp" @@ -34,6 +33,7 @@ #include "../strings/astring.hpp" #include "../strings/zstring.hpp" #include "../strings/xstring.hpp" +#include "../strings/literal.hpp" #include "../generic/db.hpp" @@ -42,8 +42,8 @@ #include "../mmo/config_parse.hpp" #include "../mmo/extract.hpp" -#include "../mmo/socket.hpp" #include "../mmo/timer.hpp" +#include "../mmo/utils.hpp" #include "battle.hpp" #include "clif.hpp" diff --git a/src/map/npc.hpp b/src/map/npc.hpp index 3800fb7..d8930c8 100644 --- a/src/map/npc.hpp +++ b/src/map/npc.hpp @@ -23,7 +23,6 @@ # include "fwd.hpp" -# include <cstddef> # include <cstdint> # include "../strings/fwd.hpp" @@ -34,6 +33,7 @@ constexpr BlockId START_NPC_NUM = wrap<BlockId>(110000000); +// TODO make these species, see npc_class in npc_data constexpr int WARP_CLASS = 45; constexpr int WARP_DEBUG_CLASS = 722; constexpr int INVISIBLE_CLASS = 32767; diff --git a/src/map/party.cpp b/src/map/party.cpp index 7d3c89c..66dc2fa 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -21,8 +21,6 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cstring> - #include "../compat/nullpo.hpp" #include "../strings/xstring.hpp" @@ -31,7 +29,8 @@ #include "../io/cxxstdio.hpp" -#include "../mmo/socket.hpp" +#include "../mmo/ids.hpp" +#include "../mmo/mmo.hpp" #include "../mmo/timer.hpp" #include "battle.hpp" @@ -39,7 +38,6 @@ #include "intif.hpp" #include "map.hpp" #include "pc.hpp" -#include "tmw.hpp" #include "../poison.hpp" diff --git a/src/map/party.hpp b/src/map/party.hpp index bf9777b..4eaffb0 100644 --- a/src/map/party.hpp +++ b/src/map/party.hpp @@ -27,11 +27,8 @@ # include "../strings/fwd.hpp" -# include "map.hpp" - -struct party; -struct map_session_data; -struct block_list; +# include "../mmo/fwd.hpp" +# include "../mmo/dumb_ptr.hpp" void do_init_party(void); struct party *party_search(PartyId party_id); diff --git a/src/map/path.cpp b/src/map/path.cpp index 5b7ea1f..e0e18b6 100644 --- a/src/map/path.cpp +++ b/src/map/path.cpp @@ -22,19 +22,20 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <cassert> +#include <cstddef> +#include <cstdlib> #include "../compat/nullpo.hpp" -#include "../generic/random.hpp" +#include "../strings/literal.hpp" #include "../io/cxxstdio.hpp" -#include "battle.hpp" +#include "magic-interpreter.t.hpp" +#include "map.hpp" #include "../poison.hpp" -//#define PATH_STANDALONETEST - constexpr int MAX_HEAP = 150; struct tmp_path { diff --git a/src/map/path.hpp b/src/map/path.hpp index 9bdb520..5f03a90 100644 --- a/src/map/path.hpp +++ b/src/map/path.hpp @@ -23,8 +23,6 @@ # include "fwd.hpp" -# include "map.hpp" - int path_search(struct walkpath_data *, map_local *, int, int, int, int, int); #endif // TMWA_MAP_PATH_HPP diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 2526f1d..47e45a5 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -23,16 +23,16 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <cassert> -#include <cstdlib> -#include <cstring> -#include "../compat/alg.hpp" +#include <algorithm> + #include "../compat/fun.hpp" #include "../compat/nullpo.hpp" #include "../strings/rstring.hpp" #include "../strings/astring.hpp" #include "../strings/zstring.hpp" +#include "../strings/literal.hpp" #include "../generic/random.hpp" @@ -41,6 +41,7 @@ #include "../mmo/socket.hpp" #include "../mmo/timer.hpp" +#include "../mmo/utils.hpp" #include "atcommand.hpp" #include "battle.hpp" @@ -50,7 +51,6 @@ #include "itemdb.hpp" #include "magic.hpp" #include "map.hpp" -#include "mob.hpp" #include "npc.hpp" #include "party.hpp" #include "path.hpp" diff --git a/src/map/pc.hpp b/src/map/pc.hpp index b02e5a7..412953d 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -27,6 +27,8 @@ # include "../strings/fwd.hpp" +# include "../mmo/utils.hpp" + # include "clif.t.hpp" # include "map.hpp" diff --git a/src/map/script.cpp b/src/map/script.cpp index f3713df..7abea69 100644 --- a/src/map/script.cpp +++ b/src/map/script.cpp @@ -23,12 +23,11 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <cassert> -#include <cctype> #include <cmath> #include <cstdlib> -#include <cstring> #include <ctime> +#include <algorithm> #include <set> #include "../compat/fun.hpp" @@ -38,6 +37,7 @@ #include "../strings/astring.hpp" #include "../strings/zstring.hpp" #include "../strings/xstring.hpp" +#include "../strings/literal.hpp" #include "../generic/db.hpp" #include "../generic/intern-pool.hpp" @@ -46,13 +46,14 @@ #include "../io/cxxstdio.hpp" #include "../io/lock.hpp" #include "../io/read.hpp" +#include "../io/write.hpp" -#include "../mmo/config_parse.hpp" #include "../mmo/core.hpp" #include "../mmo/extract.hpp" +#include "../mmo/human_time_diff.hpp" #include "../mmo/socket.hpp" -#include "../mmo/utils.hpp" #include "../mmo/timer.hpp" +#include "../mmo/utils.hpp" #include "atcommand.hpp" #include "battle.hpp" diff --git a/src/map/script.hpp b/src/map/script.hpp index 9b9c805..11a9289 100644 --- a/src/map/script.hpp +++ b/src/map/script.hpp @@ -24,20 +24,16 @@ # include "fwd.hpp" # include <cstdint> -# include <cstring> // for inlined get_str - TODO remove # include <vector> # include "../range/slice.hpp" -# include "../strings/rstring.hpp" -# include "../strings/astring.hpp" # include "../strings/zstring.hpp" # include "../generic/db.hpp" # include "../mmo/dumb_ptr.hpp" -# include "../mmo/utils.hpp" # include "map.t.hpp" @@ -180,7 +176,6 @@ struct argrec_t int run_script_l(ScriptPointer, BlockId, BlockId, Slice<argrec_t> args); int run_script(ScriptPointer, BlockId, BlockId); -struct ScriptLabel; extern Map<ScriptLabel, int> scriptlabel_db; extern diff --git a/src/map/skill-pools.cpp b/src/map/skill-pools.cpp index 49496bb..9101d6a 100644 --- a/src/map/skill-pools.cpp +++ b/src/map/skill-pools.cpp @@ -1,3 +1,4 @@ +#include "skill-pools.hpp" #include "skill.hpp" // skill-pools.cpp - Additional support for focusable skills. // diff --git a/src/map/skill.cpp b/src/map/skill.cpp index f9eeff1..ab14427 100644 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -22,9 +22,8 @@ // along with this program. If not, see <http://www.gnu.org/licenses/>. #include <cassert> -#include <cstdlib> -#include <cstring> -#include <ctime> + +#include <algorithm> #include "../compat/attr.hpp" #include "../compat/fun.hpp" @@ -32,7 +31,10 @@ #include "../strings/mstring.hpp" #include "../strings/rstring.hpp" +#include "../strings/astring.hpp" +#include "../strings/zstring.hpp" #include "../strings/xstring.hpp" +#include "../strings/literal.hpp" #include "../generic/random.hpp" @@ -40,13 +42,11 @@ #include "../io/read.hpp" #include "../mmo/extract.hpp" -#include "../mmo/socket.hpp" #include "../mmo/timer.hpp" #include "battle.hpp" #include "clif.hpp" #include "magic.hpp" -#include "map.hpp" #include "mob.hpp" #include "pc.hpp" diff --git a/src/map/skill.hpp b/src/map/skill.hpp index 87cc576..3c162d5 100644 --- a/src/map/skill.hpp +++ b/src/map/skill.hpp @@ -28,7 +28,9 @@ # include "../strings/fwd.hpp" # include "../strings/rstring.hpp" -# include "../strings/astring.hpp" +# include "../strings/literal.hpp" + +# include "../generic/array.hpp" # include "map.hpp" @@ -76,9 +78,6 @@ extern struct skill_name_db skill_names[]; skill_name_db& skill_lookup_by_id(SkillID id); skill_name_db& skill_lookup_by_name(XString name); -struct block_list; -struct map_session_data; - bool skill_readdb(ZString filename); // スキルデータベースへのアクセサ diff --git a/src/map/storage.cpp b/src/map/storage.cpp index 41c31cc..b88c1ea 100644 --- a/src/map/storage.cpp +++ b/src/map/storage.cpp @@ -1,14 +1,32 @@ #include "storage.hpp" -// Copyright (c) Athena Dev Teams - Licensed under GNU GPL -// For more information, see COPYING in the main folder - -#include <cstdlib> -#include <cstring> +// storage.cpp - Storage handling. +// +// Copyright © ????-2004 Athena Dev Teams +// Copyright © 2004-2011 The Mana World Development Team +// Copyright © 2011-2014 Ben Longbons <b.r.longbons@gmail.com> +// +// This file is part of The Mana World (Athena server) +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see <http://www.gnu.org/licenses/>. #include "../compat/nullpo.hpp" #include "../generic/db.hpp" +#include "../mmo/ids.hpp" +#include "../mmo/mmo.hpp" + #include "chrif.hpp" #include "clif.hpp" #include "intif.hpp" diff --git a/src/map/storage.hpp b/src/map/storage.hpp index bdfc049..4101893 100644 --- a/src/map/storage.hpp +++ b/src/map/storage.hpp @@ -23,7 +23,8 @@ # include "fwd.hpp" -# include "map.hpp" +# include "../mmo/fwd.hpp" +# include "../mmo/dumb_ptr.hpp" int storage_storageopen(dumb_ptr<map_session_data> sd); int storage_storageadd(dumb_ptr<map_session_data> sd, int index, int amount); diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp index 8a1c9f7..38b96ce 100644 --- a/src/map/tmw.cpp +++ b/src/map/tmw.cpp @@ -19,17 +19,18 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -#include <cctype> -#include <cstring> - #include "../compat/nullpo.hpp" #include "../strings/astring.hpp" #include "../strings/zstring.hpp" #include "../strings/xstring.hpp" +#include "../strings/literal.hpp" #include "../io/cxxstdio.hpp" +#include "../mmo/human_time_diff.hpp" +#include "../mmo/utils.hpp" + #include "atcommand.hpp" #include "battle.hpp" #include "chrif.hpp" diff --git a/src/map/tmw.hpp b/src/map/tmw.hpp index 9b11d64..14bf8cc 100644 --- a/src/map/tmw.hpp +++ b/src/map/tmw.hpp @@ -26,8 +26,6 @@ # include "../mmo/dumb_ptr.hpp" -# include "map.hpp" - int tmw_CheckChatSpam(dumb_ptr<map_session_data> sd, XString message); void tmw_GmHackMsg(ZString line); diff --git a/src/map/trade.hpp b/src/map/trade.hpp index da0d2b2..1514999 100644 --- a/src/map/trade.hpp +++ b/src/map/trade.hpp @@ -23,7 +23,7 @@ # include "fwd.hpp" -# include "map.hpp" +# include "../mmo/dumb_ptr.hpp" void trade_traderequest(dumb_ptr<map_session_data> sd, BlockId target_id); void trade_tradeack(dumb_ptr<map_session_data> sd, int type); |