1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-21 07:39:40 +00:00

Issue #479: Added additional magnitude parameter to known spells

This commit is contained in:
Marc Zinnschlag 2013-01-12 13:10:20 +01:00
parent ecdd89a4f3
commit f4ee8e2642
7 changed files with 29 additions and 29 deletions

View file

@ -440,7 +440,7 @@ namespace MWGui
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
{
spellList.push_back(*it);
spellList.push_back (it->first);
}
const MWWorld::ESMStore &esmStore =

View file

@ -102,7 +102,7 @@ namespace MWGui
for (MWMechanics::Spells::TIterator iter = merchantSpells.begin(); iter!=merchantSpells.end(); ++iter)
{
const ESM::Spell* spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (iter->first);
if (spell->mData.mType!=ESM::Spell::ST_Spell)
continue; // don't try to sell diseases, curses or powers
@ -110,7 +110,7 @@ namespace MWGui
if (std::find (playerSpells.begin(), playerSpells.end(), *iter)!=playerSpells.end())
continue; // we have that spell already
addSpell (*iter);
addSpell (iter->first);
}
updateLabels();

View file

@ -436,7 +436,7 @@ namespace MWGui
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
{
const ESM::Spell* spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find(*it);
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (it->first);
// only normal spells count
if (spell->mData.mType != ESM::Spell::ST_Spell)

View file

@ -139,7 +139,7 @@ namespace MWGui
for (MWMechanics::Spells::TIterator it = spells.begin(); it != spells.end(); ++it)
{
spellList.push_back(*it);
spellList.push_back (it->first);
}
const MWWorld::ESMStore &esmStore =

View file

@ -29,13 +29,13 @@ namespace MWMechanics
void Spells::add (const std::string& spellId)
{
if (std::find (mSpells.begin(), mSpells.end(), spellId)==mSpells.end())
mSpells.push_back (spellId);
if (mSpells.find (spellId)==mSpells.end())
mSpells.insert (std::make_pair (spellId, -1));
}
void Spells::remove (const std::string& spellId)
{
TContainer::iterator iter = std::find (mSpells.begin(), mSpells.end(), spellId);
TContainer::iterator iter = mSpells.find (spellId);
if (iter!=mSpells.end())
mSpells.erase (iter);
@ -51,7 +51,7 @@ namespace MWMechanics
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
{
const ESM::Spell *spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (iter->first);
if (spell->mData.mType==ESM::Spell::ST_Ability || spell->mData.mType==ESM::Spell::ST_Blight ||
spell->mData.mType==ESM::Spell::ST_Disease || spell->mData.mType==ESM::Spell::ST_Curse)
@ -81,7 +81,7 @@ namespace MWMechanics
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
{
const ESM::Spell *spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (iter->first);
if (spell->mData.mFlags & ESM::Spell::ST_Disease)
return true;
@ -95,7 +95,7 @@ namespace MWMechanics
for (TIterator iter = mSpells.begin(); iter!=mSpells.end(); ++iter)
{
const ESM::Spell *spell =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (*iter);
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (iter->first);
if (spell->mData.mFlags & ESM::Spell::ST_Blight)
return true;

View file

@ -1,7 +1,7 @@
#ifndef GAME_MWMECHANICS_SPELLS_H
#define GAME_MWMECHANICS_SPELLS_H
#include <vector>
#include <map>
#include <string>
namespace ESM
@ -21,12 +21,12 @@ namespace MWMechanics
{
public:
typedef std::vector<std::string> TContainer;
typedef std::map<std::string, float> TContainer; // ID, magnitude
typedef TContainer::const_iterator TIterator;
private:
std::vector<std::string> mSpells;
TContainer mSpells;
std::string mSelectedSpell;
void addSpell (const ESM::Spell *, MagicEffects& effects) const;

View file

@ -485,7 +485,7 @@ namespace MWScript
for (MWMechanics::Spells::TIterator iter (
MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().begin());
iter!=MWWorld::Class::get (ptr).getCreatureStats (ptr).getSpells().end(); ++iter)
if (*iter==id)
if (iter->first==id)
{
value = 1;
break;