Cleanups and optimizations
This commit is contained in:
parent
6ffcedcda8
commit
c62395fe35
@ -11141,6 +11141,7 @@ void clif_parse_LoadEndAck(int fd,map_session_data *sd)
|
||||
sd->state.hpmeter_visible = 1;
|
||||
}
|
||||
|
||||
if (mapdata->zone != nullptr)
|
||||
mapdata->zone->clear_all_disabled_status(sd->bl);
|
||||
map_iwall_get(sd); // Updates Walls Info on this Map to Client
|
||||
status_calc_pc(sd, sd->state.autotrade ? SCO_FIRST : SCO_NONE); // Some conditions are map-dependent so we must recalculate
|
||||
|
||||
@ -277,6 +277,10 @@ uint64 MapZoneDatabase::parseBodyNode(const ryml::NodeRef& node) {
|
||||
std::string bl_name;
|
||||
c4::from_chars(subBl.key(), &bl_name);
|
||||
|
||||
// Skip the skill sequence key on the second loop
|
||||
if (bl_name.compare("Skill") == 0)
|
||||
continue;
|
||||
|
||||
std::string bl_name_constant = "BL_" + bl_name;
|
||||
int64 type_const;
|
||||
|
||||
@ -611,9 +615,9 @@ bool c_map_zone_data::isCommandDisabled(std::string name, map_session_data &sd)
|
||||
if (cmd_lv == nullptr)
|
||||
return false;
|
||||
|
||||
if (*cmd_lv < sd.group->level)
|
||||
if (sd.group->level < *cmd_lv)
|
||||
return false;
|
||||
else
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -634,9 +638,12 @@ bool c_map_zone_data::isSkillDisabled(uint16 skill_id, block_list &bl) {
|
||||
|
||||
map_session_data *sd = BL_CAST(BL_PC, &bl);
|
||||
|
||||
if ((sd == nullptr && skill_lv->second > 0) || (sd != nullptr && skill_lv->second < sd->group->level))
|
||||
if (sd == nullptr)
|
||||
return false;
|
||||
else
|
||||
|
||||
if (sd->group->level < skill_lv->second)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -655,9 +662,9 @@ bool c_map_zone_data::isItemDisabled(t_itemid nameid, map_session_data &sd) {
|
||||
if (item_lv == nullptr)
|
||||
return false;
|
||||
|
||||
if (*item_lv < sd.group->level)
|
||||
if (sd.group->level < *item_lv)
|
||||
return false;
|
||||
else
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -678,9 +685,12 @@ bool c_map_zone_data::isStatusDisabled(sc_type sc, block_list &bl) {
|
||||
|
||||
map_session_data *sd = BL_CAST(BL_PC, &bl);
|
||||
|
||||
if ((sd == nullptr && *status_lv > 0) || (sd != nullptr && *status_lv < sd->group->level))
|
||||
if (sd == nullptr)
|
||||
return false;
|
||||
else
|
||||
|
||||
if (sd->group->level < *status_lv)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -699,9 +709,9 @@ bool c_map_zone_data::isJobRestricted(int32 job_id, uint16 group_lv) {
|
||||
if (job_lv == nullptr)
|
||||
return false;
|
||||
|
||||
if (*job_lv < group_lv)
|
||||
if (group_lv < *job_lv)
|
||||
return false;
|
||||
else
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user