Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Donald Haase
Cockatrice
Commits
6fb16545
Commit
6fb16545
authored
Sep 14, 2010
by
Max-Wilhelm Bruker
Browse files
Fixed server crash when unattaching card
parent
d7b3764b
Changes
1
Hide whitespace changes
Inline
Side-by-side
common/server_protocolhandler.cpp
View file @
6fb16545
...
@@ -670,11 +670,14 @@ ResponseCode Server_ProtocolHandler::cmdAttachCard(Command_AttachCard *cmd, Comm
...
@@ -670,11 +670,14 @@ ResponseCode Server_ProtocolHandler::cmdAttachCard(Command_AttachCard *cmd, Comm
return
RespContextError
;
return
RespContextError
;
if
(
targetPlayer
)
if
(
targetPlayer
)
targetzone
=
targetPlayer
->
getZones
().
value
(
cmd
->
getTargetZone
());
targetzone
=
targetPlayer
->
getZones
().
value
(
cmd
->
getTargetZone
());
if
(
targetzone
)
if
(
targetzone
)
{
// This is currently enough to make sure cards don't get attached to a card that is not on the table.
// Possibly a flag will have to be introduced for this sometime.
if
(
!
targetzone
->
hasCoords
())
return
RespContextError
;
targetCard
=
targetzone
->
getCard
(
cmd
->
getTargetCardId
(),
false
);
targetCard
=
targetzone
->
getCard
(
cmd
->
getTargetCardId
(),
false
);
// This is currently enough to make sure cards don't get attached to a card that is not on the table.
}
// Possibly a flag will have to be introduced for this sometime.
if
(
!
startzone
->
hasCoords
())
if
(
!
startzone
->
hasCoords
()
||
!
targetzone
->
hasCoords
())
return
RespContextError
;
return
RespContextError
;
// Get all arrows pointing to or originating from the card being attached and delete them.
// Get all arrows pointing to or originating from the card being attached and delete them.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment