mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-21 23:00:24 -08:00
filter running games; minor server code cleanup
This commit is contained in:
@@ -127,7 +127,7 @@ void Server_Player::setupZones()
|
||||
if (!currentCard)
|
||||
continue;
|
||||
for (int k = 0; k < currentCard->getNumber(); ++k)
|
||||
z->cards.append(new Server_Card(currentCard->getName(), nextCardId++, 0, 0));
|
||||
z->cards.append(new Server_Card(currentCard->getName(), nextCardId++, 0, 0, z));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,7 +334,7 @@ ResponseCode Server_Player::moveCard(CommandContainer *cont, Server_CardZone *st
|
||||
QMap<Server_Card *, CardToMove *> cardProperties;
|
||||
for (int i = 0; i < _cards.size(); ++i) {
|
||||
int position;
|
||||
Server_Card *card = startzone->getCard(_cards[i]->getCardId(), false, &position);
|
||||
Server_Card *card = startzone->getCard(_cards[i]->getCardId(), &position);
|
||||
if (!card)
|
||||
return RespNameNotFound;
|
||||
if (!card->getAttachedCards().isEmpty() && !targetzone->isColumnEmpty(x, y))
|
||||
@@ -510,7 +510,7 @@ ResponseCode Server_Player::setCardAttrHelper(CommandContainer *cont, const QStr
|
||||
return RespInvalidCommand;
|
||||
}
|
||||
} else {
|
||||
Server_Card *card = zone->getCard(cardId, false);
|
||||
Server_Card *card = zone->getCard(cardId);
|
||||
if (!card)
|
||||
return RespNameNotFound;
|
||||
result = card->setAttribute(attrName, attrValue, false);
|
||||
|
||||
Reference in New Issue
Block a user