mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 23:12:10 -08:00
Fixed that if a player leaves a multiplayer game during combat, his creatures are removed from combat (fixes #275).
This commit is contained in:
parent
9a04fb57cb
commit
1d6ee80e4c
2 changed files with 8 additions and 2 deletions
|
|
@ -1645,6 +1645,10 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
attachedTo.removeAttachment(perm.getId(), this);
|
||||
}
|
||||
}
|
||||
// check if it's a creature and must be removed from combat
|
||||
if (perm.getCardType().contains(CardType.CREATURE) && this.getCombat() != null) {
|
||||
this.getCombat().removeFromCombat(perm.getId(), this);
|
||||
}
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,12 +73,14 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
|
|||
|
||||
public boolean hasFirstOrDoubleStrike(Game game) {
|
||||
for (UUID permId: attackers) {
|
||||
if (hasFirstOrDoubleStrike(game.getPermanent(permId))) {
|
||||
Permanent attacker = game.getPermanent(permId);
|
||||
if (attacker != null && hasFirstOrDoubleStrike(attacker)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (UUID permId: blockers) {
|
||||
if (hasFirstOrDoubleStrike(game.getPermanent(permId))) {
|
||||
Permanent blocker = game.getPermanent(permId);
|
||||
if (blocker != null && hasFirstOrDoubleStrike(blocker)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue