diff --git a/server/gameserver/mt/Param.cc b/server/gameserver/mt/Param.cc index 87ed10d2..7d7c82b0 100644 --- a/server/gameserver/mt/Param.cc +++ b/server/gameserver/mt/Param.cc @@ -2,9 +2,7 @@ #include "mt/Param.h" -std::vector mt::Param::raw_list; -std::map mt::Param::id_hash; -std::map mt::Param::name_hash; +IMPL_TABLE(mt::Param) namespace mt { diff --git a/server/gameserver/mt/Param.h b/server/gameserver/mt/Param.h index c3aeffa7..1db656da 100644 --- a/server/gameserver/mt/Param.h +++ b/server/gameserver/mt/Param.h @@ -10,6 +10,7 @@ namespace mt "parameter@parameter.csv", "param_name") public: + static struct { int gas_inactive_time = 10; float kill_param = 0.0f; float rank_param = 0.0f; @@ -83,6 +84,7 @@ namespace mt int inwater_oxygen_recover = 0; int revive_time = 15; + } s; }; } diff --git a/server/gameserver/mt/macro.h b/server/gameserver/mt/macro.h index af98c405..19bc6dd6 100644 --- a/server/gameserver/mt/macro.h +++ b/server/gameserver/mt/macro.h @@ -38,3 +38,9 @@ DECLARE_COMMON_HEAD(classname, base, filename, key, 2) \ auto itr = name_hash.find(name); \ return itr != name_hash.end() ? itr->second : nullptr; \ }; + + +#define IMPL_TABLE(classname) \ +std::vector classname::raw_list; \ +std::map classname::id_hash; \ +std::map classname::name_hash;