Fix a number of NULL/0 errors.
This commit is contained in:
@@ -2720,7 +2720,7 @@ public:
|
|||||||
{
|
{
|
||||||
tc = _tc;
|
tc = _tc;
|
||||||
tc->targetter = NULL;
|
tc->targetter = NULL;
|
||||||
includeSelf = NULL;
|
includeSelf = 0;
|
||||||
aType = MTGAbility::STANDARD_TEACH;
|
aType = MTGAbility::STANDARD_TEACH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -935,8 +935,8 @@ void ActionStack::Update(float dt)
|
|||||||
//this prevents you from "running out of time" while deciding.
|
//this prevents you from "running out of time" while deciding.
|
||||||
//before this int was added, it was possible to run out of time if you had 10 stack actions
|
//before this int was added, it was possible to run out of time if you had 10 stack actions
|
||||||
//and set the timer to 4 secs. BUG FIX //http://code.google.com/p/wagic/issues/detail?id=464
|
//and set the timer to 4 secs. BUG FIX //http://code.google.com/p/wagic/issues/detail?id=464
|
||||||
extraTime = count(NULL,NOT_RESOLVED,NULL);
|
extraTime = count(0, NOT_RESOLVED, 0);
|
||||||
if(extraTime == 0)
|
if (extraTime == 0)
|
||||||
extraTime = 1;//we never want this int to be 0.
|
extraTime = 1;//we never want this int to be 0.
|
||||||
if (timer < 0)
|
if (timer < 0)
|
||||||
timer = options[Options::INTERRUPT_SECONDS].number * extraTime;
|
timer = options[Options::INTERRUPT_SECONDS].number * extraTime;
|
||||||
|
|||||||
@@ -832,7 +832,7 @@ int AAMorph::resolve()
|
|||||||
_target->morphed = false;
|
_target->morphed = false;
|
||||||
_target->isMorphed = false;
|
_target->isMorphed = false;
|
||||||
_target->turningOver = true;
|
_target->turningOver = true;
|
||||||
af.getAbilities(¤tAbilities, NULL, _target,NULL);
|
af.getAbilities(¤tAbilities, NULL, _target, 0);
|
||||||
for (size_t i = 0; i < currentAbilities.size(); ++i)
|
for (size_t i = 0; i < currentAbilities.size(); ++i)
|
||||||
{
|
{
|
||||||
MTGAbility * a = currentAbilities[i];
|
MTGAbility * a = currentAbilities[i];
|
||||||
@@ -2327,7 +2327,7 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t
|
|||||||
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
|
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
|
||||||
{
|
{
|
||||||
AbilityFactory af;
|
AbilityFactory af;
|
||||||
MTGAbility * aNew = af.parseMagicLine(newAbilitiesList[k],NULL, NULL, _target);
|
MTGAbility * aNew = af.parseMagicLine(newAbilitiesList[k], 0, NULL, _target);
|
||||||
aNew->isClone = 1;
|
aNew->isClone = 1;
|
||||||
GenericTargetAbility * gta = dynamic_cast<GenericTargetAbility*> (aNew);
|
GenericTargetAbility * gta = dynamic_cast<GenericTargetAbility*> (aNew);
|
||||||
if (gta)
|
if (gta)
|
||||||
@@ -2506,14 +2506,14 @@ int AForeverTransformer::addToGame()
|
|||||||
{
|
{
|
||||||
_target->basicAbilities[*it]++;
|
_target->basicAbilities[*it]++;
|
||||||
}
|
}
|
||||||
if(newAbilityFound)
|
if (newAbilityFound)
|
||||||
{
|
{
|
||||||
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
|
for (unsigned int k = 0 ; k < newAbilitiesList.size();k++)
|
||||||
{
|
{
|
||||||
AbilityFactory af;
|
AbilityFactory af;
|
||||||
MTGAbility * aNew = af.parseMagicLine(newAbilitiesList[k],NULL, NULL, _target);
|
MTGAbility * aNew = af.parseMagicLine(newAbilitiesList[k], 0, NULL, _target);
|
||||||
aNew->isClone = 1;
|
aNew->isClone = 1;
|
||||||
|
|
||||||
GenericTargetAbility * gta = dynamic_cast<GenericTargetAbility*> (aNew);
|
GenericTargetAbility * gta = dynamic_cast<GenericTargetAbility*> (aNew);
|
||||||
if (gta)
|
if (gta)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1137,7 +1137,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
{
|
{
|
||||||
SAFE_DELETE(tc);
|
SAFE_DELETE(tc);
|
||||||
vector<string> multiEffects = split(s,'&');
|
vector<string> multiEffects = split(s,'&');
|
||||||
MultiAbility * multi = NEW MultiAbility(id, card, target, NULL, NULL);
|
MultiAbility * multi = NEW MultiAbility(id, card, target, NULL, 0);
|
||||||
for(unsigned int i = 0;i < multiEffects.size();i++)
|
for(unsigned int i = 0;i < multiEffects.size();i++)
|
||||||
{
|
{
|
||||||
if(!multiEffects[i].empty())
|
if(!multiEffects[i].empty())
|
||||||
@@ -1782,7 +1782,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
tokenId = 0;
|
tokenId = 0;
|
||||||
ATokenCreator * tok = NEW ATokenCreator(id, card,target, NULL, "ID NOT FOUND", "ERROR ID", NULL, NULL, "", 0, NULL);
|
ATokenCreator * tok = NEW ATokenCreator(id, card, target, NULL, "ID NOT FOUND", "ERROR ID", 0, 0, "", 0, NULL);
|
||||||
return tok;
|
return tok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ void MTGCardInstance::initMTGCI()
|
|||||||
isRedAndWhite = 0;
|
isRedAndWhite = 0;
|
||||||
isLeveler = 0;
|
isLeveler = 0;
|
||||||
enchanted = false;
|
enchanted = false;
|
||||||
CDenchanted = NULL;
|
CDenchanted = 0;
|
||||||
CDdamaged = 0;
|
CDdamaged = 0;
|
||||||
blinked = false;
|
blinked = false;
|
||||||
isExtraCostTarget = false;
|
isExtraCostTarget = false;
|
||||||
@@ -140,7 +140,7 @@ void MTGCardInstance::initMTGCI()
|
|||||||
didattacked = 0;
|
didattacked = 0;
|
||||||
didblocked = 0;
|
didblocked = 0;
|
||||||
notblocked = 0;
|
notblocked = 0;
|
||||||
sunburst = NULL;
|
sunburst = 0;
|
||||||
equipment = 0;
|
equipment = 0;
|
||||||
auras = 0;
|
auras = 0;
|
||||||
damageToOpponent = false;
|
damageToOpponent = false;
|
||||||
|
|||||||
@@ -372,9 +372,7 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
|||||||
void MTGAllCards::initCounters()
|
void MTGAllCards::initCounters()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < Constants::MTG_NB_COLORS; i++)
|
for (int i = 0; i < Constants::MTG_NB_COLORS; i++)
|
||||||
{
|
colorsCount[i] = 0;
|
||||||
colorsCount[i] = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MTGAllCards::init()
|
void MTGAllCards::init()
|
||||||
|
|||||||
Reference in New Issue
Block a user