remove cards being looked at from the count on drawing (#4671)
This commit is contained in:
parent
90f187e885
commit
a7232513a7
2 changed files with 6 additions and 2 deletions
|
@ -68,7 +68,7 @@ public:
|
||||||
}
|
}
|
||||||
void setCardsBeingLookedAt(int _cardsBeingLookedAt)
|
void setCardsBeingLookedAt(int _cardsBeingLookedAt)
|
||||||
{
|
{
|
||||||
cardsBeingLookedAt = _cardsBeingLookedAt;
|
cardsBeingLookedAt = qMax(0, _cardsBeingLookedAt);
|
||||||
}
|
}
|
||||||
bool isCardAtPosLookedAt(int pos) const;
|
bool isCardAtPosLookedAt(int pos) const;
|
||||||
bool hasCoords() const
|
bool hasCoords() const
|
||||||
|
|
|
@ -337,7 +337,11 @@ Response::ResponseCode Server_Player::drawCards(GameEventStorage &ges, int numbe
|
||||||
ges.enqueueGameEvent(eventPrivate, playerId, GameEventStorageItem::SendToPrivate, playerId);
|
ges.enqueueGameEvent(eventPrivate, playerId, GameEventStorageItem::SendToPrivate, playerId);
|
||||||
ges.enqueueGameEvent(eventOthers, playerId, GameEventStorageItem::SendToOthers);
|
ges.enqueueGameEvent(eventOthers, playerId, GameEventStorageItem::SendToOthers);
|
||||||
|
|
||||||
|
if (number > 0) {
|
||||||
revealTopCardIfNeeded(deckZone, ges);
|
revealTopCardIfNeeded(deckZone, ges);
|
||||||
|
int currentKnownCards = deckZone->getCardsBeingLookedAt();
|
||||||
|
deckZone->setCardsBeingLookedAt(currentKnownCards - number);
|
||||||
|
}
|
||||||
|
|
||||||
return Response::RespOk;
|
return Response::RespOk;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue