disease tests

actorid
Marc Zinnschlag 12 years ago
parent 0727d943b1
commit be1334b202

@ -232,4 +232,14 @@ namespace MWMechanics
mDead = false;
}
}
bool CreatureStats::hasCommonDisease() const
{
return mSpells.hasCommonDisease();
}
bool CreatureStats::hasBlightDisease() const
{
return mSpells.hasBlightDisease();
}
}

@ -109,6 +109,10 @@ namespace MWMechanics
bool isDead() const;
void resurrect();
bool hasCommonDisease() const;
bool hasBlightDisease() const;
};
}

@ -75,4 +75,32 @@ namespace MWMechanics
{
return mSelectedSpell;
}
bool Spells::hasCommonDisease() const
{
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
{
const ESM::Spell *spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
if (spell->mData.mFlags & ESM::Spell::ST_Disease)
return true;
}
return false;
}
bool Spells::hasBlightDisease() const
{
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
{
const ESM::Spell *spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
if (spell->mData.mFlags & ESM::Spell::ST_Blight)
return true;
}
return false;
}
}

@ -55,6 +55,10 @@ namespace MWMechanics
const std::string getSelectedSpell() const;
///< May return an empty string.
bool hasCommonDisease() const;
bool hasBlightDisease() const;
};
}

Loading…
Cancel
Save