disallow dropping a card onto another

This commit is contained in:
Max-Wilhelm Bruker
2010-07-17 23:37:22 +02:00
parent 1b286973dd
commit cbfbc542e7
5 changed files with 41 additions and 4 deletions

View File

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