forked from External/mage
Fix Sevinne's Reclamation. (#6275)
This also handles the rather unique case caused by Sevinne's Reclamation where the original spell resolves before the copy of it. Also fixes a couple typos.
This commit is contained in:
parent
ae7919cd07
commit
d56f6b991b
5 changed files with 51 additions and 17 deletions
|
|
@ -113,10 +113,16 @@ public class SpellStack extends ArrayDeque<StackObject> {
|
|||
}
|
||||
|
||||
public Spell getSpell(UUID id) {
|
||||
return getSpell(id, true);
|
||||
}
|
||||
|
||||
public Spell getSpell(UUID id, boolean allowCopies) {
|
||||
for (StackObject stackObject : this) {
|
||||
if (stackObject instanceof Spell) {
|
||||
if (stackObject.getId().equals(id) || stackObject.getSourceId().equals(id)) {
|
||||
return (Spell) stackObject;
|
||||
if (allowCopies || !stackObject.isCopy()) {
|
||||
return (Spell) stackObject;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue