From 77563ec532c8b51134c3020fb3c70a8bed8457fb Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 2 Sep 2014 15:11:06 -0700 Subject: Rename enum Option to Opt0 --- src/map/atcommand.cpp | 22 +++++++++++----------- src/map/battle.cpp | 2 +- src/map/battle.hpp | 2 +- src/map/chrif.cpp | 2 +- src/map/clif.cpp | 18 +++++++++--------- src/map/clif.t.hpp | 6 +++--- src/map/magic-expr.cpp | 2 +- src/map/magic.cpp | 2 +- src/map/map.hpp | 4 ++-- src/map/mob.cpp | 4 ++-- src/map/npc.cpp | 6 +++--- src/map/pc.cpp | 22 +++++++++++----------- src/map/pc.hpp | 4 ++-- src/map/script.cpp | 4 ++-- src/map/skill.cpp | 8 ++++---- 15 files changed, 54 insertions(+), 54 deletions(-) (limited to 'src/map') diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 0d70b36..8f103e1 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -645,7 +645,7 @@ ATCE atcommand_where(Session *s, dumb_ptr sd, dumb_ptr pl_sd = character.to__actual() ? map_nick2sd(character) : sd; if (pl_sd != nullptr && !((battle_config.hide_GM_session - || bool(pl_sd->status.option & Option::HIDE)) + || bool(pl_sd->status.option & Opt0::HIDE)) && !(pc_isGM(sd).detects(pc_isGM(pl_sd))))) { // you can look only lower or same level @@ -768,7 +768,7 @@ ATCE atcommand_who(Session *s, dumb_ptr sd, GmLevel pl_gm_level = pc_isGM(pl_sd); if (! ((battle_config.hide_GM_session - || bool(pl_sd->status.option & Option::HIDE)) + || bool(pl_sd->status.option & Opt0::HIDE)) && !(gm_level.detects(pl_gm_level)))) { // you can look only lower or same level @@ -830,7 +830,7 @@ ATCE atcommand_whogroup(Session *s, dumb_ptr sd, GmLevel pl_gm_level = pc_isGM(pl_sd); if (! ((battle_config.hide_GM_session - || bool(pl_sd->status.option & Option::HIDE)) + || bool(pl_sd->status.option & Opt0::HIDE)) && (!(gm_level.detects(pl_gm_level))))) { // you can look only lower or same level @@ -893,7 +893,7 @@ ATCE atcommand_whomap(Session *s, dumb_ptr sd, GmLevel pl_gm_level = pc_isGM(pl_sd); if (! ((battle_config.hide_GM_session - || bool(pl_sd->status.option & Option::HIDE)) + || bool(pl_sd->status.option & Opt0::HIDE)) && (!(gm_level.detects(pl_gm_level))))) { // you can look only lower or same level @@ -953,7 +953,7 @@ ATCE atcommand_whomapgroup(Session *s, dumb_ptr sd, GmLevel pl_gm_level = pc_isGM(pl_sd); if (! ((battle_config.hide_GM_session - || bool(pl_sd->status.option & Option::HIDE)) + || bool(pl_sd->status.option & Opt0::HIDE)) && (!(gm_level.detects(pl_gm_level))))) { // you can look only lower or same level @@ -1014,7 +1014,7 @@ ATCE atcommand_whogm(Session *s, dumb_ptr sd, { if (! ((battle_config.hide_GM_session - || bool(pl_sd->status.option & Option::HIDE)) + || bool(pl_sd->status.option & Opt0::HIDE)) && (!(gm_level.detects(pl_gm_level))))) { // you can look only lower or same level @@ -1174,7 +1174,7 @@ ATCE atcommand_option(Session *s, dumb_ptr sd, { Opt1 param1 = Opt1::ZERO; Opt2 param2 = Opt2::ZERO; - Option param3 = Option::ZERO; + Opt0 param3 = Opt0::ZERO; if (!extract(message, record<',', 1>(¶m1, ¶m2, ¶m3))) return ATCE::USAGE; @@ -1194,14 +1194,14 @@ static ATCE atcommand_hide(Session *s, dumb_ptr sd, ZString) { - if (bool(sd->status.option & Option::HIDE)) + if (bool(sd->status.option & Opt0::HIDE)) { - sd->status.option &= ~Option::HIDE; + sd->status.option &= ~Opt0::HIDE; clif_displaymessage(s, "Invisible: Off."_s); } else { - sd->status.option |= Option::HIDE; + sd->status.option |= Opt0::HIDE; clif_displaymessage(s, "Invisible: On."_s); } clif_changeoption(sd); @@ -2257,7 +2257,7 @@ ATCE atcommand_character_option(Session *s, dumb_ptr sd, { Opt1 opt1; Opt2 opt2; - Option opt3; + Opt0 opt3; CharName character; if (!asplit(message, &opt1, &opt2, &opt3, &character)) return ATCE::USAGE; diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 856408c..5e81184 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -930,7 +930,7 @@ Opt3 *battle_get_opt3(dumb_ptr bl) return nullptr; } -Option *battle_get_option(dumb_ptr bl) +Opt0 *battle_get_option(dumb_ptr bl) { nullpo_retn(bl); if (bl->bl_type == BL::MOB) diff --git a/src/map/battle.hpp b/src/map/battle.hpp index 97a4a86..b6aeff5 100644 --- a/src/map/battle.hpp +++ b/src/map/battle.hpp @@ -105,7 +105,7 @@ short *battle_get_sc_count(dumb_ptr bl); Opt1 *battle_get_opt1(dumb_ptr bl); Opt2 *battle_get_opt2(dumb_ptr bl); Opt3 *battle_get_opt3(dumb_ptr bl); -Option *battle_get_option(dumb_ptr bl); +Opt0 *battle_get_option(dumb_ptr bl); bool battle_check_undead(Race race, Element element); int battle_check_target(dumb_ptr src, dumb_ptr target, diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 0748f43..0ebdf1c 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -1283,7 +1283,7 @@ void send_users_tochar(TimerData *, tick_t) if (sd && sd->state.auth && !((battle_config.hide_GM_session || sd->state.shroud_active - || bool(sd->status.option & Option::HIDE)) && pc_isGM(sd))) + || bool(sd->status.option & Opt0::HIDE)) && pc_isGM(sd))) { Packet_Repeat<0x2aff> info; info.char_id = sd->status_key.char_id; diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 3b6c772..025b8e8 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -305,7 +305,7 @@ int clif_send(const Buffer& buf, dumb_ptr bl, SendWho type) if (bl->bl_type == BL::PC) { dumb_ptr sd2 = bl->is_player(); - if (bool(sd2->status.option & Option::INVISIBILITY)) + if (bool(sd2->status.option & Opt0::INVISIBILITY)) { // Obscure hidden GMs @@ -1000,7 +1000,7 @@ int clif_spawn_fake_npc_for_player(dumb_ptr sd, BlockId fake_n fixed_7c.speed = interval_t(); fixed_7c.opt1 = Opt1::ZERO; fixed_7c.opt2 = Opt2::ZERO; - fixed_7c.option = Option::ZERO; + fixed_7c.option = Opt0::ZERO; fixed_7c.species = FAKE_NPC_CLASS; fixed_7c.pos.x = sd->bl_x; fixed_7c.pos.y = sd->bl_y; @@ -1011,7 +1011,7 @@ int clif_spawn_fake_npc_for_player(dumb_ptr sd, BlockId fake_n fixed_78.speed = interval_t(); fixed_78.opt1 = Opt1::ZERO; fixed_78.opt2 = Opt2::ZERO; - fixed_78.option = Option::ZERO; + fixed_78.option = Opt0::ZERO; fixed_78.species = FAKE_NPC_CLASS; fixed_78.unused_head_bottom_or_species_again = unwrap(FAKE_NPC_CLASS); fixed_78.pos.x = sd->bl_x; @@ -1829,7 +1829,7 @@ int clif_changelook_towards(dumb_ptr bl, LOOK type, int val, if (bl->bl_type == BL::PC) sd = bl->is_player(); - if (sd && bool(sd->status.option & Option::INVISIBILITY)) + if (sd && bool(sd->status.option & Opt0::INVISIBILITY)) return 0; if (sd @@ -2072,7 +2072,7 @@ int clif_changeoption(dumb_ptr bl) nullpo_retz(bl); - Option option = *battle_get_option(bl); + Opt0 option = *battle_get_option(bl); sc_data = battle_get_sc_data(bl); Packet_Fixed<0x0119> fixed_119; @@ -2355,7 +2355,7 @@ static void clif_getareachar_pc(dumb_ptr sd, dumb_ptr dstsd) { - if (bool(dstsd->status.option & Option::INVISIBILITY)) + if (bool(dstsd->status.option & Opt0::INVISIBILITY)) return; nullpo_retv(sd); @@ -3902,7 +3902,7 @@ RecvResult clif_parse_ActionRequest(Session *s, dumb_ptr sd) { case DamageType::NORMAL: case DamageType::CONTINUOUS: - if (bool(sd->status.option & Option::HIDE)) + if (bool(sd->status.option & Opt0::HIDE)) return rv; if (!battle_config.skill_delay_attack_enable) { @@ -4764,7 +4764,7 @@ RecvResult clif_parse_RemovePartyMember(Session *s, dumb_ptr s *------------------------------------------ */ static -RecvResult clif_parse_PartyChangeOption(Session *s, dumb_ptr sd) +RecvResult clif_parse_PartyChangeOpt0(Session *s, dumb_ptr sd) { Packet_Fixed<0x0102> fixed; RecvResult rv = recv_fpacket<0x0102, 6>(s, fixed); @@ -5074,7 +5074,7 @@ func_table clif_parse_func_table[0x0220] = {0, 10, clif_parse_ReplyPartyInvite, }, // 0x00ff {0, 2, clif_parse_LeaveParty, }, // 0x0100 {0, 6, nullptr, }, // 0x0101 - {0, 6, clif_parse_PartyChangeOption, }, // 0x0102 + {0, 6, clif_parse_PartyChangeOpt0, }, // 0x0102 {0, 30, clif_parse_RemovePartyMember, }, // 0x0103 {0, 79, nullptr, }, // 0x0104 {0, 31, nullptr, }, // 0x0105 diff --git a/src/map/clif.t.hpp b/src/map/clif.t.hpp index 1789ee8..0f8cdbf 100644 --- a/src/map/clif.t.hpp +++ b/src/map/clif.t.hpp @@ -40,7 +40,7 @@ namespace e { // [Fate] status.option properties. These are persistent status changes. // IDs that are not listed are not used in the code (to the best of my knowledge) -enum class Option : uint16_t +enum class Opt0 : uint16_t { ZERO = 0x0000, @@ -88,11 +88,11 @@ enum class Opt3 : uint16_t _assumptio = 0x0800, }; -ENUM_BITWISE_OPERATORS(Option) +ENUM_BITWISE_OPERATORS(Opt0) ENUM_BITWISE_OPERATORS(Opt2) ENUM_BITWISE_OPERATORS(Opt3) } -using e::Option; +using e::Opt0; using e::Opt1; using e::Opt2; using e::Opt3; diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index 674c850..4ea83b6 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -1228,7 +1228,7 @@ int fun_running_status_update(dumb_ptr, val_t *result, Slice args) static int fun_status_option(dumb_ptr, val_t *result, Slice args) { - *result = ValInt{(bool((ARGPC(0))->status.option & static_cast