* Fixed a possible endless loop while player left game during damage distribution.

This commit is contained in:
LevelX2 2015-02-12 12:16:56 +01:00
parent 728281524a
commit ef147bc80c
2 changed files with 2 additions and 2 deletions

View file

@ -919,7 +919,7 @@ public class HumanPlayer extends PlayerImpl {
public void assignDamage(int damage, List<UUID> targets, String singleTargetName, UUID sourceId, Game game) {
updateGameStatePriority("assignDamage", game);
int remainingDamage = damage;
while (remainingDamage > 0) {
while (remainingDamage > 0 && isInGame()) {
Target target = new TargetCreatureOrPlayer();
if (singleTargetName != null) {
target.setTargetName(singleTargetName);

View file

@ -113,7 +113,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
List<UUID> wolves = new ArrayList<UUID>();
List<UUID> wolves = new ArrayList<>();
Permanent target = game.getPermanent(source.getFirstTarget());
if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) {
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {