update MWBase::World interface since records contains own id

actorid
greye 12 years ago
parent f818fa1ebf
commit 9dc9098fa7

@ -230,17 +230,17 @@ namespace MWBase
///< Toggle a render mode.
///< \return Resulting mode
virtual std::pair<std::string, const ESM::Potion *> createRecord (const ESM::Potion& record)
virtual const ESM::Potion *createRecord (const ESM::Potion& record)
= 0;
///< Create a new recrod (of type potion) in the ESM store.
/// \return ID, pointer to created record
virtual std::pair<std::string, const ESM::Spell *> createRecord (const ESM::Spell& record)
virtual const ESM::Spell *createRecord (const ESM::Spell& record)
= 0;
///< Create a new recrod (of type spell) in the ESM store.
/// \return ID, pointer to created record
virtual std::pair<std::string, const ESM::Class *> createRecord (const ESM::Class& record)
virtual const ESM::Class *createRecord (const ESM::Class& record)
= 0;
///< Create a new recrod (of type class) in the ESM store.
/// \return ID, pointer to created record

@ -336,12 +336,12 @@ namespace MWGui
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);
std::pair<std::string, const ESM::Spell*> result = MWBase::Environment::get().getWorld()->createRecord(mSpell);
const ESM::Spell* spell = MWBase::Environment::get().getWorld()->createRecord(mSpell);
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
MWMechanics::CreatureStats& stats = MWWorld::Class::get(player).getCreatureStats(player);
MWMechanics::Spells& spells = stats.getSpells();
spells.add (result.first);
spells.add (spell->mId);
MWBase::Environment::get().getSoundManager()->playSound ("Item Gold Up", 1.0, 1.0);

@ -279,7 +279,7 @@ void MWMechanics::Alchemy::addPotion (const std::string& name)
newRecord.mEffects.mList = mEffects;
record = MWBase::Environment::get().getWorld()->createRecord (newRecord).second;
record = MWBase::Environment::get().getWorld()->createRecord (newRecord);
}
MWWorld::ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), record->mId);

@ -327,10 +327,9 @@ namespace MWMechanics
{
MWBase::World *world = MWBase::Environment::get().getWorld();
std::pair<std::string, const ESM::Class *> res =
world->createRecord(cls);
const ESM::Class *ptr = world->createRecord(cls);
world->getPlayer().setClass(res.second->mId);
world->getPlayer().setClass(ptr->mId);
mClassSelected = true;
buildPlayer();

@ -779,22 +779,19 @@ namespace MWWorld
return mRendering->toggleRenderMode (mode);
}
std::pair<std::string, const ESM::Potion *> World::createRecord (const ESM::Potion& record)
const ESM::Potion *World::createRecord (const ESM::Potion& record)
{
const ESM::Potion *ptr = mStore.insert(record);
return std::make_pair(ptr->mId, ptr);
return mStore.insert(record);
}
std::pair<std::string, const ESM::Class *> World::createRecord (const ESM::Class& record)
const ESM::Class *World::createRecord (const ESM::Class& record)
{
const ESM::Class *ptr = mStore.insert(record);
return std::make_pair(ptr->mId, ptr);
return mStore.insert(record);
}
std::pair<std::string, const ESM::Spell *> World::createRecord (const ESM::Spell& record)
const ESM::Spell *World::createRecord (const ESM::Spell& record)
{
const ESM::Spell *ptr = mStore.insert(record);
return std::make_pair(ptr->mId, ptr);
return mStore.insert(record);
}
const ESM::Cell *World::createRecord (const ESM::Cell& record)

@ -250,15 +250,15 @@ namespace MWWorld
///< Toggle a render mode.
///< \return Resulting mode
virtual std::pair<std::string, const ESM::Potion *> createRecord (const ESM::Potion& record);
virtual const ESM::Potion *createRecord (const ESM::Potion& record);
///< Create a new recrod (of type potion) in the ESM store.
/// \return ID, pointer to created record
virtual std::pair<std::string, const ESM::Spell *> createRecord (const ESM::Spell& record);
virtual const ESM::Spell *createRecord (const ESM::Spell& record);
///< Create a new recrod (of type spell) in the ESM store.
/// \return ID, pointer to created record
virtual std::pair<std::string, const ESM::Class *> createRecord (const ESM::Class& record);
virtual const ESM::Class *createRecord (const ESM::Class& record);
///< Create a new recrod (of type class) in the ESM store.
/// \return ID, pointer to created record

Loading…
Cancel
Save