Commit a1e6193c authored by sbl1996@126.com's avatar sbl1996@126.com

raise when idx==-1 for multi_select_2

parent 537b59fb
...@@ -1785,6 +1785,11 @@ public: ...@@ -1785,6 +1785,11 @@ public:
void _callback_multi_select_2(int idx) { void _callback_multi_select_2(int idx) {
const auto &option = options_[idx]; const auto &option = options_[idx];
idx = get_ms_spec_idx(option); idx = get_ms_spec_idx(option);
if (idx == -1) {
// TODO: find the root cause
fmt::println("options: {}, idx: {}, option: {}", options_, idx, option);
throw std::runtime_error("Spec not found");
}
ms_r_idxs_.push_back(idx); ms_r_idxs_.push_back(idx);
std::vector<std::vector<int>> combs; std::vector<std::vector<int>> combs;
for (auto &c : ms_combs_) { for (auto &c : ms_combs_) {
...@@ -4319,6 +4324,7 @@ private: ...@@ -4319,6 +4324,7 @@ private:
} }
}; };
} else if (msg_ == MSG_SELECT_OPTION) { } else if (msg_ == MSG_SELECT_OPTION) {
// TODO: add card information
auto player = read_u8(); auto player = read_u8();
auto size = read_u8(); auto size = read_u8();
if (verbose_) { if (verbose_) {
......
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