mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
removes the pt of face down cards (#3542)
* removes the pt of face down cards Instead of setting the pt of a hidden card to the value only known to you, it's reset to nothing. Resetting a card while it's already reset does nothing. Removing the pt of a card is logged as "player removes the pt of card." instead of "player sets the pt of card to ." (note the missing value). * reset unknown cards to nothing instead * replace cardname with card id for unknown cards fixes #3543 * prefix #
This commit is contained in:
parent
c9c0fb28ee
commit
ba985f97e5
2 changed files with 24 additions and 10 deletions
|
|
@ -2514,16 +2514,21 @@ void Player::actResetPT()
|
|||
QListIterator<QGraphicsItem *> selected(scene()->selectedItems());
|
||||
while (selected.hasNext()) {
|
||||
auto *card = static_cast<CardItem *>(selected.next());
|
||||
CardInfoPtr info = card->getInfo();
|
||||
if (!info) {
|
||||
QString ptString;
|
||||
if (!card->getFaceDown()) { // leave the pt empty if the card is face down
|
||||
CardInfoPtr info = card->getInfo();
|
||||
if (info) {
|
||||
ptString = info->getPowTough();
|
||||
}
|
||||
}
|
||||
if (ptString == card->getPT()) {
|
||||
continue;
|
||||
}
|
||||
auto *cmd = new Command_SetCardAttr;
|
||||
QString zoneName = card->getZone()->getName();
|
||||
auto *cmd = new Command_SetCardAttr;
|
||||
cmd->set_zone(zoneName.toStdString());
|
||||
cmd->set_card_id(card->getId());
|
||||
cmd->set_attribute(AttrPT);
|
||||
QString ptString = info->getPowTough();
|
||||
cmd->set_attr_value(ptString.toStdString());
|
||||
commandList.append(cmd);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue