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:
Samuel Sandeen 2020-02-10 08:18:12 -05:00 committed by GitHub
parent ae7919cd07
commit d56f6b991b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 17 deletions

View file

@ -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;
}
}
}
}