mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
[Game][Arrows] Deleting arrows has no acknowledgement command so we have to delete locally as well.
Took 22 minutes
This commit is contained in:
parent
33e0f8699b
commit
e182cec00a
1 changed files with 3 additions and 0 deletions
|
|
@ -408,6 +408,7 @@ void GameScene::onArrowDeleteRequested(int arrowId)
|
||||||
{
|
{
|
||||||
if (arrowRegistry.contains(arrowId)) {
|
if (arrowRegistry.contains(arrowId)) {
|
||||||
emit requestArrowDeletion(arrowId);
|
emit requestArrowDeletion(arrowId);
|
||||||
|
arrowRegistry.take(arrowId)->delArrow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -425,6 +426,7 @@ void GameScene::onCardZoneChanged(CardItem *card, bool sameZone)
|
||||||
}
|
}
|
||||||
for (auto *arrow : toDelete) {
|
for (auto *arrow : toDelete) {
|
||||||
emit requestArrowDeletion(arrow->getId());
|
emit requestArrowDeletion(arrow->getId());
|
||||||
|
arrowRegistry.take(arrow->getId())->delArrow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -433,6 +435,7 @@ void GameScene::clearArrowsForPlayer(int playerId)
|
||||||
for (auto *arrow : arrowRegistry.values()) {
|
for (auto *arrow : arrowRegistry.values()) {
|
||||||
if (arrow->getPlayer()->getPlayerInfo()->getId() == playerId) {
|
if (arrow->getPlayer()->getPlayerInfo()->getId() == playerId) {
|
||||||
emit requestArrowDeletion(arrow->getId());
|
emit requestArrowDeletion(arrow->getId());
|
||||||
|
arrowRegistry.take(arrow->getId())->delArrow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue