mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Fixed Grothama giving cards to the owner of damage and not the controller
This commit is contained in:
parent
2e88351041
commit
5b2c17aa6b
1 changed files with 4 additions and 4 deletions
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.cards.g;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -196,14 +195,15 @@ class GrothamaAllDevouringWatcher extends Watcher {
|
|||
if (event.getType() != GameEvent.EventType.DAMAGED_CREATURE) {
|
||||
return;
|
||||
}
|
||||
UUID damageControllerId = game.getControllerId(event.getSourceId());
|
||||
Permanent damaged = game.getPermanentOrLKIBattlefield(event.getTargetId());
|
||||
if (damaged == null) {
|
||||
if (damaged == null || damageControllerId == null) {
|
||||
return;
|
||||
}
|
||||
MageObjectReference mor = new MageObjectReference(damaged, game);
|
||||
damageMap.putIfAbsent(mor, new HashMap<>());
|
||||
damageMap.get(mor).putIfAbsent(event.getPlayerId(), 0);
|
||||
damageMap.get(mor).compute(event.getPlayerId(), (k, damage) -> damage + event.getAmount());
|
||||
damageMap.get(mor).putIfAbsent(damageControllerId, 0);
|
||||
damageMap.get(mor).compute(damageControllerId, (k, damage) -> damage + event.getAmount());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue