mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixed NPE which happened on occasion during AI simulations.
This commit is contained in:
parent
7698581116
commit
ff3e0108cd
1 changed files with 12 additions and 8 deletions
|
@ -94,17 +94,21 @@ class VampireHexmageEffect extends OneShotEffect<VampireHexmageEffect> {
|
|||
|
||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||
|
||||
String[ ] counterNames = permanent.getCounters().keySet().toArray(new String[0]);
|
||||
if ( permanent != null ) {
|
||||
String[ ] counterNames = permanent.getCounters().keySet().toArray(new String[0]);
|
||||
|
||||
if ( permanent.getLoyalty() != null ) {
|
||||
permanent.getLoyalty().setValue(0);
|
||||
}
|
||||
if ( permanent.getLoyalty() != null ) {
|
||||
permanent.getLoyalty().setValue(0);
|
||||
}
|
||||
|
||||
for ( String counterName : counterNames ) {
|
||||
permanent.getCounters().remove(counterName);
|
||||
}
|
||||
for ( String counterName : counterNames ) {
|
||||
permanent.getCounters().remove(counterName);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue