Commit 28a77f10 authored by Max-Wilhelm Bruker's avatar Max-Wilhelm Bruker
Browse files

Server crash fix

parent dccb352b
......@@ -825,6 +825,8 @@ ResponseCode Server_ProtocolHandler::cmdCreateArrow(Command_CreateArrow *cmd, Co
if (!startZone || (!targetZone && !playerTarget))
return RespNameNotFound;
Server_Card *startCard = startZone->getCard(cmd->getStartCardId(), false);
if (!startCard)
return RespNameNotFound;
Server_Card *targetCard = 0;
if (!playerTarget) {
targetCard = targetZone->getCard(cmd->getTargetCardId(), false);
......@@ -837,6 +839,8 @@ ResponseCode Server_ProtocolHandler::cmdCreateArrow(Command_CreateArrow *cmd, Co
targetItem = targetPlayer;
else
targetItem = targetCard;
if (!targetItem)
return RespNameNotFound;
QMapIterator<int, Server_Arrow *> arrowIterator(player->getArrows());
while (arrowIterator.hasNext()) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment