diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-06-06 17:50:58 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-06-06 17:50:58 +0200 |
commit | 33fb378b7605d34e73d9187cfb36aa8535b96cd0 (patch) | |
tree | 590aec101ad8aa055b90ddfb6bdc3b08a6715dc5 | |
parent | ecef2b6bf1e49a62acf4b9baf9a927835fa03e91 (diff) | |
download | tmwa-generate-code-out-of-tree.tar.gz tmwa-generate-code-out-of-tree.tar.bz2 tmwa-generate-code-out-of-tree.tar.xz tmwa-generate-code-out-of-tree.zip |
Generate code out of treegenerate-code-out-of-tree
59 files changed, 371 insertions, 285 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index d997b98..a2e3456 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,41 +35,25 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_STANDARD_REQUIRED ON) -# Some sources and includes are generated, such as the protocol headers. -# We defer to generate.make for these rules. -# Note that these are raw Makefile rules, not CMake rules, so a simple -# add_custom_command() won't work. -execute_process(COMMAND make -f ${CMAKE_SOURCE_DIR}/generate.mk - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) - -# The generate target must be re-run when the scripts change -set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS - "${PROJECT_SOURCE_DIR}/generate.mk" - "${PROJECT_SOURCE_DIR}/tools/config.py" - "${PROJECT_SOURCE_DIR}/tools/protocol.py" -) - # Search through the tree for sources # For each subfolder in src, add all .cpp files to a subfolder's SOURCES # variable. -set(ALL_SOURCES "") foreach(dir admin ast char compat conf generic high ints io login map mmo net proto-base range sexpr shared strings tests wire strtest) file(GLOB_RECURSE ${dir}_SOURCES CONFIGURE_DEPENDS src/${dir}/*.cpp) # Exclude any _test.cpp files from the build - set(ALL_SOURCES ${ALL_SOURCES} ${${dir}_SOURCES}) list(FILTER ${dir}_SOURCES EXCLUDE REGEX ".*_test.cpp") message("Adding sources in ${dir}: ${${dir}_SOURCES}") endforeach() -# All targets include the include/ directory -include_directories(include) +# All targets include the src/ and include/ directories +include_directories(src include) # We want -fvisibility=hidden for regular objects, but not shared libraries. # CMake provides a helpful preset for this. # FIXME this is currently broken #set(CMAKE_CXX_VISIBILITY_PRESET hidden) # General purpose build flags. -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fstack-protector -fno-strict-aliasing -flto") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -fstack-protector -fno-strict-aliasing -flto=auto") # Enable link time optimization, and track function and data sections. We let # the linker remove unused code. #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto -ffunction-sections -fdata-sections -Wl,--gc-sections") @@ -108,7 +92,91 @@ set(conf_SOURCES ${conf_SOURCES} src/conf/install.hpp src/conf/version.hpp) # And have the build search for files in the build directory. # Note that #includes with generated files should use a path relative to the # top level source or build directory. -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/src) + +set(generated_conf_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/src/admin/admin_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/admin/admin_conf.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/char/char_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/char/char_conf.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/char/char_lan_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/char/char_lan_conf.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/char/inter_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/char/inter_conf.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/login/login_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/login/login_conf.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/login/login_lan_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/login/login_lan_conf.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/map/battle_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/map/battle_conf.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/map/map_conf.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/map/map_conf.hpp) + +set(generated_proto_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/any-user.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/char-map.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/char-user.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/client-enum.hpp + # ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/client-packet-info.cpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/fwd.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/login-admin.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/login-char.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/login-user.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/map-user.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-AccountId.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-BeingRemoveWhy.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-BlockId.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-CharData.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-CharId.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-CharKey.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-CharSelect.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-ClientVersion.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-DamageType.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-DIR.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-EPOS.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-GlobalReg.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-HumanTimeDiff.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Item.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-ItemLook.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-ItemNameId.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-ItemType.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-LOOK.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Opt0.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Opt1.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Opt2.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Opt3.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-PartyId.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-PartyMember.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-PartyMost.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-PickupFail.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Point.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-SEX.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-SkillFlags.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-SkillID.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-SkillInfo.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-SkillValue.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Species.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-SP.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Stats6.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-StatusChange.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Storage.hpp + ${CMAKE_CURRENT_BINARY_DIR}/src/proto2/net-Version.hpp) + +add_custom_target(generate_code + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/admin + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/char + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/login + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/map + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/src/proto2 + COMMAND ${CMAKE_SOURCE_DIR}/tools/config.py + COMMAND ${CMAKE_SOURCE_DIR}/tools/protocol.py + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + BYPRODUCTS ${generated_conf_SOURCES} ${generated_proto_SOURCES} + COMMENT "Generating code..." + DEPENDS + ${CMAKE_SOURCE_DIR}/tools/config.py + ${CMAKE_SOURCE_DIR}/tools/protocol.py +) # Add a shared library: libtmwa-shared.so.0 # When we add_executable later, we need to link against this library. @@ -133,8 +201,11 @@ add_executable(tmwa-login ${login_SOURCES} ${mmo_SOURCES} ${net_SOURCES} ${wire_SOURCES} + ${generated_conf_SOURCES} + ${generated_proto_SOURCES} ) target_link_libraries(tmwa-login tmwa-shared) +add_dependencies(tmwa-login generate_code) add_executable(tmwa-char ${char_SOURCES} ${generic_SOURCES} @@ -143,8 +214,11 @@ add_executable(tmwa-char ${char_SOURCES} ${mmo_SOURCES} ${net_SOURCES} ${wire_SOURCES} + ${generated_conf_SOURCES} + ${generated_proto_SOURCES} ) target_link_libraries(tmwa-char tmwa-shared) +add_dependencies(tmwa-login generate_code) add_executable(tmwa-map ${map_SOURCES} ${ast_SOURCES} @@ -155,8 +229,11 @@ add_executable(tmwa-map ${map_SOURCES} ${mmo_SOURCES} ${net_SOURCES} ${wire_SOURCES} + ${generated_conf_SOURCES} + ${generated_proto_SOURCES} ) target_link_libraries(tmwa-map tmwa-shared) +add_dependencies(tmwa-login generate_code) add_executable(tmwa-admin ${admin_SOURCES} ${generic_SOURCES} @@ -165,11 +242,18 @@ add_executable(tmwa-admin ${admin_SOURCES} ${mmo_SOURCES} ${net_SOURCES} ${wire_SOURCES} + ${generated_conf_SOURCES} + ${generated_proto_SOURCES} ) target_link_libraries(tmwa-admin tmwa-shared) +add_dependencies(tmwa-login generate_code) -# TODO: Call make -f ${CMAKE_SOURCE_DIR}/generate.mk clean to clean up the +# Call 'make -f generate.mk clean' to clean up the # generated files. We want this to be run every time we call make clean. +add_custom_target(distclean + DEPENDS clean + COMMAND make -f generate.mk clean + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) # Install targets install(TARGETS tmwa-login tmwa-char tmwa-map tmwa-admin tmwa-shared diff --git a/Makefile.in b/Makefile.in index 56d9bce..db311df 100644 --- a/Makefile.in +++ b/Makefile.in @@ -478,10 +478,7 @@ clean: mostlyclean $l rm -rf bin lib distclean: clean gen-clean gen-clean: - $l rm -f stamp/generate*.stamp - $l rm -rf ${SRC_DIR}/src/proto2/ - $l rm -rf ${SRC_DIR}/src/debug-debug/ - $l rm -rf ${SRC_DIR}/src/*/*_conf.[ch]pp + make -f ${SRC_DIR}/generate.mk clean ifndef MAKE_RESTARTS obj/%.d: src/%.cpp | stamp/generated.stamp @@ -801,8 +798,8 @@ stamp/%.hpp.formatted: src/%.hpp tools/indenter apply-filter 'indenter -cpp' $< fgrep -q Copyright $< fgrep -q $(notdir $<) $< - if [[ $< == *fwd* ]]; then fgrep -q ../sanity.hpp $<; else fgrep -q '"fwd.hpp"' $<; fi - if [[ $< == *fwd* ]]; then ! fgrep -q '"fwd.hpp"' $<; else ! fgrep -q ../sanity.hpp $<; fi + if [[ $< == *fwd* ]]; then fgrep -q sanity.hpp $<; else fgrep -q '"fwd.hpp"' $<; fi + if [[ $< == *fwd* ]]; then ! fgrep -q '"fwd.hpp"' $<; else ! fgrep -q sanity.hpp $<; fi grep -q '^namespace tmwa$$' $< grep -q '^} // namespace tmwa$$' $< grep -q '^#pragma once$$' $< diff --git a/generate.mk b/generate.mk index c32ca8d..92220f2 100644 --- a/generate.mk +++ b/generate.mk @@ -40,3 +40,9 @@ stamp/generate-config.stamp: tools/config.py rm -f stamp/generated.stamp cd ${SRC_DIR} && config.py touch $@ + +clean: + $l rm -f stamp/generate*.stamp + $l rm -rf ${SRC_DIR}/src/proto2/ + $l rm -rf ${SRC_DIR}/src/debug-debug/ + $l rm -rf ${SRC_DIR}/src/*/*_conf.[ch]pp diff --git a/src/admin/fwd.hpp b/src/admin/fwd.hpp index 0beaf50..19bbe8f 100644 --- a/src/admin/fwd.hpp +++ b/src/admin/fwd.hpp @@ -18,13 +18,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 "../sanity.hpp" +#include "sanity.hpp" #include "../strings/fwd.hpp" // rank 1 #include "../io/fwd.hpp" // rank 4 #include "../net/fwd.hpp" // rank 5 #include "../mmo/fwd.hpp" // rank 6 -#include "../proto2/fwd.hpp" // rank 8 +#include "proto2/fwd.hpp" // rank 8 #include "../high/fwd.hpp" // rank 9 #include "../wire/fwd.hpp" // rank 9 // admin/fwd.hpp is rank ∞ because it is an executable diff --git a/src/admin/globals.cpp b/src/admin/globals.cpp index e61128a..5c53dd7 100644 --- a/src/admin/globals.cpp +++ b/src/admin/globals.cpp @@ -22,7 +22,7 @@ #include "../mmo/ids.hpp" -#include "admin_conf.hpp" +#include "admin/admin_conf.hpp" #include "../poison.hpp" diff --git a/src/admin/ladmin.cpp b/src/admin/ladmin.cpp index 240582b..710017b 100644 --- a/src/admin/ladmin.cpp +++ b/src/admin/ladmin.cpp @@ -44,8 +44,8 @@ #include "../net/ip.hpp" #include "../net/timestamp-utils.hpp" -#include "../proto2/any-user.hpp" -#include "../proto2/login-admin.hpp" +#include "proto2/any-user.hpp" +#include "proto2/login-admin.hpp" #include "../mmo/config_parse.hpp" #include "../mmo/human_time_diff.hpp" @@ -57,7 +57,7 @@ #include "../wire/packets.hpp" -#include "admin_conf.hpp" +#include "admin/admin_conf.hpp" #include "globals.hpp" #include "../poison.hpp" @@ -555,7 +555,7 @@ void display_help(ZString param) { PRINTF("getaccreg2/get/g <account id> <variable>\n"_fmt); PRINTF(" Display a login-stored ##register\n"_fmt); - } + } else if (command == "setaccreg2"_s || command == "set"_s || command == "s"_s) @@ -565,7 +565,7 @@ void display_help(ZString param) } else if (command == "delaccreg2"_s || command == "del"_s - || command == "d"_s) + || command == "d"_s) { PRINTF("delaccreg2/del/d <account id> <variable>\n"_fmt); PRINTF(" Delete a login-stored ##register\n"_fmt); diff --git a/src/admin/ladmin.hpp b/src/admin/ladmin.hpp index e37511f..38f2434 100644 --- a/src/admin/ladmin.hpp +++ b/src/admin/ladmin.hpp @@ -26,7 +26,7 @@ #include "../mmo/consts.hpp" #include "../mmo/enums.hpp" -#include "../proto2/net-GlobalReg.hpp" +#include "proto2/net-GlobalReg.hpp" namespace tmwa { diff --git a/src/ast/fwd.hpp b/src/ast/fwd.hpp index 24bf545..920ae70 100644 --- a/src/ast/fwd.hpp +++ b/src/ast/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../compat/fwd.hpp" // rank 2 #include "../io/fwd.hpp" // rank 4 diff --git a/src/char/char.cpp b/src/char/char.cpp index 7ffdd0f..c398e39 100644 --- a/src/char/char.cpp +++ b/src/char/char.cpp @@ -60,12 +60,12 @@ #include "../net/socket.hpp" #include "../net/timer.hpp" -#include "../proto2/any-user.hpp" -#include "../proto2/login-admin.hpp" -#include "../proto2/login-char.hpp" -#include "../proto2/login-user.hpp" -#include "../proto2/char-map.hpp" -#include "../proto2/char-user.hpp" +#include "proto2/any-user.hpp" +#include "proto2/login-admin.hpp" +#include "proto2/login-char.hpp" +#include "proto2/login-user.hpp" +#include "proto2/char-map.hpp" +#include "proto2/char-user.hpp" #include "../mmo/config_parse.hpp" #include "../mmo/cxxstdio_enums.hpp" @@ -80,11 +80,11 @@ #include "../wire/packets.hpp" -#include "char_conf.hpp" -#include "char_lan_conf.hpp" +#include "char/char_conf.hpp" +#include "char/char_lan_conf.hpp" #include "globals.hpp" -#include "inter.hpp" -#include "inter_conf.hpp" +#include "char/inter.hpp" +#include "char/inter_conf.hpp" #include "int_party.hpp" #include "int_storage.hpp" @@ -816,7 +816,7 @@ void create_online_files(void) if (!server_for(&cd)) continue; - + p = cd.data.get(); // failsafe diff --git a/src/char/fwd.hpp b/src/char/fwd.hpp index 8086083..3836576 100644 --- a/src/char/fwd.hpp +++ b/src/char/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../ints/fwd.hpp" // rank 1 #include "../strings/fwd.hpp" // rank 1 @@ -27,7 +27,7 @@ #include "../io/fwd.hpp" // rank 4 #include "../net/fwd.hpp" // rank 5 #include "../mmo/fwd.hpp" // rank 6 -#include "../proto2/fwd.hpp" // rank 8 +#include "proto2/fwd.hpp" // rank 8 #include "../high/fwd.hpp" // rank 9 #include "../wire/fwd.hpp" // rank 9 // char/fwd.hpp is rank ∞ because it is an executable diff --git a/src/char/globals.cpp b/src/char/globals.cpp index 6733ad5..bb81c34 100644 --- a/src/char/globals.cpp +++ b/src/char/globals.cpp @@ -22,13 +22,13 @@ #include "../generic/db.hpp" -#include "../proto2/net-Storage.hpp" +#include "proto2/net-Storage.hpp" #include "char.hpp" -#include "char_conf.hpp" -#include "char_lan_conf.hpp" +#include "char/char_conf.hpp" +#include "char/char_lan_conf.hpp" #include "inter.hpp" -#include "inter_conf.hpp" +#include "char/inter_conf.hpp" #include "../poison.hpp" diff --git a/src/char/int_party.cpp b/src/char/int_party.cpp index 7b2ecc2..98e5194 100644 --- a/src/char/int_party.cpp +++ b/src/char/int_party.cpp @@ -34,7 +34,7 @@ #include "../io/read.hpp" #include "../io/write.hpp" -#include "../proto2/char-map.hpp" +#include "proto2/char-map.hpp" #include "../mmo/ids.hpp" @@ -46,7 +46,7 @@ #include "char.hpp" #include "globals.hpp" #include "inter.hpp" -#include "inter_conf.hpp" +#include "char/inter_conf.hpp" #include "../poison.hpp" diff --git a/src/char/int_storage.cpp b/src/char/int_storage.cpp index 32af231..86d76e2 100644 --- a/src/char/int_storage.cpp +++ b/src/char/int_storage.cpp @@ -33,7 +33,7 @@ #include "../io/read.hpp" #include "../io/write.hpp" -#include "../proto2/char-map.hpp" +#include "proto2/char-map.hpp" #include "../mmo/cxxstdio_enums.hpp" @@ -43,7 +43,7 @@ #include "../wire/packets.hpp" #include "globals.hpp" -#include "inter_conf.hpp" +#include "char/inter_conf.hpp" #include "../poison.hpp" diff --git a/src/char/inter.cpp b/src/char/inter.cpp index 3f2d1aa..06b18db 100644 --- a/src/char/inter.cpp +++ b/src/char/inter.cpp @@ -42,7 +42,7 @@ #include "../mmo/config_parse.hpp" -#include "../proto2/char-map.hpp" +#include "proto2/char-map.hpp" #include "../high/extract_mmo.hpp" #include "../high/mmo.hpp" @@ -51,7 +51,7 @@ #include "char.hpp" #include "globals.hpp" -#include "inter_conf.hpp" +#include "char/inter_conf.hpp" #include "int_party.hpp" #include "int_storage.hpp" diff --git a/src/char/inter.hpp b/src/char/inter.hpp index c641254..4656639 100644 --- a/src/char/inter.hpp +++ b/src/char/inter.hpp @@ -27,7 +27,7 @@ #include "../mmo/consts.hpp" #include "../mmo/ids.hpp" -#include "../proto2/net-GlobalReg.hpp" +#include "proto2/net-GlobalReg.hpp" namespace tmwa diff --git a/src/compat/fwd.hpp b/src/compat/fwd.hpp index 3fa0dd2..63f810a 100644 --- a/src/compat/fwd.hpp +++ b/src/compat/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../ints/fwd.hpp" // rank 1 #include "../strings/fwd.hpp" // rank 1 diff --git a/src/generic/fwd.hpp b/src/generic/fwd.hpp index 31fb13a..2833ad5 100644 --- a/src/generic/fwd.hpp +++ b/src/generic/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../strings/fwd.hpp" // rank 1 #include "../compat/fwd.hpp" // rank 2 diff --git a/src/high/fwd.hpp b/src/high/fwd.hpp index 96875d3..79c6647 100644 --- a/src/high/fwd.hpp +++ b/src/high/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../range/fwd.hpp" // rank 1 #include "../strings/fwd.hpp" // rank 1 @@ -27,7 +27,7 @@ #include "../io/fwd.hpp" // rank 4 #include "../net/fwd.hpp" // rank 5 #include "../mmo/fwd.hpp" // rank 6 -#include "../proto2/fwd.hpp" // rank 8 +#include "proto2/fwd.hpp" // rank 8 // high/fwd.hpp is rank 9 diff --git a/src/high/mmo.hpp b/src/high/mmo.hpp index b5bcac8..998689b 100644 --- a/src/high/mmo.hpp +++ b/src/high/mmo.hpp @@ -25,10 +25,10 @@ #include "../compat/borrow.hpp" #include "../compat/memory.hpp" -#include "../proto2/net-CharData.hpp" -#include "../proto2/net-CharKey.hpp" -#include "../proto2/net-PartyMost.hpp" -#include "../proto2/net-SkillValue.hpp" +#include "proto2/net-CharData.hpp" +#include "proto2/net-CharKey.hpp" +#include "proto2/net-PartyMost.hpp" +#include "proto2/net-SkillValue.hpp" namespace tmwa diff --git a/src/ints/fwd.hpp b/src/ints/fwd.hpp index 536eba1..a40606a 100644 --- a/src/ints/fwd.hpp +++ b/src/ints/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" // ints/fwd.hpp is rank 1 diff --git a/src/io/fwd.hpp b/src/io/fwd.hpp index 3b9452b..7877b9c 100644 --- a/src/io/fwd.hpp +++ b/src/io/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../ints/fwd.hpp" // rank 1 #include "../strings/fwd.hpp" // rank 1 diff --git a/src/login/fwd.hpp b/src/login/fwd.hpp index 4de09f1..2cd576e 100644 --- a/src/login/fwd.hpp +++ b/src/login/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../ints/fwd.hpp" // rank 1 #include "../strings/fwd.hpp" // rank 1 @@ -27,7 +27,7 @@ #include "../io/fwd.hpp" // rank 4 #include "../net/fwd.hpp" // rank 5 #include "../mmo/fwd.hpp" // rank 6 -#include "../proto2/fwd.hpp" // rank 8 +#include "proto2/fwd.hpp" // rank 8 #include "../high/fwd.hpp" // rank 9 #include "../wire/fwd.hpp" // rank 9 // login/fwd.hpp is rank ∞ because it is an executable diff --git a/src/login/globals.cpp b/src/login/globals.cpp index 4df9eda..15bc293 100644 --- a/src/login/globals.cpp +++ b/src/login/globals.cpp @@ -22,8 +22,8 @@ #include "../generic/db.hpp" #include "login.hpp" -#include "login_conf.hpp" -#include "login_lan_conf.hpp" +#include "login/login_conf.hpp" +#include "login/login_lan_conf.hpp" #include "../poison.hpp" diff --git a/src/login/login.cpp b/src/login/login.cpp index e4c1197..2b9ba9d 100644 --- a/src/login/login.cpp +++ b/src/login/login.cpp @@ -60,10 +60,10 @@ #include "../mmo/ids.hpp" #include "../mmo/version.hpp" -#include "../proto2/any-user.hpp" -#include "../proto2/login-admin.hpp" -#include "../proto2/login-char.hpp" -#include "../proto2/login-user.hpp" +#include "proto2/any-user.hpp" +#include "proto2/login-admin.hpp" +#include "proto2/login-char.hpp" +#include "proto2/login-user.hpp" #include "../high/core.hpp" #include "../high/extract_mmo.hpp" @@ -74,8 +74,8 @@ #include "../wire/packets.hpp" #include "globals.hpp" -#include "login_conf.hpp" -#include "login_lan_conf.hpp" +#include "login/login_conf.hpp" +#include "login/login_lan_conf.hpp" #include "../poison.hpp" @@ -863,7 +863,7 @@ static void parse_fromchar(Session *s) { IP4Address ip = s->client_ip; - + int id; for (id = 0; id < MAX_SERVERS; id++) if (server_session[id] == s) @@ -2430,7 +2430,7 @@ void parse_admin(Session *s) { //add var ad.account_reg2[ad.account_reg2_num].str = fixed.name; - ad.account_reg2[ad.account_reg2_num].value = fixed.value; + ad.account_reg2[ad.account_reg2_num].value = fixed.value; ++ad.account_reg2_num; fixed_5b.result = 1; goto x795a_update; diff --git a/src/login/login.hpp b/src/login/login.hpp index 05a02b4..592d6f7 100644 --- a/src/login/login.hpp +++ b/src/login/login.hpp @@ -34,7 +34,7 @@ #include "../mmo/ids.hpp" #include "../mmo/strs.hpp" -#include "../proto2/net-GlobalReg.hpp" +#include "proto2/net-GlobalReg.hpp" #include "../high/mmo.hpp" diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 346b0ac..3f571fa 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -63,14 +63,14 @@ #include "../ast/npc.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "chrif.hpp" #include "clif.hpp" #include "globals.hpp" #include "intif.hpp" #include "itemdb.hpp" #include "map.hpp" -#include "map_conf.hpp" +#include "map/map_conf.hpp" #include "mob.hpp" #include "npc.hpp" #include "npc-parse.hpp" diff --git a/src/map/battle.cpp b/src/map/battle.cpp index b745e05..f1008cc 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -40,7 +40,7 @@ #include "../high/utils.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "itemdb.hpp" @@ -814,7 +814,7 @@ interval_t battle_get_adelay(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ interval_t battle_get_amotion(dumb_ptr<block_list> bl) @@ -845,7 +845,7 @@ interval_t battle_get_amotion(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ interval_t battle_get_dmotion(dumb_ptr<block_list> bl) @@ -864,7 +864,7 @@ interval_t battle_get_dmotion(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ LevelElement battle_get_element(dumb_ptr<block_list> bl) @@ -879,7 +879,7 @@ LevelElement battle_get_element(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ PartyId battle_get_party_id(dumb_ptr<block_list> bl) @@ -898,7 +898,7 @@ PartyId battle_get_party_id(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ Race battle_get_race(dumb_ptr<block_list> bl) @@ -913,7 +913,7 @@ Race battle_get_race(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ MobMode battle_get_mode(dumb_ptr<block_list> bl) @@ -926,7 +926,7 @@ MobMode battle_get_mode(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ int battle_get_stat(SP stat_id, dumb_ptr<block_list> bl) @@ -951,7 +951,7 @@ int battle_get_stat(SP stat_id, dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ // StatusChange系の所得 | StatusChange Income @@ -970,7 +970,7 @@ eptr<struct status_change, StatusChange, StatusChange::MAX_STATUSCHANGE> battle_ } /*========================================== - * + * *------------------------------------------ */ Opt1 *battle_get_opt1(dumb_ptr<block_list> bl) @@ -986,7 +986,7 @@ Opt1 *battle_get_opt1(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ Opt2 *battle_get_opt2(dumb_ptr<block_list> bl) @@ -1002,7 +1002,7 @@ Opt2 *battle_get_opt2(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ Opt3 *battle_get_opt3(dumb_ptr<block_list> bl) @@ -1018,7 +1018,7 @@ Opt3 *battle_get_opt3(dumb_ptr<block_list> bl) } /*========================================== - * + * *------------------------------------------ */ Opt0 *battle_get_option(dumb_ptr<block_list> bl) @@ -1036,7 +1036,7 @@ Opt0 *battle_get_option(dumb_ptr<block_list> bl) //------------------------------------------------------------------- /*========================================== - * + * *------------------------------------------ */ // ダメージの遅延 | damage delay @@ -1048,7 +1048,7 @@ struct battle_delay_damage_ }; /*========================================== - * + * *------------------------------------------ */ // 実際にHPを操作 | Actually operate HP @@ -1091,7 +1091,7 @@ int battle_damage(dumb_ptr<block_list> bl, dumb_ptr<block_list> target, } /*========================================== - * + * *------------------------------------------ */ int battle_heal(dumb_ptr<block_list> bl, dumb_ptr<block_list> target, int hp, @@ -1116,7 +1116,7 @@ int battle_heal(dumb_ptr<block_list> bl, dumb_ptr<block_list> target, int hp, } /*========================================== - * + * *------------------------------------------ */ // 攻撃停止 | stop attack @@ -1166,7 +1166,7 @@ int battle_calc_damage(dumb_ptr<block_list>, dumb_ptr<block_list> bl, } /*========================================== - * + * *------------------------------------------ */ static @@ -1423,7 +1423,7 @@ struct Damage battle_calc_mob_weapon_attack(dumb_ptr<block_list> src, } /*========================================== - * + * *------------------------------------------ */ int battle_is_unarmed(dumb_ptr<block_list> bl) @@ -1589,7 +1589,7 @@ struct Damage battle_calc_pc_weapon_attack(dumb_ptr<block_list> src, // ダブルアタックが発動していない | Double Attack is not activated // クリティカル計算 | critical calculation cri = battle_get_critical(src); - + if (sd->state.arrow_atk) cri += sd->arrow_cri; cri -= battle_get_luk(target) * 3; @@ -1601,7 +1601,7 @@ struct Damage battle_calc_pc_weapon_attack(dumb_ptr<block_list> src, cri = cri * (100 - tsd->critical_def) / 100; else if (tmd && tmd->stats[mob_stat::CRITICAL_DEF]) cri = cri * (100 - tmd->stats[mob_stat::CRITICAL_DEF]) / 100; - + // ダブルアタックが発動していない | Double Attack is not activated // 判定(スキルの場合は無視) | Judgment (ignored for skills) if (!da && skill_num == SkillID::ZERO && skill_lv >= 0 @@ -2176,7 +2176,7 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target, } /*========================================== - * + * *------------------------------------------ */ bool battle_check_undead(Race race, Element element) diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 52c311b..0a7ee07 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -33,7 +33,7 @@ #include "../net/timer.hpp" #include "../net/timestamp-utils.hpp" -#include "../proto2/char-map.hpp" +#include "proto2/char-map.hpp" #include "../mmo/human_time_diff.hpp" #include "../high/mmo.hpp" @@ -41,13 +41,13 @@ #include "../wire/packets.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "intif.hpp" #include "itemdb.hpp" #include "map.hpp" -#include "map_conf.hpp" +#include "map/map_conf.hpp" #include "npc.hpp" #include "pc.hpp" #include "storage.hpp" diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 9edf2af..ae5ef85 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -46,9 +46,9 @@ #include "../net/timer.hpp" #include "../net/timestamp-utils.hpp" -#include "../proto2/any-user.hpp" -#include "../proto2/char-map.hpp" -#include "../proto2/map-user.hpp" +#include "proto2/any-user.hpp" +#include "proto2/char-map.hpp" +#include "proto2/map-user.hpp" #include "../mmo/cxxstdio_enums.hpp" #include "../mmo/version.hpp" @@ -59,13 +59,13 @@ #include "atcommand.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "chrif.hpp" #include "globals.hpp" #include "intif.hpp" #include "itemdb.hpp" #include "map.hpp" -#include "map_conf.hpp" +#include "map/map_conf.hpp" #include "npc.hpp" #include "party.hpp" #include "pc.hpp" diff --git a/src/map/fwd.hpp b/src/map/fwd.hpp index fc6b284..8242de5 100644 --- a/src/map/fwd.hpp +++ b/src/map/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include <cstdint> @@ -31,7 +31,7 @@ #include "../net/fwd.hpp" // rank 5 #include "../sexpr/fwd.hpp" // rank 5 #include "../mmo/fwd.hpp" // rank 6 -#include "../proto2/fwd.hpp" // rank 8 +#include "proto2/fwd.hpp" // rank 8 #include "../high/fwd.hpp" // rank 9 #include "../wire/fwd.hpp" // rank 9 #include "../ast/fwd.hpp" // rank 10 diff --git a/src/map/globals.cpp b/src/map/globals.cpp index d2c1993..14708f8 100644 --- a/src/map/globals.cpp +++ b/src/map/globals.cpp @@ -22,12 +22,12 @@ #include "../io/write.hpp" -#include "../proto2/net-Storage.hpp" +#include "proto2/net-Storage.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "itemdb.hpp" #include "quest.hpp" -#include "map_conf.hpp" +#include "map/map_conf.hpp" #include "mob.hpp" #include "npc-internal.hpp" #include "script-parse-internal.hpp" diff --git a/src/map/intif.cpp b/src/map/intif.cpp index f64f797..9f4c38e 100644 --- a/src/map/intif.cpp +++ b/src/map/intif.cpp @@ -33,12 +33,12 @@ #include "../high/mmo.hpp" -#include "../proto2/char-map.hpp" +#include "proto2/char-map.hpp" #include "../wire/packets.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "chrif.hpp" #include "clif.hpp" #include "globals.hpp" diff --git a/src/map/map.cpp b/src/map/map.cpp index ff69a56..0895828 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -63,13 +63,13 @@ #include "atcommand.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "chrif.hpp" #include "clif.hpp" #include "globals.hpp" #include "grfio.hpp" #include "itemdb.hpp" -#include "map_conf.hpp" +#include "map/map_conf.hpp" #include "mob.hpp" #include "quest.hpp" #include "npc.hpp" diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 996e2bb..4c5b099 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -47,7 +47,7 @@ #include "../mmo/extract_enums.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "itemdb.hpp" @@ -347,7 +347,7 @@ int mob_gen_exp(mob_db_ *mob) } /*========================================== - * + * *------------------------------------------ */ static @@ -525,7 +525,7 @@ BlockId mob_once_spawn_area(dumb_ptr<map_session_data> sd, // TODO: deprecate these /*========================================== - * + * *------------------------------------------ */ short mob_get_hair(Species mob_class) @@ -534,7 +534,7 @@ short mob_get_hair(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ short mob_get_hair_color(Species mob_class) @@ -543,7 +543,7 @@ short mob_get_hair_color(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ short mob_get_weapon(Species mob_class) @@ -552,7 +552,7 @@ short mob_get_weapon(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ ItemNameId mob_get_shield(Species mob_class) @@ -561,7 +561,7 @@ ItemNameId mob_get_shield(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ ItemNameId mob_get_head_top(Species mob_class) @@ -570,7 +570,7 @@ ItemNameId mob_get_head_top(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ ItemNameId mob_get_head_mid(Species mob_class) @@ -579,7 +579,7 @@ ItemNameId mob_get_head_mid(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ ItemNameId mob_get_head_buttom(Species mob_class) @@ -588,7 +588,7 @@ ItemNameId mob_get_head_buttom(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ short mob_get_clothes_color(Species mob_class) // Add for player monster dye - Valaris @@ -597,7 +597,7 @@ short mob_get_clothes_color(Species mob_class) // Add for player monster dye - V } /*========================================== - * + * *------------------------------------------ */ int mob_get_equip(Species mob_class) // mob equip [Valaris] @@ -833,7 +833,7 @@ int mob_check_attack(dumb_ptr<mob_data> md) } /*========================================== - * + * *------------------------------------------ */ static @@ -1448,7 +1448,7 @@ int mob_target(dumb_ptr<mob_data> md, dumb_ptr<block_list> bl, int dist) } /*========================================== - * + * *------------------------------------------ */ int mob_aggravate(dumb_ptr<mob_data> md, dumb_ptr<block_list> bl) @@ -2354,7 +2354,7 @@ int mob_delete(dumb_ptr<mob_data> md) } /*========================================== - * + * *------------------------------------------ */ int mob_catch_delete(dumb_ptr<mob_data> md, BeingRemoveWhy type) @@ -2371,7 +2371,7 @@ int mob_catch_delete(dumb_ptr<mob_data> md, BeingRemoveWhy type) } /*========================================== - * + * *------------------------------------------ */ void mob_timer_delete(TimerData *, tick_t, BlockId id) @@ -2582,7 +2582,7 @@ int mob_damage(dumb_ptr<block_list> src, dumb_ptr<mob_data> md, int damage, if (src && src->bl_type == BL::MOB) mob_unlocktarget(src->is_mob(), tick); - // map外に消えた人は計算から除くので | People who disappear outside the map will be excluded from the calculation. + // map外に消えた人は計算から除くので | People who disappear outside the map will be excluded from the calculation. // overkill分は無いけどsumはmax_hpとは違う | There is no overkill portion, but sum is different from max_hp // snip a prelude loop, now merged @@ -3540,7 +3540,7 @@ int mob_makedummymobdb(Species mob_class) } /*========================================== - * + * *------------------------------------------ */ static @@ -3556,7 +3556,7 @@ bool impl_extract(XString str, LevelElement *le) } /*========================================== - * + * *------------------------------------------ */ bool mob_readdb(ZString filename) @@ -3711,7 +3711,7 @@ bool mob_readdb(ZString filename) } /*========================================== - * + * *------------------------------------------ */ static @@ -3739,7 +3739,7 @@ bool impl_extract(XString str, MobSkillCondition *msc) } /*========================================== - * + * *------------------------------------------ */ static @@ -3766,7 +3766,7 @@ bool impl_extract(XString str, MobSkillState *mss) } /*========================================== - * + * *------------------------------------------ */ static @@ -3791,7 +3791,7 @@ bool impl_extract(XString str, MobSkillTarget *mst) } /*========================================== - * + * *------------------------------------------ */ bool mob_readskilldb(ZString filename) @@ -3877,7 +3877,7 @@ bool mob_readskilldb(ZString filename) } /*========================================== - * + * *------------------------------------------ */ void do_init_mob2(void) diff --git a/src/map/npc-parse.cpp b/src/map/npc-parse.cpp index df1a09a..7b225f8 100644 --- a/src/map/npc-parse.cpp +++ b/src/map/npc-parse.cpp @@ -41,7 +41,7 @@ #include "../ast/npc.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "itemdb.hpp" diff --git a/src/map/npc.cpp b/src/map/npc.cpp index 7d3e62b..2adc774 100644 --- a/src/map/npc.cpp +++ b/src/map/npc.cpp @@ -42,10 +42,10 @@ #include "../net/timer.hpp" -#include "../proto2/map-user.hpp" +#include "proto2/map-user.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "itemdb.hpp" diff --git a/src/map/party.cpp b/src/map/party.cpp index ccbfd75..d9b814a 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -35,7 +35,7 @@ #include "../high/mmo.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "intif.hpp" diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 12af48f..2a7a8ec 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -44,18 +44,18 @@ #include "../net/timer.hpp" #include "../net/timestamp-utils.hpp" -#include "../proto2/char-map.hpp" +#include "proto2/char-map.hpp" #include "atcommand.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "chrif.hpp" #include "clif.hpp" #include "globals.hpp" #include "intif.hpp" #include "itemdb.hpp" #include "map.hpp" -#include "map_conf.hpp" +#include "map/map_conf.hpp" #include "npc.hpp" #include "party.hpp" #include "path.hpp" @@ -294,35 +294,35 @@ earray<EPOS, EQUIP, EQUIP::COUNT> equip_pos //= }}; /*========================================== - * + * *------------------------------------------ */ static int pc_checkoverhp(dumb_ptr<map_session_data> sd); /*========================================== - * + * *------------------------------------------ */ static int pc_checkoversp(dumb_ptr<map_session_data> sd); /*========================================== - * + * *------------------------------------------ */ static int pc_nextbaseafter(dumb_ptr<map_session_data> sd); /*========================================== - * + * *------------------------------------------ */ static int pc_nextjobafter(dumb_ptr<map_session_data> sd); /*========================================== - * + * *------------------------------------------ */ static @@ -332,7 +332,7 @@ void pc_setdead(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ GmLevel pc_isGM(dumb_ptr<map_session_data> sd) @@ -346,7 +346,7 @@ GmLevel pc_isGM(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ int pc_iskiller(dumb_ptr<map_session_data> src, @@ -364,7 +364,7 @@ int pc_iskiller(dumb_ptr<map_session_data> src, } /*========================================== - * + * *------------------------------------------ */ void pc_set_gm_level(AccountId account_id, GmLevel level) @@ -376,7 +376,7 @@ void pc_set_gm_level(AccountId account_id, GmLevel level) } /*========================================== - * + * *------------------------------------------ */ static @@ -390,7 +390,7 @@ int distance(int x0, int y0, int x1, int y1) } /*========================================== - * + * *------------------------------------------ */ static @@ -403,7 +403,7 @@ void pc_pvp_timer(TimerData *, tick_t, BlockId id) } /*========================================== - * + * *------------------------------------------ */ int pc_setpvptimer(dumb_ptr<map_session_data> sd, interval_t val) @@ -417,7 +417,7 @@ int pc_setpvptimer(dumb_ptr<map_session_data> sd, interval_t val) } /*========================================== - * + * *------------------------------------------ */ int pc_delpvptimer(dumb_ptr<map_session_data> sd) @@ -429,7 +429,7 @@ int pc_delpvptimer(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -442,7 +442,7 @@ void pc_invincible_timer(TimerData *, tick_t, BlockId id) } /*========================================== - * + * *------------------------------------------ */ int pc_setinvincibletimer(dumb_ptr<map_session_data> sd, interval_t val) @@ -456,7 +456,7 @@ int pc_setinvincibletimer(dumb_ptr<map_session_data> sd, interval_t val) } /*========================================== - * + * *------------------------------------------ */ int pc_delinvincibletimer(dumb_ptr<map_session_data> sd) @@ -468,7 +468,7 @@ int pc_delinvincibletimer(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ int pc_setrestartvalue(dumb_ptr<map_session_data> sd, int type) @@ -537,7 +537,7 @@ void pc_counttargeted_sub(dumb_ptr<block_list> bl, } /*========================================== - * + * *------------------------------------------ */ int pc_counttargeted(dumb_ptr<map_session_data> sd, dumb_ptr<block_list> src, @@ -636,7 +636,7 @@ int pc_setnewpc(dumb_ptr<map_session_data> sd, AccountId account_id, CharId char } /*========================================== - * + * *------------------------------------------ */ EPOS pc_equippoint(dumb_ptr<map_session_data> sd, IOff0 n) @@ -647,7 +647,7 @@ EPOS pc_equippoint(dumb_ptr<map_session_data> sd, IOff0 n) } /*========================================== - * + * *------------------------------------------ */ static @@ -668,7 +668,7 @@ int pc_setinventorydata(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -683,7 +683,7 @@ int pc_calcweapontype(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -738,7 +738,7 @@ int pc_setequipindex(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -765,7 +765,7 @@ int pc_isequip(dumb_ptr<map_session_data> sd, IOff0 n) } /*========================================== - * + * *------------------------------------------ */ void pc_set_weapon_icon(dumb_ptr<map_session_data> sd, int count, @@ -795,7 +795,7 @@ void pc_set_weapon_icon(dumb_ptr<map_session_data> sd, int count, } /*========================================== - * + * *------------------------------------------ */ void pc_set_attack_info(dumb_ptr<map_session_data> sd, interval_t speed, int range) @@ -1021,7 +1021,7 @@ int pc_authfail(AccountId id) } /*========================================== - * + * *------------------------------------------ */ static @@ -1081,7 +1081,7 @@ int pc_checkweighticon(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -2075,7 +2075,7 @@ IOff0 pc_search_inventory(dumb_ptr<map_session_data> sd, ItemNameId item_id) } /*========================================== - * + * *------------------------------------------ */ int pc_count_all_items(dumb_ptr<map_session_data> player, ItemNameId item_id) @@ -2094,7 +2094,7 @@ int pc_count_all_items(dumb_ptr<map_session_data> player, ItemNameId item_id) } /*========================================== - * + * *------------------------------------------ */ int pc_remove_items(dumb_ptr<map_session_data> player, ItemNameId item_id, int count) @@ -2295,7 +2295,7 @@ int can_pick_item_up_from(dumb_ptr<map_session_data> self, BlockId other_id) } /*========================================== - * + * *------------------------------------------ */ int pc_takeitem(dumb_ptr<map_session_data> sd, dumb_ptr<flooritem_data> fitem) @@ -2355,7 +2355,7 @@ int pc_takeitem(dumb_ptr<map_session_data> sd, dumb_ptr<flooritem_data> fitem) } /*========================================== - * + * *------------------------------------------ */ static @@ -2805,7 +2805,7 @@ int pc_stop_walking(dumb_ptr<map_session_data> sd, int type) } /*========================================== - * + * *------------------------------------------ */ void pc_touch_all_relevant_npcs(dumb_ptr<map_session_data> sd) @@ -3037,7 +3037,7 @@ int pc_stopattack(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -3072,7 +3072,7 @@ int pc_checkbaselevelup(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ inline @@ -3100,7 +3100,7 @@ int pc_skillpt_potential(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -3141,7 +3141,7 @@ int pc_checkjoblevelup(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ int pc_gainexp_reason(dumb_ptr<map_session_data> sd, int base_exp, int job_exp, @@ -3238,7 +3238,7 @@ int pc_gainexp_reason(dumb_ptr<map_session_data> sd, int base_exp, int job_exp, } /*========================================== - * + * *------------------------------------------ */ int pc_extract_healer_exp(dumb_ptr<map_session_data> sd, int max) @@ -4228,7 +4228,7 @@ static int pc_itemheal_effect(dumb_ptr<map_session_data> sd, int hp, int sp); /*========================================== - * + * *------------------------------------------ */ static @@ -4254,7 +4254,7 @@ pc_heal_quick_speed(int amount) } /*========================================== - * + * *------------------------------------------ */ static @@ -4274,7 +4274,7 @@ void pc_heal_quick_accumulate(int new_amount, } /*========================================== - * + * *------------------------------------------ */ int pc_itemheal(dumb_ptr<map_session_data> sd, int hp, int sp) @@ -4814,7 +4814,7 @@ int pc_signal_advanced_equipment_change(dumb_ptr<map_session_data> sd, IOff0 n) } /*========================================== - * + * *------------------------------------------ */ int pc_equipitem(dumb_ptr<map_session_data> sd, IOff0 n, EPOS) @@ -5029,7 +5029,7 @@ int pc_unequipitem(dumb_ptr<map_session_data> sd, IOff0 n, CalcStatus type) } /*========================================== - * + * *------------------------------------------ */ int pc_unequipinvyitem(dumb_ptr<map_session_data> sd, IOff0 n, CalcStatus type) @@ -5101,7 +5101,7 @@ int pc_checkitem(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ int pc_checkoverhp(dumb_ptr<map_session_data> sd) @@ -5121,7 +5121,7 @@ int pc_checkoverhp(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ int pc_checkoversp(dumb_ptr<map_session_data> sd) @@ -5327,7 +5327,7 @@ interval_t pc_hpheal(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -5385,7 +5385,7 @@ int pc_natural_heal_hp(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -5460,7 +5460,7 @@ int pc_quickregenerate_effect(struct quick_regeneration *quick_regen, } /*========================================== - * + * *------------------------------------------ */ static @@ -5595,7 +5595,7 @@ void pc_autosave(TimerData *, tick_t) } /*========================================== - * + * *------------------------------------------ */ int pc_read_gm_account(Session *, const std::vector<Packet_Repeat<0x2b15>>& repeat) @@ -5612,7 +5612,7 @@ int pc_read_gm_account(Session *, const std::vector<Packet_Repeat<0x2b15>>& repe } /*========================================== - * + * *------------------------------------------ */ void pc_setstand(dumb_ptr<map_session_data> sd) @@ -5626,7 +5626,7 @@ void pc_setstand(dumb_ptr<map_session_data> sd) } /*========================================== - * + * *------------------------------------------ */ static @@ -5647,7 +5647,7 @@ void pc_calc_sigma(void) } /*========================================== - * + * *------------------------------------------ */ void do_init_pc(void) @@ -5664,7 +5664,7 @@ void do_init_pc(void) } /*========================================== - * + * *------------------------------------------ */ void pc_invisibility(dumb_ptr<map_session_data> sd, int enabled) @@ -5684,7 +5684,7 @@ void pc_invisibility(dumb_ptr<map_session_data> sd, int enabled) } /*========================================== - * + * *------------------------------------------ */ int pc_logout(dumb_ptr<map_session_data> sd) // [fate] Player logs out diff --git a/src/map/script-call.cpp b/src/map/script-call.cpp index f551ec4..0493ec3 100644 --- a/src/map/script-call.cpp +++ b/src/map/script-call.cpp @@ -31,7 +31,7 @@ #include "../high/core.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "globals.hpp" #include "map.hpp" #include "npc.hpp" diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 1efa006..3d5fe20 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -35,14 +35,14 @@ #include "../net/timer.hpp" -#include "../proto2/net-HumanTimeDiff.hpp" +#include "proto2/net-HumanTimeDiff.hpp" #include "../high/core.hpp" #include "../high/extract_mmo.hpp" #include "atcommand.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "chrif.hpp" #include "clif.hpp" #include "globals.hpp" @@ -2964,7 +2964,7 @@ void builtin_mobinfo_droparrays(ScriptState *st) char prefix = name.front(); char postfix = name.back(); - + int status = 0; // 0 = mob not found or error, 1 = mob found and has drops, 2 = mob found and has no drops if (prefix != '$' && prefix != '@' && prefix != '.') @@ -3020,7 +3020,7 @@ void builtin_mobinfo_droparrays(ScriptState *st) push_int<ScriptDataInt>(st->stack, status); return; } - + for (int i = 0; i < MaxDrops; ++i) if (get_mob_db(mob_id).dropitem[i].nameid) { @@ -3737,9 +3737,9 @@ void builtin_issummon(ScriptState *st) int val = 0; if (md) { - val = bool(md->mode & MobMode::SUMMONED); + val = bool(md->mode & MobMode::SUMMONED); } - + push_int<ScriptDataInt>(st->stack, val); } @@ -4047,7 +4047,7 @@ void builtin_isloggedin(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4065,7 +4065,7 @@ void builtin_setmapflag(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4083,7 +4083,7 @@ void builtin_removemapflag(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4105,7 +4105,7 @@ void builtin_getmapflag(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4143,7 +4143,7 @@ void builtin_pvpon(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4177,7 +4177,7 @@ void builtin_pvpoff(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4194,7 +4194,7 @@ void builtin_setpvpchannel(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4250,7 +4250,7 @@ void builtin_emotion(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4277,7 +4277,7 @@ void builtin_mapwarp(ScriptState *st) // Added by RoVeRT } /*========================================== - * + * *------------------------------------------ */ static @@ -4288,7 +4288,7 @@ void builtin_mobcount_sub(dumb_ptr<block_list> bl, NpcEvent event, int *c) } /*========================================== - * + * *------------------------------------------ */ static @@ -4316,7 +4316,7 @@ void builtin_mobcount(ScriptState *st) // Added by RoVeRT } /*========================================== - * + * *------------------------------------------ */ static @@ -4335,7 +4335,7 @@ void builtin_marriage(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4353,7 +4353,7 @@ void builtin_divorce(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4381,7 +4381,7 @@ void builtin_getitemlink(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4406,7 +4406,7 @@ void builtin_l(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4417,7 +4417,7 @@ void builtin_chr(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4428,7 +4428,7 @@ void builtin_ord(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4524,7 +4524,7 @@ void builtin_getinventorylist(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4559,7 +4559,7 @@ void builtin_getactivatedpoolskilllist(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4592,7 +4592,7 @@ void builtin_getunactivatedpoolskilllist(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4607,7 +4607,7 @@ void builtin_poolskill(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4697,7 +4697,7 @@ void builtin_specialeffect(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -4715,7 +4715,7 @@ void builtin_specialeffect2(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5012,7 +5012,7 @@ void builtin_message(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5025,7 +5025,7 @@ void builtin_title(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5049,7 +5049,7 @@ void builtin_smsg(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5071,7 +5071,7 @@ void builtin_remotecmd(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5108,7 +5108,7 @@ void builtin_sendcollision(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5121,7 +5121,7 @@ void builtin_music(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5146,7 +5146,7 @@ void builtin_mapmask(ScriptState *st) } /*========================================== - * + * *------------------------------------------ */ static @@ -5307,7 +5307,7 @@ void builtin_areatimer_sub(dumb_ptr<block_list> bl, interval_t tick, NpcEvent ev } /*========================================== - * + * *------------------------------------------ */ static diff --git a/src/map/script-startup.cpp b/src/map/script-startup.cpp index ad809db..82c4176 100644 --- a/src/map/script-startup.cpp +++ b/src/map/script-startup.cpp @@ -36,7 +36,7 @@ #include "globals.hpp" #include "map.hpp" -#include "map_conf.hpp" +#include "map/map_conf.hpp" #include "script-parse-internal.hpp" #include "script-persist.hpp" diff --git a/src/map/skill.cpp b/src/map/skill.cpp index 87bbbda..6f01f2f 100644 --- a/src/map/skill.cpp +++ b/src/map/skill.cpp @@ -48,7 +48,7 @@ #include "../mmo/extract_enums.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "mob.hpp" diff --git a/src/map/storage.hpp b/src/map/storage.hpp index 5f118c3..aa48b1b 100644 --- a/src/map/storage.hpp +++ b/src/map/storage.hpp @@ -22,7 +22,7 @@ #include "fwd.hpp" -#include "../proto2/net-Storage.hpp" +#include "proto2/net-Storage.hpp" #include "../mmo/clif.t.hpp" diff --git a/src/map/tmw.cpp b/src/map/tmw.cpp index 5422b3a..c9ab10b 100644 --- a/src/map/tmw.cpp +++ b/src/map/tmw.cpp @@ -34,7 +34,7 @@ #include "atcommand.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "chrif.hpp" #include "clif.hpp" #include "globals.hpp" diff --git a/src/map/trade.cpp b/src/map/trade.cpp index c03609c..251d8ce 100644 --- a/src/map/trade.cpp +++ b/src/map/trade.cpp @@ -25,7 +25,7 @@ #include "../io/cxxstdio.hpp" #include "battle.hpp" -#include "battle_conf.hpp" +#include "map/battle_conf.hpp" #include "clif.hpp" #include "globals.hpp" #include "itemdb.hpp" diff --git a/src/mmo/fwd.hpp b/src/mmo/fwd.hpp index d98bd33..0d78122 100644 --- a/src/mmo/fwd.hpp +++ b/src/mmo/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../ints/fwd.hpp" // rank 1 #include "../strings/fwd.hpp" // rank 1 diff --git a/src/mmo/version.cpp b/src/mmo/version.cpp index c75c25c..4f8d141 100644 --- a/src/mmo/version.cpp +++ b/src/mmo/version.cpp @@ -20,7 +20,7 @@ // 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 "src/conf/version.hpp" +#include "conf/version.hpp" #include "../strings/xstring.hpp" diff --git a/src/net/fwd.hpp b/src/net/fwd.hpp index cda28bb..40e270d 100644 --- a/src/net/fwd.hpp +++ b/src/net/fwd.hpp @@ -18,14 +18,14 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../ints/fwd.hpp" // rank 1 #include "../strings/fwd.hpp" // rank 1 #include "../compat/fwd.hpp" // rank 2 #include "../generic/fwd.hpp" // rank 3 #include "../io/fwd.hpp" // rank 4 -#include "../proto2/fwd.hpp" // rank 8 +#include "proto2/fwd.hpp" // rank 8 #include "../wire/fwd.hpp" // rank 9 // net/fwd.hpp is rank 5 diff --git a/src/net/socket.cpp b/src/net/socket.cpp index 786f085..bc09706 100644 --- a/src/net/socket.cpp +++ b/src/net/socket.cpp @@ -34,7 +34,7 @@ #include "../io/cxxstdio.hpp" -#include "../proto2/map-user.hpp" +#include "proto2/map-user.hpp" #include "../wire/packets.hpp" diff --git a/src/proto-base/fwd.hpp b/src/proto-base/fwd.hpp index 1790717..922ac6d 100644 --- a/src/proto-base/fwd.hpp +++ b/src/proto-base/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../strings/fwd.hpp" // rank 1 #include "../generic/fwd.hpp" // rank 3 diff --git a/src/range/fwd.hpp b/src/range/fwd.hpp index 4bad327..a49add1 100644 --- a/src/range/fwd.hpp +++ b/src/range/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" // range/fwd.hpp is rank 1 diff --git a/src/sexpr/fwd.hpp b/src/sexpr/fwd.hpp index b86d9fb..a447519 100644 --- a/src/sexpr/fwd.hpp +++ b/src/sexpr/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../strings/fwd.hpp" // rank 1 #include "../io/fwd.hpp" // rank 4 diff --git a/src/shared/lib.cpp b/src/shared/lib.cpp index 563bff4..2d98afc 100644 --- a/src/shared/lib.cpp +++ b/src/shared/lib.cpp @@ -18,7 +18,7 @@ // 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 "src/conf/install.hpp" +#include "conf/install.hpp" #include "../strings/literal.hpp" #include "../strings/astring.hpp" diff --git a/src/strings/fwd.hpp b/src/strings/fwd.hpp index 29762f9..23a1d89 100644 --- a/src/strings/fwd.hpp +++ b/src/strings/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include <cstddef> #include <cstdint> diff --git a/src/tests/fwd.hpp b/src/tests/fwd.hpp index 3ee52ff..be76d74 100644 --- a/src/tests/fwd.hpp +++ b/src/tests/fwd.hpp @@ -18,7 +18,7 @@ // 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 "../sanity.hpp" +#include "sanity.hpp" #include "../strings/fwd.hpp" // rank 1 #include "../io/fwd.hpp" // rank 4 diff --git a/src/wire/fwd.hpp b/src/wire/fwd.hpp index 83d5b20..01ba4c2 100644 --- a/src/wire/fwd.hpp +++ b/src/wire/fwd.hpp @@ -18,13 +18,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 "../sanity.hpp" +#include "sanity.hpp" #include "../ints/fwd.hpp" // rank 1 #include "../compat/fwd.hpp" // rank 2 #include "../io/fwd.hpp" // rank 4 #include "../net/fwd.hpp" // rank 5 -#include "../proto2/fwd.hpp" // rank 8 +#include "proto2/fwd.hpp" // rank 8 // wire/fwd.hpp is rank 9 namespace tmwa diff --git a/src/wire/packets.hpp b/src/wire/packets.hpp index 82cc919..6f6bbf7 100644 --- a/src/wire/packets.hpp +++ b/src/wire/packets.hpp @@ -26,7 +26,7 @@ #include "../compat/cast.hpp" -#include "../proto2/fwd.hpp" +#include "proto2/fwd.hpp" #include "../net/socket.hpp" diff --git a/tools/config.py b/tools/config.py index 22ece0b..b187372 100755 --- a/tools/config.py +++ b/tools/config.py @@ -278,9 +278,9 @@ class Group(object): headers |= o.headers hpp.write('\n') - hpp.write('#include "fwd.hpp"\n') + hpp.write('#include "%s/fwd.hpp"\n' % os.path.relpath(path, 'src')) for h in sorted(headers, key=lambda h: (h.meta, h.name)): - hpp.write('#include %s\n' % h.relative_to(path)) + hpp.write('#include %s\n' % h.relative_to("src")) hpp.write('\n') cpp.write('\n') for h in [ @@ -290,9 +290,9 @@ class Group(object): Header('src/mmo/extract_enums.hpp'), Header('src/high/extract_mmo.hpp'), ] + self.extra_headers: - cpp.write('#include %s\n' % h.relative_to(path)) + cpp.write('#include %s\n' % h.relative_to('src')) cpp.write('\n') - cpp.write('#include "../poison.hpp"\n') + cpp.write('#include "poison.hpp"\n') cpp.write('\n') hpp.write('namespace tmwa\n{\n') diff --git a/tools/protocol.py b/tools/protocol.py index c4c8657..d8d72c7 100755 --- a/tools/protocol.py +++ b/tools/protocol.py @@ -347,7 +347,7 @@ class NeutralType(Type): def __init__(self, name, include): self.name = name - identity = '#include "../proto-base/net-neutral.hpp"\n' + identity = '#include "proto-base/net-neutral.hpp"\n' self.includes = frozenset({include, identity}) if include else frozenset({identity}) def __repr__(self): @@ -403,7 +403,7 @@ class StringType(Type): def __init__(self, native): self.native = native - self.includes = native.includes | {'#include "../proto-base/net-string.hpp"\n'} + self.includes = native.includes | {'#include "proto-base/net-string.hpp"\n'} def __repr__(self): return 'StringType(%r)' % (self.native) @@ -556,7 +556,7 @@ class SkewLengthType(Type): def __init__(self, ty, skew): self.type = ty self.skew = skew - self.includes = ty.includes | {'#include "../proto-base/net-skewed-length.hpp"\n'} + self.includes = ty.includes | {'#include "proto-base/net-skewed-length.hpp"\n'} def __repr__(self): return 'SkewLengthType(%r, %r)' % (self.ty, self.skew) @@ -752,7 +752,7 @@ class ArrayType(Type): def __init__(self, element, count): self.element = element self.count = count - self.includes = element.includes | {'#include "../proto-base/net-array.hpp"\n'} + self.includes = element.includes | {'#include "proto-base/net-array.hpp"\n'} def __repr__(self): return 'ArrayType(%r, %r)' % (self.element, self.count) @@ -771,7 +771,7 @@ class EArrayType(Type): self.element = element self.index = index self.count = count - self.includes = element.includes | {'#include "../proto-base/net-array.hpp"\n'} + self.includes = element.includes | {'#include "proto-base/net-array.hpp"\n'} def __repr__(self): return 'EArrayType(%r, %r)' % (self.element, self.index, self.count) @@ -791,9 +791,9 @@ class InvArrayType(Type): self.index = index self.count = count self.includes = element.includes | { - '#include "../proto-base/net-array.hpp"\n', - '#include "../mmo/clif.t.hpp"\n', - '#include "../mmo/consts.hpp"\n', + '#include "proto-base/net-array.hpp"\n', + '#include "mmo/clif.t.hpp"\n', + '#include "mmo/consts.hpp"\n', } def __repr__(self): @@ -1256,7 +1256,7 @@ class Context(object): return rv def include(self, name): - rv = Include('"%s"' % relpath(name, self.outdir)) + rv = Include('"%s"' % relpath(name, 'src')) self._includes.append(rv) return rv @@ -1273,21 +1273,20 @@ class Context(object): with OpenWrite(os.path.join(outdir, 'fwd.hpp')) as f: header = '%s/fwd.hpp' % proto2 desc = 'Forward declarations of network packet body structs' - sanity = relpath('src/sanity.hpp', outdir) f.write('#pragma once\n') f.write(copyright.format(filename=header, description=desc)) f.write('\n') - f.write('#include "%s"\n\n' % sanity) + f.write('#include "sanity.hpp"\n\n') f.write('#include <cstdint>\n\n') - f.write('#include "../ints/fwd.hpp" // rank 1\n') - f.write('#include "../strings/fwd.hpp" // rank 1\n') - f.write('#include "../compat/fwd.hpp" // rank 2\n') - f.write('#include "../net/fwd.hpp" // rank 5\n') - f.write('#include "../mmo/fwd.hpp" // rank 6\n') - f.write('#include "../proto-base/fwd.hpp" // rank 7\n') + f.write('#include "ints/fwd.hpp" // rank 1\n') + f.write('#include "strings/fwd.hpp" // rank 1\n') + f.write('#include "compat/fwd.hpp" // rank 2\n') + f.write('#include "net/fwd.hpp" // rank 5\n') + f.write('#include "mmo/fwd.hpp" // rank 6\n') + f.write('#include "proto-base/fwd.hpp" // rank 7\n') f.write('// proto2/fwd.hpp is rank 8\n') f.write('\n\n') |