From 791d90ea79e6a3810958a90476ba1f2ed53388c9 Mon Sep 17 00:00:00 2001 From: APN-Pucky Date: Sun, 9 Sep 2018 23:25:42 +0200 Subject: [PATCH] More Flexible Speed --- deck.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/deck.cpp b/deck.cpp index 27c91c9e..6b9349b1 100644 --- a/deck.cpp +++ b/deck.cpp @@ -587,7 +587,17 @@ const Card* Deck::next(Field* f) _DEBUG_MSG(1,">>>>FLEX SIMS>>>>\n"); std::vector res(std::min(3u,shuffled_cards.size())); unsigned iter = f->flexible_iter; - if(res.size()==1) //no need for flex here + + bool all_same{true}; + for(unsigned j =1; j < res.size();j++) + { + if(shuffled_cards.begin()[0]->m_id!=shuffled_cards.begin()[j]->m_id) + { + all_same=false; + break; + } + } + if(all_same) //no need for flex here, three same or only one card { const Card* card = shuffled_cards.front(); shuffled_cards.pop_front();