mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 13:49:40 +00:00
Make sure birthsign spells are added when loading savegame
This commit is contained in:
parent
d18d2a1882
commit
01b4177872
1 changed files with 14 additions and 3 deletions
|
@ -260,9 +260,20 @@ namespace MWWorld
|
|||
mCellStore = world.getExterior(0,0);
|
||||
}
|
||||
|
||||
if (!player.mBirthsign.empty() &&
|
||||
!world.getStore().get<ESM::BirthSign>().search (player.mBirthsign))
|
||||
throw std::runtime_error ("invalid player state record (birthsign)");
|
||||
if (!player.mBirthsign.empty())
|
||||
{
|
||||
const ESM::BirthSign* sign = world.getStore().get<ESM::BirthSign>().search (player.mBirthsign);
|
||||
if (!sign)
|
||||
throw std::runtime_error ("invalid player state record (birthsign does not exist)");
|
||||
|
||||
// To handle the case where a birth sign was edited in between play sessions (does not yet handle removing the old spells)
|
||||
// Also needed for ess-imported savegames which do not specify the birtsign spells in the player's spell list.
|
||||
for (std::vector<std::string>::const_iterator iter (sign->mPowers.mList.begin());
|
||||
iter!=sign->mPowers.mList.end(); ++iter)
|
||||
{
|
||||
getPlayer().getClass().getCreatureStats(getPlayer()).getSpells().add (*iter);
|
||||
}
|
||||
}
|
||||
|
||||
mCurrentCrimeId = player.mCurrentCrimeId;
|
||||
mPaidCrimeId = player.mPaidCrimeId;
|
||||
|
|
Loading…
Reference in a new issue