diff --git a/card.cpp b/card.cpp index 6c6cf41ad..b980f773a 100644 --- a/card.cpp +++ b/card.cpp @@ -133,6 +133,11 @@ bool card::card_operation_sort(card* c1, card* c2) { return c1->current.sequence < c2->current.sequence; } } +bool card::check_card_setcode(uint32 code, uint32 value) { + card_data dat; + ::read_card(code, &dat); + return dat.is_setcode(value); +} void card::attacker_map::addcard(card* pcard) { auto fid = pcard ? pcard->fieldid_r : 0; auto pr = emplace(fid, std::make_pair(pcard, 0)); @@ -488,11 +493,6 @@ inline bool check_setcode(uint16_t setcode, uint32 value) { uint32 setsubtype = value & 0xf000U; return (setcode & 0x0fffU) == settype && (setcode & 0xf000U & setsubtype) == setsubtype; } -bool card::check_card_setcode(uint32 code, uint32 value) { - card_data dat; - ::read_card(code, &dat); - return dat.is_setcode(value); -} int32 card::is_set_card(uint32 set_code) { uint32 code1 = get_code(); card_data dat1; diff --git a/card.h b/card.h index 0f65a9237..100b39f2c 100644 --- a/card.h +++ b/card.h @@ -219,6 +219,7 @@ class card { explicit card(duel* pd); ~card() = default; static bool card_operation_sort(card* c1, card* c2); + static bool check_card_setcode(uint32 code, uint32 value); bool is_extra_deck_monster() const { return !!(data.type & TYPES_EXTRA_DECK); } int32 get_infos(byte* buf, uint32 query_flag, int32 use_cache = TRUE); @@ -227,7 +228,6 @@ class card { std::tuple get_original_code_rule() const; uint32 get_code(); uint32 get_another_code(); - static bool check_card_setcode(uint32 code, uint32 value); int32 is_set_card(uint32 set_code); int32 is_origin_set_card(uint32 set_code); int32 is_pre_set_card(uint32 set_code); diff --git a/libduel.cpp b/libduel.cpp index 9b418c63b..01dff5801 100644 --- a/libduel.cpp +++ b/libduel.cpp @@ -1990,7 +1990,7 @@ int32 scriptlib::duel_get_mzone_count(lua_State *L) { used_location[p] |= digit; list_mzone[p].push_back(pcard); } else - list_mzone[p].push_back(0); + list_mzone[p].push_back(nullptr); digit <<= 1; } used_location[p] |= pduel->game_field->player[p].used_location & 0xff00; @@ -2049,7 +2049,7 @@ int32 scriptlib::duel_get_location_count_fromex(lua_State *L) { used_location[p] |= digit; list_mzone[p].push_back(pcard); } else - list_mzone[p].push_back(0); + list_mzone[p].push_back(nullptr); digit <<= 1; } used_location[p] |= pduel->game_field->player[p].used_location & 0xff00; diff --git a/operations.cpp b/operations.cpp index 30a1137ed..2dbbbc856 100644 --- a/operations.cpp +++ b/operations.cpp @@ -641,7 +641,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost, uint32 must_p core.select_effects.clear(); if(val <= player[playerid].lp) { core.select_options.push_back(11); - core.select_effects.push_back(0); + core.select_effects.push_back(nullptr); } if(must_pay) { if(core.select_options.size() == 0) @@ -786,7 +786,7 @@ int32 field::remove_overlay_card(uint16 step, uint32 reason, card* pcard, uint8 core.select_effects.clear(); if((pcard && (int32)pcard->xyz_materials.size() >= min) || (!pcard && get_overlay_count(rplayer, s, o) >= min)) { core.select_options.push_back(12); - core.select_effects.push_back(0); + core.select_effects.push_back(nullptr); } auto pr = effects.continuous_effect.equal_range(EFFECT_OVERLAY_REMOVE_REPLACE); tevent e; @@ -1529,7 +1529,7 @@ int32 field::summon(uint16 step, uint8 sumplayer, card* target, effect* proc, ui core.select_effects.clear(); core.select_options.clear(); if(ignore_count || core.summon_count[sumplayer] < get_summon_count_limit(sumplayer)) { - core.select_effects.push_back(0); + core.select_effects.push_back(nullptr); core.select_options.push_back(1); } if(!ignore_count && !core.extra_summon[sumplayer]) { @@ -2104,7 +2104,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint core.select_effects.clear(); core.select_options.clear(); if(res > 0) { - core.select_effects.push_back(0); + core.select_effects.push_back(nullptr); core.select_options.push_back(1); } for(int32 i = 0; i < eset.size(); ++i) { @@ -2129,7 +2129,7 @@ int32 field::mset(uint16 step, uint8 setplayer, card* target, effect* proc, uint core.select_effects.clear(); core.select_options.clear(); if(ignore_count || core.summon_count[setplayer] < get_summon_count_limit(setplayer)) { - core.select_effects.push_back(0); + core.select_effects.push_back(nullptr); core.select_options.push_back(1); } if(!ignore_count && !core.extra_summon[setplayer]) {