mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
*Try 2: Synchronized stack alteration.
This commit is contained in:
@@ -559,7 +559,10 @@ public class MagicStack extends MyObservable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final SpellAbilityStackInstance si = new SpellAbilityStackInstance(sp);
|
final SpellAbilityStackInstance si = new SpellAbilityStackInstance(sp);
|
||||||
|
|
||||||
|
synchronized (this.stack) {
|
||||||
this.getStack().push(si);
|
this.getStack().push(si);
|
||||||
|
}
|
||||||
|
|
||||||
// 2012-07-21 the following comparison needs to move below the pushes but somehow screws up priority
|
// 2012-07-21 the following comparison needs to move below the pushes but somehow screws up priority
|
||||||
// When it's down there. That makes absolutely no sense to me, so i'm putting it back for now
|
// When it's down there. That makes absolutely no sense to me, so i'm putting it back for now
|
||||||
@@ -844,10 +847,13 @@ public class MagicStack extends MyObservable {
|
|||||||
* @return a {@link forge.card.spellability.SpellAbility} object.
|
* @return a {@link forge.card.spellability.SpellAbility} object.
|
||||||
*/
|
*/
|
||||||
public final SpellAbility pop() {
|
public final SpellAbility pop() {
|
||||||
|
synchronized(this.stack)
|
||||||
|
{
|
||||||
final SpellAbilityStackInstance si = this.getStack().pop();
|
final SpellAbilityStackInstance si = this.getStack().pop();
|
||||||
final SpellAbility sp = si.getSpellAbility();
|
final SpellAbility sp = si.getSpellAbility();
|
||||||
return sp;
|
return sp;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public final SpellAbility top() {
|
public final SpellAbility top() {
|
||||||
final SpellAbilityStackInstance si = this.getStack().peek();
|
final SpellAbilityStackInstance si = this.getStack().peek();
|
||||||
|
|||||||
Reference in New Issue
Block a user