Commit 9ce899f3 authored by sbl1996@126.com's avatar sbl1996@126.com

Force action in multi select when only 1 comb

parent 66ebb5af
......@@ -2149,8 +2149,9 @@ private:
fmt::println("MS: idx: {}, mode: {}, min: {}, max: {}, must: {}, specs: {}, combs: {}", ms_idx_, ms_mode_, ms_min_, ms_max_, ms_must_, ms_specs_, ms_combs_);
fmt::println("Spec: {}, Spec2index:", spec);
for (auto &[k, v] : spec2index) {
fmt::println("{}: {}", k, v);
fmt::print("{}: {}, ", k, v);
}
fmt::print("\n");
// throw std::runtime_error("Spec not found: " + spec);
idx = 1;
} else {
......@@ -3863,6 +3864,15 @@ private:
}
}
if ((min == max) && (max == specs.size())) {
resp_buf_[0] = specs.size();
for (int i = 0; i < specs.size(); ++i) {
resp_buf_[i + 1] = i;
}
YGO_SetResponseb(pduel_, resp_buf_);
return;
}
init_multi_select(min, max, 0, specs);
to_play_ = player;
......@@ -3934,6 +3944,16 @@ private:
// combs = combinations_with_weight(release_params, min);
}
if (max == specs.size()) {
// tribute all
resp_buf_[0] = specs.size();
for (int i = 0; i < specs.size(); ++i) {
resp_buf_[i + 1] = i;
}
YGO_SetResponseb(pduel_, resp_buf_);
return;
}
init_multi_select(min, max, 0, specs);
to_play_ = player;
......
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