mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
arrows can target players; card attachment works
This commit is contained in:
parent
61b82bd6f9
commit
614f106304
32 changed files with 885 additions and 402 deletions
|
|
@ -27,8 +27,15 @@ void CardZone::retranslateUi()
|
|||
|
||||
void CardZone::clearContents()
|
||||
{
|
||||
for (int i = 0; i < cards.size(); i++)
|
||||
for (int i = 0; i < cards.size(); i++) {
|
||||
// If an incorrectly implemented server doesn't return attached cards to whom they belong before dropping a player,
|
||||
// we have to return them to avoid a crash.
|
||||
const QList<CardItem *> &attachedCards = cards[i]->getAttachedCards();
|
||||
for (int j = 0; j < attachedCards.size(); ++j)
|
||||
attachedCards[j]->setParentItem(attachedCards[j]->getZone());
|
||||
|
||||
delete cards.at(i);
|
||||
}
|
||||
cards.clear();
|
||||
emit cardCountChanged();
|
||||
}
|
||||
|
|
@ -93,6 +100,7 @@ void CardZone::addCard(CardItem *card, bool reorganize, int x, int y)
|
|||
if ((x <= view->getCards().size()) || (view->getNumberCards() == -1))
|
||||
view->addCard(new CardItem(player, card->getName(), card->getId()), reorganize, x, y);
|
||||
|
||||
card->setZone(this);
|
||||
addCardImpl(card, x, y);
|
||||
|
||||
if (reorganize)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue