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
1b286973
Commit
1b286973
authored
Jul 17, 2010
by
Max-Wilhelm Bruker
Browse files
crash fix; weird behaviour fix
parent
6253d920
Changes
3
Hide whitespace changes
Inline
Side-by-side
cockatrice/src/carddragitem.cpp
View file @
1b286973
...
...
@@ -52,12 +52,13 @@ void CardDragItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
QPointF
sp
=
pos
();
sc
->
removeItem
(
this
);
if
(
curren
tZone
)
{
CardZone
*
star
tZone
=
static_cast
<
CardItem
*>
(
item
)
->
get
Zone
();
CardZone
*
startZone
=
static_cast
<
CardItem
*>
(
item
)
->
ge
tZone
();
if
(
curren
tZone
&&
!
(
static_cast
<
CardItem
*>
(
item
)
->
get
AttachedTo
()
&&
(
startZone
==
currentZone
)))
{
currentZone
->
handleDropEvent
(
id
,
startZone
,
(
sp
-
currentZone
->
scenePos
()).
toPoint
(),
faceDown
);
for
(
int
i
=
0
;
i
<
childDrags
.
size
();
i
++
)
{
CardDragItem
*
c
=
static_cast
<
CardDragItem
*>
(
childDrags
[
i
]);
currentZone
->
handleDropEvent
(
c
->
id
,
startZone
,
(
sp
-
currentZone
->
scenePos
()
+
c
->
getHotSpot
()).
toPoint
(),
faceDown
);
if
(
!
(
static_cast
<
CardItem
*>
(
c
->
item
)
->
getAttachedTo
()
&&
(
startZone
==
currentZone
)))
currentZone
->
handleDropEvent
(
c
->
id
,
startZone
,
(
sp
-
currentZone
->
scenePos
()
+
c
->
getHotSpot
()).
toPoint
(),
faceDown
);
sc
->
removeItem
(
c
);
}
}
...
...
cockatrice/src/player.cpp
View file @
1b286973
...
...
@@ -628,6 +628,9 @@ void Player::eventMoveCard(Event_MoveCard *event)
if
(
!
card
)
return
;
if
(
card
->
getAttachedTo
()
&&
(
startZone
!=
targetZone
))
card
->
setAttachedTo
(
0
);
card
->
deleteDragItem
();
card
->
setId
(
event
->
getNewCardId
());
...
...
common/server_protocolhandler.cpp
View file @
1b286973
...
...
@@ -518,6 +518,9 @@ ResponseCode Server_ProtocolHandler::moveCard(Server_Game *game, Server_Player *
return
RespNameNotFound
;
if
(
startzone
!=
targetzone
)
{
if
(
card
->
getParentCard
())
card
->
setParentCard
(
0
);
const
QList
<
Server_Card
*>
&
attachedCards
=
card
->
getAttachedCards
();
for
(
int
i
=
0
;
i
<
attachedCards
.
size
();
++
i
)
unattachCard
(
game
,
attachedCards
[
i
]
->
getZone
()
->
getPlayer
(),
cont
,
attachedCards
[
i
]);
...
...
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