mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 19:11:59 -08:00
Fixed that it possible to make damage to lose/leaved players
This commit is contained in:
parent
adbe84c540
commit
ae165e5197
1 changed files with 7 additions and 2 deletions
|
|
@ -489,7 +489,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
for (int i = 0; i < range.getRange(); i++) {
|
for (int i = 0; i < range.getRange(); i++) {
|
||||||
Player player = players.getNext(game, false);
|
Player player = players.getNext(game, false);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
while (player.hasLeft()) {
|
while (player.hasLeft()) { // can freeze?
|
||||||
player = players.getNext(game, false);
|
player = players.getNext(game, false);
|
||||||
}
|
}
|
||||||
inRange.add(player.getId());
|
inRange.add(player.getId());
|
||||||
|
|
@ -499,7 +499,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
for (int i = 0; i < range.getRange(); i++) {
|
for (int i = 0; i < range.getRange(); i++) {
|
||||||
Player player = players.getPrevious(game);
|
Player player = players.getPrevious(game);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
while (player.hasLeft()) {
|
while (player.hasLeft()) { // can freeze?
|
||||||
player = players.getPrevious(game);
|
player = players.getPrevious(game);
|
||||||
}
|
}
|
||||||
inRange.add(player.getId());
|
inRange.add(player.getId());
|
||||||
|
|
@ -2039,6 +2039,10 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
@SuppressWarnings({"null", "ConstantConditions"})
|
@SuppressWarnings({"null", "ConstantConditions"})
|
||||||
private int doDamage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable, List<
|
private int doDamage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable, List<
|
||||||
UUID> appliedEffects) {
|
UUID> appliedEffects) {
|
||||||
|
if (!this.isInGame()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (damage > 0) {
|
if (damage > 0) {
|
||||||
if (canDamage(game.getObject(sourceId), game)) {
|
if (canDamage(game.getObject(sourceId), game)) {
|
||||||
GameEvent event = new DamagePlayerEvent(playerId,
|
GameEvent event = new DamagePlayerEvent(playerId,
|
||||||
|
|
@ -2970,6 +2974,7 @@ public abstract class PlayerImpl implements Player, Serializable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (availableMana != null) {
|
if (availableMana != null) {
|
||||||
|
sourceObject.adjustCosts(copy, game);
|
||||||
game.getContinuousEffects().costModification(copy, game);
|
game.getContinuousEffects().costModification(copy, game);
|
||||||
}
|
}
|
||||||
boolean canBeCastRegularly = true;
|
boolean canBeCastRegularly = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue