mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Fix segfault when drawing arrow (#6116)
This commit is contained in:
parent
9601a1fa4e
commit
bca0da6bd4
1 changed files with 4 additions and 7 deletions
|
|
@ -260,14 +260,11 @@ void CardItem::deleteDragItem()
|
|||
|
||||
void CardItem::drawArrow(const QColor &arrowColor)
|
||||
{
|
||||
if (static_cast<TabGame *>(owner->parent())->getGame()->getPlayerManager()->isSpectator())
|
||||
if (owner->getGame()->getPlayerManager()->isSpectator())
|
||||
return;
|
||||
|
||||
Player *arrowOwner = static_cast<TabGame *>(owner->parent())
|
||||
->getGame()
|
||||
->getPlayerManager()
|
||||
->getActiveLocalPlayer(
|
||||
static_cast<TabGame *>(owner->parent())->getGame()->getGameState()->getActivePlayer());
|
||||
Player *arrowOwner =
|
||||
owner->getGame()->getPlayerManager()->getActiveLocalPlayer(owner->getGame()->getGameState()->getActivePlayer());
|
||||
ArrowDragItem *arrow = new ArrowDragItem(arrowOwner, this, arrowColor);
|
||||
scene()->addItem(arrow);
|
||||
arrow->grabMouse();
|
||||
|
|
@ -287,7 +284,7 @@ void CardItem::drawArrow(const QColor &arrowColor)
|
|||
|
||||
void CardItem::drawAttachArrow()
|
||||
{
|
||||
if (static_cast<TabGame *>(owner->parent())->getGame()->getPlayerManager()->isSpectator())
|
||||
if (owner->getGame()->getPlayerManager()->isSpectator())
|
||||
return;
|
||||
|
||||
auto *arrow = new ArrowAttachItem(this);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue