mirror of
https://github.com/correl/mage.git
synced 2025-04-09 09:11:05 -09:00
* Fixed a possible endless loop while player left game during damage distribution.
This commit is contained in:
parent
728281524a
commit
ef147bc80c
2 changed files with 2 additions and 2 deletions
Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human
Mage.Sets/src/mage/sets/magic2010
|
@ -919,7 +919,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
public void assignDamage(int damage, List<UUID> targets, String singleTargetName, UUID sourceId, Game game) {
|
public void assignDamage(int damage, List<UUID> targets, String singleTargetName, UUID sourceId, Game game) {
|
||||||
updateGameStatePriority("assignDamage", game);
|
updateGameStatePriority("assignDamage", game);
|
||||||
int remainingDamage = damage;
|
int remainingDamage = damage;
|
||||||
while (remainingDamage > 0) {
|
while (remainingDamage > 0 && isInGame()) {
|
||||||
Target target = new TargetCreatureOrPlayer();
|
Target target = new TargetCreatureOrPlayer();
|
||||||
if (singleTargetName != null) {
|
if (singleTargetName != null) {
|
||||||
target.setTargetName(singleTargetName);
|
target.setTargetName(singleTargetName);
|
||||||
|
|
|
@ -113,7 +113,7 @@ class MasterOfTheWildHuntEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
List<UUID> wolves = new ArrayList<UUID>();
|
List<UUID> wolves = new ArrayList<>();
|
||||||
Permanent target = game.getPermanent(source.getFirstTarget());
|
Permanent target = game.getPermanent(source.getFirstTarget());
|
||||||
if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) {
|
if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) {
|
||||||
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue