Merge pull request #1044 from poixen/reveal_bug
Fixed revealing top card bug
This commit is contained in:
commit
325e240d67
1 changed files with 5 additions and 2 deletions
|
@ -369,12 +369,15 @@ Response::ResponseCode Server_Player::moveCard(GameEventStorage &ges, Server_Car
|
||||||
if (cardsToMove.isEmpty())
|
if (cardsToMove.isEmpty())
|
||||||
return Response::RespContextError;
|
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);
|
qSort(cardsToMove.begin(), cardsToMove.end(), cmp);
|
||||||
|
|
||||||
bool secondHalf = false;
|
bool secondHalf = false;
|
||||||
int xIndex = -1;
|
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;
|
Server_Card *card = cardsToMove[cardIndex].first;
|
||||||
const CardToMove *thisCardProperties = cardProperties.value(card);
|
const CardToMove *thisCardProperties = cardProperties.value(card);
|
||||||
bool faceDown = thisCardProperties->has_face_down() ? thisCardProperties->face_down() : card->getFaceDown();
|
bool faceDown = thisCardProperties->has_face_down() ? thisCardProperties->face_down() : card->getFaceDown();
|
||||||
|
|
Loading…
Reference in a new issue