From b8a5e7512a0cec91d5d325a5eaae9b921c56bcb8 Mon Sep 17 00:00:00 2001 From: "omegablast2002@yahoo.com" Date: Fri, 15 Oct 2010 15:20:45 +0000 Subject: [PATCH] fixed bug with aslongas not triggering correctly for "<" and removing to soon for ">". please note: generic kicker test was broken before this rev. Issue: 483 --- projects/mtg/include/AllAbilities.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 10d389dc6..8907bf26b 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -1840,6 +1840,12 @@ class AAsLongAs:public ListMaintainerAbility, public NestedAbility{ } int canBeInList(MTGCardInstance * card){ + int size = 0; + size = (int)cards.size(); + if(includeSelf && maxi && card == source && size < maxi) + { + removed(card); + } if ((includeSelf || card!=source) && tc->canTarget(card)) return 1; return 0; } @@ -1875,7 +1881,8 @@ class AAsLongAs:public ListMaintainerAbility, public NestedAbility{ } int _added(Damageable * d){ - int size = (int) cards.size(); + int size =(int)cards.size(); + if (maxi && size < maxi) return 0; if (maxi && size >= maxi) return removeAbilityFromGame(); if (maxi) return 0; if (size <= mini) return 0; @@ -1892,9 +1899,10 @@ class AAsLongAs:public ListMaintainerAbility, public NestedAbility{ int removed(MTGCardInstance * card){ - size_t size = cards.size(); + size_t size = cards.size(); + if (maxi && (int)size < maxi) return addAbilityToGame(); + if (mini && (int)size > mini) return 0; if (mini && (int)size <= mini) return removeAbilityFromGame(); - if (maxi && (int)size == maxi-1) return addAbilityToGame(); if (!mini && !maxi && size !=0) return 0; return removeAbilityFromGame(); }