Commit dc5b8daf authored by VanillaSalt's avatar VanillaSalt

Merge pull request #817 from sidschingis/patch-2

change synchro check
parents 4fc5104f 2c82a438
......@@ -1641,12 +1641,10 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
}
card_vector nsyn;
card* pm;
for(uint8 p = 0; p < 2; ++p) {
for(int32 i = 0; i < 5; ++i) {
pm = player[p].list_mzone[i];
if(pm && pm != tuner && pm != smat && pm->is_position(POS_FACEUP) && pm->is_can_be_synchro_material(pcard, tuner)) {
if(mg && !mg->has_card(pm))
continue;
if (mg) {
for (auto cit = mg->container.begin(); cit != mg->container.end(); ++cit) {
pm=*cit;
if(pm && pm != tuner && pm != smat && pm->is_can_be_synchro_material(pcard, tuner)) {
if(pcheck)
pcheck->get_value(pm);
if(!pduel->lua->check_matching(pm, findex2, 0))
......@@ -1655,10 +1653,28 @@ int32 field::check_tuner_material(card* pcard, card* tuner, int32 findex1, int32
pm->operation_param = pm->get_synchro_level(pcard);
}
}
}
if(check_with_sum_limit(&nsyn, lv, 0, 1, min, max)) {
pduel->restore_assumes();
return TRUE;
if(check_with_sum_limit(&nsyn, lv, 0, 1, min, max)) {
pduel->restore_assumes();
return TRUE;
}
} else {
for(uint8 p = 0; p < 2; ++p) {
for(int32 i = 0; i < 5; ++i) {
pm = player[p].list_mzone[i];
if(pm && pm != tuner && pm != smat && pm->is_position(POS_FACEUP) && pm->is_can_be_synchro_material(pcard, tuner)) {
if(pcheck)
pcheck->get_value(pm);
if(!pduel->lua->check_matching(pm, findex2, 0))
continue;
nsyn.push_back(pm);
pm->operation_param = pm->get_synchro_level(pcard);
}
}
}
if(check_with_sum_limit(&nsyn, lv, 0, 1, min, max)) {
pduel->restore_assumes();
return TRUE;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment