|
|
@ -324,16 +324,20 @@ namespace MWMechanics
|
|
|
|
|
|
|
|
|
|
|
|
Make it easy to get an effect's duration
|
|
|
|
Make it easy to get an effect's duration
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
float ActiveSpells::getEffectDuration(short effectId)
|
|
|
|
float ActiveSpells::getEffectDuration(short effectId, std::string sourceId)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (TContainer::iterator it = mSpells.begin(); it != mSpells.end(); ++it)
|
|
|
|
for (TContainer::iterator it = mSpells.begin(); it != mSpells.end(); ++it)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (sourceId.compare(it->first) == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (std::vector<ActiveEffect>::iterator effectIt = it->second.mEffects.begin();
|
|
|
|
for (std::vector<ActiveEffect>::iterator effectIt = it->second.mEffects.begin();
|
|
|
|
effectIt != it->second.mEffects.end();)
|
|
|
|
effectIt != it->second.mEffects.end(); it++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if (effectIt->mEffectId == effectId)
|
|
|
|
return effectIt->mDuration;
|
|
|
|
return effectIt->mDuration;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return 0.f;
|
|
|
|
return 0.f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|