- fixed memory leak in AEquip/ATeach 
- Test suite now trims strings correctly (allows to have space between comma-separated card names)
- Added Paradise Mantle (for ATeach test)
- removed a missing wallpaper from wallpapers list
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-11-07 02:27:54 +00:00
parent b2ee9c0f41
commit 416617fc0d
7 changed files with 72 additions and 40 deletions

View File

@@ -6,5 +6,4 @@ wallpapers/kaioshin_garruk.jpg
wallpapers/kaioshin_jace.jpg
graphics/shop.jpg
themes/Classic/backdrop.jpg
themes/Jade/backdrop.jpg
wallpapers/kaioshin_ravager.jpg

View File

@@ -38929,6 +38929,18 @@ power=6
toughness=3
[/card]
[card]
name=Paradise Mantle
auto=teach(creature) {t}:add{r}
auto=teach(creature) {t}:add{w}
auto=teach(creature) {t}:add{b}
auto=teach(creature) {t}:add{u}
auto=teach(creature) {t}:add{g}
auto={1}:equip
type=artifact
subtype=equipment
mana={0}
[/card]
[card]
name=Paradise Plume
auto=choice name(White) && counter(0/0,1,White) all(this)
auto=choice name(Blue) && counter(0/0,1,Blue) all(this)

View File

@@ -391,6 +391,7 @@ OneDozenEyes.txt
orcish_artillery.txt
orcish_lumberjack.txt
overrun.txt
paradise_mantle.txt
paralysis.txt
paralysis2.txt
persuasion.txt

View File

@@ -0,0 +1,20 @@
#Bug: "Teach" functionality has a memory leak whenever it equips a creature
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:grizzly bears,raging goblin
hand:paradise mantle
manapool:{2}
[PLAYER2]
[DO]
paradise mantle
paradise mantle
grizzly bears
paradise mantle
raging goblin
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:grizzly bears,raging goblin, paradise mantle
[PLAYER2]
[END]

View File

@@ -2469,7 +2469,7 @@ public:
source->target = NULL;
for (size_t i = 0; i < currentAbilities.size(); ++i){
MTGAbility * a = currentAbilities[i];
if(dynamic_cast<AEquip *>(a)){
if(dynamic_cast<AEquip *>(a) || dynamic_cast<ATeach *>(a)){
SAFE_DELETE(a);
continue;
}

View File

@@ -232,10 +232,10 @@ void TestSuiteState::parsePlayerState(int playerId, string s){
unsigned int value;
limiter = s.find(",");
if (limiter != string::npos){
value = Rules::getMTGId(s.substr(0,limiter));
value = Rules::getMTGId(trim(s.substr(0,limiter)));
s = s.substr(limiter+1);
}else{
value = Rules::getMTGId(s);
value = Rules::getMTGId(trim(s));
s = "";
}
if (value) playerData[playerId].zones[area].add(value);

View File

@@ -219,40 +219,40 @@ std::vector<std::string> split(const std::string &s, char delim) {
}
std::string wordWrap(std::string sentence, int width)
{
std::string::iterator it = sentence.begin();
//remember how long next word is
int nextWordLength = 0;
int distanceFromWidth = width;
while (it != sentence.end())
{
while (*it != ' ')
{
nextWordLength++;
distanceFromWidth--;
++it;
// check if done
if (it == sentence.end())
{
return sentence;
}
}
if (nextWordLength > distanceFromWidth)
{
*it = '\n';
distanceFromWidth = width;
nextWordLength = 0;
}
//skip the space
++it;
}
return sentence;
std::string wordWrap(std::string sentence, int width)
{
std::string::iterator it = sentence.begin();
//remember how long next word is
int nextWordLength = 0;
int distanceFromWidth = width;
while (it != sentence.end())
{
while (*it != ' ')
{
nextWordLength++;
distanceFromWidth--;
++it;
// check if done
if (it == sentence.end())
{
return sentence;
}
}
if (nextWordLength > distanceFromWidth)
{
*it = '\n';
distanceFromWidth = width;
nextWordLength = 0;
}
//skip the space
++it;
}
return sentence;
}