arrows can target players; card attachment works

This commit is contained in:
Max-Wilhelm Bruker 2010-07-17 18:24:14 +02:00
parent 61b82bd6f9
commit 614f106304
32 changed files with 885 additions and 402 deletions

View file

@ -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)