diff options
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/atcommand.cpp | 10 | ||||
-rw-r--r-- | src/map/battle.cpp | 4 | ||||
-rw-r--r-- | src/map/clif.cpp | 12 | ||||
-rw-r--r-- | src/map/itemdb.cpp | 2 | ||||
-rw-r--r-- | src/map/map.cpp | 2 | ||||
-rw-r--r-- | src/map/mob.cpp | 2 | ||||
-rw-r--r-- | src/map/party.cpp | 4 | ||||
-rw-r--r-- | src/map/pc.cpp | 20 | ||||
-rw-r--r-- | src/map/script-call.cpp | 2 | ||||
-rw-r--r-- | src/map/script-fun.cpp | 24 | ||||
-rw-r--r-- | src/map/script-parse.cpp | 2 | ||||
-rw-r--r-- | src/map/trade.cpp | 4 |
12 files changed, 45 insertions, 43 deletions
diff --git a/src/map/atcommand.cpp b/src/map/atcommand.cpp index 0b23ddd..bd1690d 100644 --- a/src/map/atcommand.cpp +++ b/src/map/atcommand.cpp @@ -375,7 +375,7 @@ bool atcommand_config_read(ZString cfgName) continue; } Option<P<AtCommandInfo>> p_ = get_atcommandinfo_byname(w1); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { p->level = GmLevel::from(static_cast<uint32_t>(atoi(w2.c_str()))); } @@ -3406,7 +3406,7 @@ ATCE atcommand_partyrecall(Session *s, dumb_ptr<map_session_data> sd, Option<PartyPair> p_ = party_searchname(party_name); if (p_.is_none()) p_ = party_search(wrap<PartyId>(static_cast<uint32_t>(atoi(message.c_str())))); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { count = 0; for (io::FD i : iter_fds()) @@ -3588,7 +3588,7 @@ ATCE atcommand_partyspy(Session *s, dumb_ptr<map_session_data> sd, Option<PartyPair> p_ = party_searchname(party_name); if (p_.is_none()) p_ = party_search(wrap<PartyId>(static_cast<uint32_t>(atoi(message.c_str())))); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { if (sd->partyspy == p.party_id) { @@ -3962,7 +3962,7 @@ ATCE atcommand_character_storage_list(Session *s, dumb_ptr<map_session_data> sd, { // you can look items only lower or same level Option<P<Storage>> stor_ = account2storage2(pl_sd->status_key.account_id); - if OPTION_IS_SOME(stor, stor_) + if OPTION_IS_SOME_NOLOOP(stor, stor_) { counter = 0; count = 0; @@ -4426,7 +4426,7 @@ ATCE atcommand_adjcmdlvl(Session *s, dumb_ptr<map_session_data>, Option<P<AtCommandInfo>> it_ = atcommand_info.search(cmd); { - if OPTION_IS_SOME(it, it_) + if OPTION_IS_SOME_NOLOOP(it, it_) { it->level = newlev; clif_displaymessage(s, "@command level changed."_s); diff --git a/src/map/battle.cpp b/src/map/battle.cpp index 88fcc07..0a6ffa7 100644 --- a/src/map/battle.cpp +++ b/src/map/battle.cpp @@ -1400,7 +1400,7 @@ struct Damage battle_calc_pc_weapon_attack(dumb_ptr<block_list> src, if (widx.ok()) { - if OPTION_IS_SOME(sdidw, sd->inventory_data[widx]) + if OPTION_IS_SOME_NOLOOP(sdidw, sd->inventory_data[widx]) atkmin = atkmin * (80 + sdidw->wlv * 20) / 100; } if (sd->status.weapon == ItemLook::BOW) @@ -1921,7 +1921,7 @@ ATK battle_weapon_attack(dumb_ptr<block_list> src, dumb_ptr<block_list> target, ItemNameId weapon; if (weapon_index.ok()) { - if OPTION_IS_SOME(sdidw, sd->inventory_data[weapon_index]) + if OPTION_IS_SOME_NOLOOP(sdidw, sd->inventory_data[weapon_index]) { if (bool(sd->status.inventory[weapon_index].equip & EPOS::WEAPON)) { diff --git a/src/map/clif.cpp b/src/map/clif.cpp index edca352..61fa8c5 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -401,7 +401,7 @@ int clif_send(const Buffer& buf, dumb_ptr<block_list> bl, SendWho type) p_ = party_search(sd->status.party_id); } } - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { for (int i = 0; i < MAX_PARTY; i++) { @@ -1231,17 +1231,19 @@ int clif_selllist(dumb_ptr<map_session_data> sd) { if (!sd->status.inventory[i].nameid) continue; - if OPTION_IS_SOME(sdidi, sd->inventory_data[i]) + if OPTION_IS_SOME_NOLOOP(sdidi, sd->inventory_data[i]) { int val = sdidi->value_sell; if (val < 0) - continue; + goto continue_outer; Packet_Repeat<0x00c7> info; info.ioff2 = i.shift(); info.base_price = val; info.actual_price = val; repeat_c7.push_back(info); } + continue_outer: + ; } send_packet_repeatonly<0x00c7, 4, 10>(s, repeat_c7); @@ -3553,7 +3555,7 @@ RecvResult clif_parse_GetCharNameRequest(Session *s, dumb_ptr<map_session_data> { Option<PartyPair> p_ = party_search(ssd->status.party_id); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { party_name = p->name; send = 1; @@ -4086,7 +4088,7 @@ RecvResult clif_parse_EquipItem(Session *s, dumb_ptr<map_session_data> sd) if (sd->npc_id) return rv; - if OPTION_IS_SOME(sdidi, sd->inventory_data[index]) + if OPTION_IS_SOME_NOLOOP(sdidi, sd->inventory_data[index]) { EPOS epos = fixed.epos_ignored; if (sdidi->type == ItemType::ARROW) diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index 2f7ed30..dbe2dd6 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -92,7 +92,7 @@ Option<Borrowed<struct item_data>> itemdb_exists(ItemNameId nameid) Borrowed<struct item_data> itemdb_search(ItemNameId nameid) { Option<P<struct item_data>> id_ = item_db.search(nameid); - if OPTION_IS_SOME(id, id_) + if OPTION_IS_SOME_NOLOOP(id, id_) return id; P<struct item_data> id = item_db.init(nameid); diff --git a/src/map/map.cpp b/src/map/map.cpp index b5f08ea..784319f 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -1247,7 +1247,7 @@ void map_setcell(Borrowed<map_local> m, int x, int y, MapCell t) int map_setipport(MapName name, IP4Address ip, int port) { Option<P<map_abstract>> md_ = maps_db.get(name); - if OPTION_IS_SOME(md, md_) + if OPTION_IS_SOME_NOLOOP(md, md_) { if (md->gat) { diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 044d0b6..63db442 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -2591,7 +2591,7 @@ int mob_damage(dumb_ptr<block_list> src, dumb_ptr<mob_data> md, int damage, if (it == ptv.end()) { Option<PartyPair> p_ = party_search(pid); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { if (p->exp != 0) { diff --git a/src/map/party.cpp b/src/map/party.cpp index 8150743..0a9d2c5 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -213,7 +213,7 @@ static PartyPair handle_info(const PartyPair sp) { Option<PartyPair> p_ = party_search(sp.party_id); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { *p.party_most = *sp.party_most; return p; @@ -459,7 +459,7 @@ int party_member_leaved(PartyId party_id, AccountId account_id, CharName name) { dumb_ptr<map_session_data> sd = map_id2sd(account_to_block(account_id)); Option<PartyPair> p_ = party_search(party_id); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) { int i; for (i = 0; i < MAX_PARTY; i++) diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 468bc2d..a38c05f 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -555,14 +555,14 @@ int pc_setequipindex(dumb_ptr<map_session_data> sd) sd->equip_index_maybe[j] = i; if (bool(sd->status.inventory[i].equip & EPOS::WEAPON)) { - if OPTION_IS_SOME(sdidi, sd->inventory_data[i]) + if OPTION_IS_SOME_NOLOOP(sdidi, sd->inventory_data[i]) sd->weapontype1 = sdidi->look; else sd->weapontype1 = ItemLook::NONE; } if (bool(sd->status.inventory[i].equip & EPOS::SHIELD)) { - if OPTION_IS_SOME(sdidi, sd->inventory_data[i]) + if OPTION_IS_SOME_NOLOOP(sdidi, sd->inventory_data[i]) { if (sdidi->type == ItemType::WEAPON) { @@ -998,7 +998,7 @@ int pc_calcstatus(dumb_ptr<map_session_data> sd, int first) || sd->equip_index_maybe[EQUIP::LEGS] == index)) continue; - if OPTION_IS_SOME(sdidi, sd->inventory_data[index]) + if OPTION_IS_SOME_NOLOOP(sdidi, sd->inventory_data[index]) { sd->spellpower_bonus_target += sdidi->magic_bonus; @@ -1033,7 +1033,7 @@ int pc_calcstatus(dumb_ptr<map_session_data> sd, int first) && (sd->equip_index_maybe[EQUIP::TORSO] == index || sd->equip_index_maybe[EQUIP::LEGS] == index)) continue; - if OPTION_IS_SOME(sdidi, sd->inventory_data[index]) + if OPTION_IS_SOME_NOLOOP(sdidi, sd->inventory_data[index]) { sd->def += sdidi->def; if (sdidi->type == ItemType::WEAPON) @@ -1084,7 +1084,7 @@ int pc_calcstatus(dumb_ptr<map_session_data> sd, int first) if (aidx.ok()) { IOff0 index = aidx; - if OPTION_IS_SOME(sdidi, sd->inventory_data[index]) + if OPTION_IS_SOME_NOLOOP(sdidi, sd->inventory_data[index]) { //まだ属性が入っていない argrec_t arg[2] = { @@ -2111,7 +2111,7 @@ int pc_useitem(dumb_ptr<map_session_data> sd, IOff0 n) if (!n.ok()) return 0; - if OPTION_IS_SOME(sdidn, sd->inventory_data[n]) + if OPTION_IS_SOME_NOLOOP(sdidn, sd->inventory_data[n]) { amount = sd->status.inventory[n].amount; if (!sd->status.inventory[n].nameid @@ -3172,7 +3172,7 @@ int pc_damage(dumb_ptr<block_list> src, dumb_ptr<map_session_data> sd, if (sd->status.party_id) { // on-the-fly party hp updates [Valaris] Option<PartyPair> p_ = party_search(sd->status.party_id); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) clif_party_hp(p, sd); } // end addition [Valaris] @@ -3540,7 +3540,7 @@ int pc_heal(dumb_ptr<map_session_data> sd, int hp, int sp) if (sd->status.party_id) { // on-the-fly party hp updates [Valaris] Option<PartyPair> p_ = party_search(sd->status.party_id); - if OPTION_IS_SOME(p, p_) + if OPTION_IS_SOME_NOLOOP(p, p_) clif_party_hp(p, sd); } // end addition [Valaris] @@ -4191,7 +4191,7 @@ int pc_equipitem(dumb_ptr<map_session_data> sd, IOff0 n, EPOS) ItemNameId view_i; ItemLook view_l = ItemLook::NONE; // TODO: This is ugly. - if OPTION_IS_SOME(sdidn, sd->inventory_data[n]) + if OPTION_IS_SOME_NOLOOP(sdidn, sd->inventory_data[n]) { bool look_not_weapon = sdidn->look == ItemLook::NONE; bool equip_is_weapon = bool(sd->status.inventory[n].equip & EPOS::WEAPON); @@ -4211,7 +4211,7 @@ int pc_equipitem(dumb_ptr<map_session_data> sd, IOff0 n, EPOS) } if (bool(sd->status.inventory[n].equip & EPOS::SHIELD)) { - if OPTION_IS_SOME(sdidn, sd->inventory_data[n]) + if OPTION_IS_SOME_NOLOOP(sdidn, sd->inventory_data[n]) { if (sdidn->type == ItemType::WEAPON) { diff --git a/src/map/script-call.cpp b/src/map/script-call.cpp index 212e0e3..abab24d 100644 --- a/src/map/script-call.cpp +++ b/src/map/script-call.cpp @@ -108,7 +108,7 @@ void get_val(dumb_ptr<map_session_data> sd, struct script_data *data) else if (prefix == '$') { Option<P<RString>> s_ = mapregstr_db.search(u.reg); - if OPTION_IS_SOME(s, s_) + if OPTION_IS_SOME_NOLOOP(s, s_) str = *s; } else diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 781df69..f9334bc 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -122,7 +122,7 @@ void builtin_callfunc(ScriptState *st) RString str = conv_str(st, &AARG(0)); Option<P<const ScriptBuffer>> scr_ = userfunc_db.get(str); - if OPTION_IS_SOME(scr, scr_) + if OPTION_IS_SOME_NOLOOP(scr, scr_) { int j = 0; assert (st->start + 3 == st->end); @@ -720,7 +720,7 @@ void builtin_countitem(ScriptState *st) { ZString name = ZString(conv_str(st, data)); Option<P<struct item_data>> item_data_ = itemdb_searchname(name); - if OPTION_IS_SOME(item_data, item_data_) + if OPTION_IS_SOME_NOLOOP(item_data, item_data_) nameid = item_data->nameid; } else @@ -763,7 +763,7 @@ void builtin_checkweight(ScriptState *st) { ZString name = ZString(conv_str(st, data)); Option<P<struct item_data>> item_data_ = itemdb_searchname(name); - if OPTION_IS_SOME(item_data, item_data_) + if OPTION_IS_SOME_NOLOOP(item_data, item_data_) nameid = item_data->nameid; } else @@ -808,7 +808,7 @@ void builtin_getitem(ScriptState *st) { ZString name = ZString(conv_str(st, data)); Option<P<struct item_data>> item_data_ = itemdb_searchname(name); - if OPTION_IS_SOME(item_data, item_data_) + if OPTION_IS_SOME_NOLOOP(item_data, item_data_) nameid = item_data->nameid; } else @@ -861,7 +861,7 @@ void builtin_makeitem(ScriptState *st) { ZString name = ZString(conv_str(st, data)); Option<P<struct item_data>> item_data_ = itemdb_searchname(name); - if OPTION_IS_SOME(item_data, item_data_) + if OPTION_IS_SOME_NOLOOP(item_data, item_data_) nameid = item_data->nameid; } else @@ -905,7 +905,7 @@ void builtin_delitem(ScriptState *st) { ZString name = ZString(conv_str(st, data)); Option<P<struct item_data>> item_data_ = itemdb_searchname(name); - if OPTION_IS_SOME(item_data, item_data_) + if OPTION_IS_SOME_NOLOOP(item_data, item_data_) nameid = item_data->nameid; } else @@ -1080,7 +1080,7 @@ void builtin_getequipid(ScriptState *st) if (i.ok()) { Option<P<struct item_data>> item_ = sd->inventory_data[i]; - if OPTION_IS_SOME(item, item_) + if OPTION_IS_SOME_NOLOOP(item, item_) push_int<ScriptDataInt>(st->stack, unwrap<ItemNameId>(item->nameid)); else push_int<ScriptDataInt>(st->stack, 0); @@ -1109,7 +1109,7 @@ void builtin_getequipname(ScriptState *st) if (i.ok()) { Option<P<struct item_data>> item_ = sd->inventory_data[i]; - if OPTION_IS_SOME(item, item_) + if OPTION_IS_SOME_NOLOOP(item, item_) buf = STRPRINTF("%s-[%s]"_fmt, pos_str[num - 1], item->jname); else buf = STRPRINTF("%s-[%s]"_fmt, pos_str[num - 1], pos_str[10]); @@ -1832,7 +1832,7 @@ void builtin_getareadropitem(ScriptState *st) { ZString name = ZString(conv_str(st, data)); Option<P<struct item_data>> item_data_ = itemdb_searchname(name); - if OPTION_IS_SOME(item_data, item_data_) + if OPTION_IS_SOME_NOLOOP(item_data, item_data_) item = item_data->nameid; } else @@ -2013,7 +2013,7 @@ void builtin_setmapflag(ScriptState *st) int i = conv_num(st, &AARG(1)); MapFlag mf = map_flag_from_int(i); Option<P<map_local>> m_ = map_mapname2mapid(str); - if OPTION_IS_SOME(m, m_) + if OPTION_IS_SOME_NOLOOP(m, m_) { m->flag.set(mf, 1); } @@ -2026,7 +2026,7 @@ void builtin_removemapflag(ScriptState *st) int i = conv_num(st, &AARG(1)); MapFlag mf = map_flag_from_int(i); Option<P<map_local>> m_ = map_mapname2mapid(str); - if OPTION_IS_SOME(m, m_) + if OPTION_IS_SOME_NOLOOP(m, m_) { m->flag.set(mf, 0); } @@ -2041,7 +2041,7 @@ void builtin_getmapflag(ScriptState *st) int i = conv_num(st, &AARG(1)); MapFlag mf = map_flag_from_int(i); Option<P<map_local>> m_ = map_mapname2mapid(str); - if OPTION_IS_SOME(m, m_) + if OPTION_IS_SOME_NOLOOP(m, m_) { r = m->flag.get(mf); } diff --git a/src/map/script-parse.cpp b/src/map/script-parse.cpp index 878397f..47e0def 100644 --- a/src/map/script-parse.cpp +++ b/src/map/script-parse.cpp @@ -134,7 +134,7 @@ Option<Borrowed<str_data_t>> search_strp(XString p) Borrowed<str_data_t> add_strp(XString p) { Option<P<str_data_t>> rv_ = search_strp(p); - if OPTION_IS_SOME(rv, rv_) + if OPTION_IS_SOME_NOLOOP(rv, rv_) return rv; RString p2 = p; diff --git a/src/map/trade.cpp b/src/map/trade.cpp index b5e19be..5ec63c9 100644 --- a/src/map/trade.cpp +++ b/src/map/trade.cpp @@ -174,7 +174,7 @@ void trade_tradeadditem(dumb_ptr<map_session_data> sd, IOff2 index, int amount) sd->status.inventory[index.unshift()].nameid) continue; - if OPTION_IS_SOME(id, target_sd->inventory_data[i]) + if OPTION_IS_SOME_INLOOP(id, target_sd->inventory_data[i]) { if (id->type != ItemType::WEAPON && id->type != ItemType::ARMOR @@ -231,7 +231,7 @@ void trade_tradeadditem(dumb_ptr<map_session_data> sd, IOff2 index, int amount) sd->status. inventory[sd->deal_item_index[trade_i].unshift()].nameid) continue; - if OPTION_IS_SOME(id, target_sd->inventory_data[i]) + if OPTION_IS_SOME_INLOOP(id, target_sd->inventory_data[i]) { if (id->type != ItemType::WEAPON && id->type != ItemType::ARMOR |