Commit 325e240d authored by poixen's avatar poixen
Browse files

Merge pull request #1044 from poixen/reveal_bug

Fixed revealing top card bug
parents cf24f4aa 33fa3ae0
......@@ -369,12 +369,15 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges, Server_Car
if (cardsToMove.isEmpty())
return Response::RespContextError;
MoveCardCompareFunctor cmp(startzone == targetzone ? -1 : x);
// 0 performs no sorting
// 1 reverses the sorting
MoveCardCompareFunctor cmp(0);
qSort(cardsToMove.begin(), cardsToMove.end(), cmp);
bool secondHalf = false;
int xIndex = -1;
for (int cardIndex = 0; cardIndex < cardsToMove.size(); ++cardIndex) {
for (int cardIndex = cardsToMove.size() - 1; cardIndex > -1; --cardIndex) {
Server_Card *card = cardsToMove[cardIndex].first;
const CardToMove *thisCardProperties = cardProperties.value(card);
bool faceDown = thisCardProperties->has_face_down() ? thisCardProperties->face_down() : card->getFaceDown();
......
Supports Markdown
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