mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Fix updateSingleCard crashes
This commit is contained in:
@@ -319,16 +319,25 @@ public enum CMatchUI implements ICDoc, IMenuProvider, IMatchController {
|
|||||||
public void updateSingleCard(final CardView c) {
|
public void updateSingleCard(final CardView c) {
|
||||||
switch (c.getZone()) {
|
switch (c.getZone()) {
|
||||||
case Battlefield:
|
case Battlefield:
|
||||||
final PlayArea pa = getFieldViewFor(c.getController()).getTabletop();
|
VField battlefield = getFieldViewFor(c.getController());
|
||||||
pa.updateCard(c, false);
|
if (battlefield != null) {
|
||||||
|
battlefield.getTabletop().updateCard(c, false);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Hand:
|
case Hand:
|
||||||
final HandArea ha = getHandFor(c.getController()).getHandArea();
|
final VHand hand = getHandFor(c.getController());
|
||||||
ha.getCardPanel(c.getId()).repaintOverlays();
|
if (hand != null) {
|
||||||
|
CardPanel cp = hand.getHandArea().getCardPanel(c.getId());
|
||||||
|
if (cp != null) {
|
||||||
|
cp.repaintOverlays();
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case Command:
|
case Command:
|
||||||
final PlayArea ca = getCommandFor(c.getController()).getTabletop();
|
VCommand command = getCommandFor(c.getController());
|
||||||
ca.updateCard(c, false);
|
if (command != null) {
|
||||||
|
command.getTabletop().updateCard(c, false);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user