mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Server_CardZone speed optimisation
This commit is contained in:
parent
8b6eace312
commit
733aa6c52b
3 changed files with 62 additions and 49 deletions
|
|
@ -1024,6 +1024,11 @@ Response::ResponseCode Server_Player::cmdAttachCard(const Command_AttachCard &cm
|
|||
for (int i = 0; i < attachedList.size(); ++i)
|
||||
attachedList[i]->getZone()->getPlayer()->unattachCard(ges, attachedList[i]);
|
||||
|
||||
card->setParentCard(targetCard);
|
||||
const int oldX = card->getX();
|
||||
card->setCoords(-1, card->getY());
|
||||
startzone->updateCardCoordinates(card, oldX, card->getY());
|
||||
|
||||
if (targetzone->isColumnStacked(targetCard->getX(), targetCard->getY())) {
|
||||
CardToMove *cardToMove = new CardToMove;
|
||||
cardToMove->set_card_id(targetCard->getId());
|
||||
|
|
@ -1031,9 +1036,6 @@ Response::ResponseCode Server_Player::cmdAttachCard(const Command_AttachCard &cm
|
|||
delete cardToMove;
|
||||
}
|
||||
|
||||
card->setParentCard(targetCard);
|
||||
card->setCoords(-1, card->getY());
|
||||
|
||||
Event_AttachCard event;
|
||||
event.set_start_zone(startzone->getName().toStdString());
|
||||
event.set_card_id(card->getId());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue