mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
disallow dropping a card onto another
This commit is contained in:
parent
1b286973dd
commit
cbfbc542e7
5 changed files with 41 additions and 4 deletions
|
|
@ -512,6 +512,12 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player *
|
|||
if ((!startzone) || (!targetzone))
|
||||
return RespNameNotFound;
|
||||
|
||||
// Collision detection
|
||||
if (targetzone->hasCoords())
|
||||
for (int i = 0; i < targetzone->cards.size(); ++i)
|
||||
if ((targetzone->cards[i]->getX() == x) && (targetzone->cards[i]->getY() == y))
|
||||
return RespContextError;
|
||||
|
||||
int position = -1;
|
||||
Server_Card *card = startzone->getCard(_cardId, true, &position);
|
||||
if (!card)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue