diff --git a/src/map/map.cpp b/src/map/map.cpp index 0222fb4945..403a4768d3 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -218,11 +218,11 @@ uint64 MapZoneDatabase::parseBodyNode(const ryml::NodeRef& node) { } uint16 zone_id = static_cast(zone_id_const); - std::shared_ptr zone = this->find(zone_id); + std::shared_ptr zone = this->find(zone_id); bool exists = zone != nullptr; if (!exists) { - zone = std::make_shared(); + zone = std::make_shared(); zone->id = zone_id; } @@ -564,7 +564,7 @@ bool MapZoneDatabase::setZone(int16 map_id, e_map_type zone) { return false; } - mapdata->zone = std::make_shared(); + mapdata->zone = std::make_shared(); mapdata->zone->id = zonedata->id; mapdata->zone->disabled_commands = zonedata->disabled_commands; mapdata->zone->disabled_items = zonedata->disabled_items; @@ -594,7 +594,7 @@ MapZoneDatabase map_zone_db; * @param group_lv: Group level * @return True when command is disabled or false otherwise */ -bool s_map_zone_data::isCommandDisabled(std::string name, uint16 group_lv) { +bool c_map_zone_data::isCommandDisabled(std::string name, uint16 group_lv) { if (this->disabled_commands.empty()) return false; @@ -616,7 +616,7 @@ bool s_map_zone_data::isCommandDisabled(std::string name, uint16 group_lv) { * @param group_lv: Group level * @return True when skill is disabled or false otherwise */ -bool s_map_zone_data::isSkillDisabled(uint16 skill_id, uint16 type, uint16 group_lv) { +bool c_map_zone_data::isSkillDisabled(uint16 skill_id, uint16 type, uint16 group_lv) { if (this->disabled_skills.empty()) return false; @@ -637,7 +637,7 @@ bool s_map_zone_data::isSkillDisabled(uint16 skill_id, uint16 type, uint16 group * @param group_lv: Group level * @return True when item is disabled or false otherwise */ -bool s_map_zone_data::isItemDisabled(t_itemid nameid, uint16 group_lv) { +bool c_map_zone_data::isItemDisabled(t_itemid nameid, uint16 group_lv) { if (this->disabled_items.empty()) return false; @@ -659,7 +659,7 @@ bool s_map_zone_data::isItemDisabled(t_itemid nameid, uint16 group_lv) { * @param group_lv: Group level * @return True when status is disabled or false otherwise */ -bool s_map_zone_data::isStatusDisabled(sc_type sc, uint16 type, uint16 group_lv) { +bool c_map_zone_data::isStatusDisabled(sc_type sc, uint16 type, uint16 group_lv) { if (this->disabled_statuses.empty()) return false; @@ -680,7 +680,7 @@ bool s_map_zone_data::isStatusDisabled(sc_type sc, uint16 type, uint16 group_lv) * @param group_lv: Group level * @return True when job is restricted or false otherwise */ -bool s_map_zone_data::isJobRestricted(int32 job_id, uint16 group_lv) { +bool c_map_zone_data::isJobRestricted(int32 job_id, uint16 group_lv) { if (this->restricted_jobs.empty()) return false; diff --git a/src/map/map.hpp b/src/map/map.hpp index c5e60e6409..c45db72aa1 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -808,7 +808,8 @@ struct iwall_data { bool shootable; }; -struct s_map_zone_data { +class c_map_zone_data { +public: uint16 id; std::unordered_map disabled_commands; std::unordered_map> disabled_skills; @@ -846,7 +847,7 @@ struct map_data { std::unordered_map skill_damage; // Used for single skill damage adjustment std::unordered_map skill_duration; - std::shared_ptr zone; + std::shared_ptr zone; struct npc_data *npc[MAX_NPC_PER_MAP]; struct spawn_data *moblist[MAX_MOB_LIST_PER_MAP]; // [Wizputer] @@ -881,18 +882,13 @@ private: std::vector flags; }; -struct s_map_zone { - uint16 id; - std::unordered_map disabled_commands; - std::unordered_map> disabled_skills; - std::unordered_map disabled_items; - std::unordered_map disabled_statuses; - std::unordered_map restricted_jobs; +class c_map_zone : public c_map_zone_data { +public: std::vector maps; std::multimap mapflags; }; -class MapZoneDatabase : public TypesafeYamlDatabase { +class MapZoneDatabase : public TypesafeYamlDatabase { public: MapZoneDatabase() : TypesafeYamlDatabase("MAP_ZONES", 1) {