forked from mirror/openmw-tes3mp
Store previous items in the savegame
This commit is contained in:
parent
9fd2d57b86
commit
acd3cba5fa
5 changed files with 27 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
0.45.0
|
0.45.0
|
||||||
------
|
------
|
||||||
|
|
||||||
|
Bug #2326: After a bound item expires the last equipped item of that type is not automatically re-equipped
|
||||||
Bug #2835: Player able to slowly move when overencumbered
|
Bug #2835: Player able to slowly move when overencumbered
|
||||||
Bug #3374: Touch spells not hitting kwama foragers
|
Bug #3374: Touch spells not hitting kwama foragers
|
||||||
Bug #3591: Angled hit distance too low
|
Bug #3591: Angled hit distance too low
|
||||||
|
|
|
@ -342,6 +342,8 @@ namespace MWWorld
|
||||||
for (int i=0; i<ESM::Skill::Length; ++i)
|
for (int i=0; i<ESM::Skill::Length; ++i)
|
||||||
mSaveSkills[i].writeState(player.mSaveSkills[i]);
|
mSaveSkills[i].writeState(player.mSaveSkills[i]);
|
||||||
|
|
||||||
|
player.mPreviousItems = mPreviousItems;
|
||||||
|
|
||||||
writer.startRecord (ESM::REC_PLAY);
|
writer.startRecord (ESM::REC_PLAY);
|
||||||
player.save (writer);
|
player.save (writer);
|
||||||
writer.endRecord (ESM::REC_PLAY);
|
writer.endRecord (ESM::REC_PLAY);
|
||||||
|
@ -442,6 +444,8 @@ namespace MWWorld
|
||||||
mForwardBackward = 0;
|
mForwardBackward = 0;
|
||||||
mTeleported = false;
|
mTeleported = false;
|
||||||
|
|
||||||
|
mPreviousItems = player.mPreviousItems;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,18 @@ void ESM::Player::load (ESMReader &esm)
|
||||||
mPaidCrimeId = -1;
|
mPaidCrimeId = -1;
|
||||||
esm.getHNOT (mPaidCrimeId, "PAYD");
|
esm.getHNOT (mPaidCrimeId, "PAYD");
|
||||||
|
|
||||||
|
bool checkPrevItems = true;
|
||||||
|
while (checkPrevItems)
|
||||||
|
{
|
||||||
|
std::string boundItemId = esm.getHNOString("BOUN");
|
||||||
|
std::string prevItemId = esm.getHNOString("PREV");
|
||||||
|
|
||||||
|
if (!boundItemId.empty())
|
||||||
|
mPreviousItems[boundItemId] = prevItemId;
|
||||||
|
else
|
||||||
|
checkPrevItems = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (esm.hasMoreSubs())
|
if (esm.hasMoreSubs())
|
||||||
{
|
{
|
||||||
for (int i=0; i<ESM::Attribute::Length; ++i)
|
for (int i=0; i<ESM::Attribute::Length; ++i)
|
||||||
|
@ -62,6 +74,12 @@ void ESM::Player::save (ESMWriter &esm) const
|
||||||
esm.writeHNT ("CURD", mCurrentCrimeId);
|
esm.writeHNT ("CURD", mCurrentCrimeId);
|
||||||
esm.writeHNT ("PAYD", mPaidCrimeId);
|
esm.writeHNT ("PAYD", mPaidCrimeId);
|
||||||
|
|
||||||
|
for (PreviousItems::const_iterator it=mPreviousItems.begin(); it != mPreviousItems.end(); ++it)
|
||||||
|
{
|
||||||
|
esm.writeHNString ("BOUN", it->first);
|
||||||
|
esm.writeHNString ("PREV", it->second);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i=0; i<ESM::Attribute::Length; ++i)
|
for (int i=0; i<ESM::Attribute::Length; ++i)
|
||||||
mSaveAttributes[i].save(esm);
|
mSaveAttributes[i].save(esm);
|
||||||
for (int i=0; i<ESM::Skill::Length; ++i)
|
for (int i=0; i<ESM::Skill::Length; ++i)
|
||||||
|
|
|
@ -34,6 +34,9 @@ namespace ESM
|
||||||
StatState<int> mSaveAttributes[ESM::Attribute::Length];
|
StatState<int> mSaveAttributes[ESM::Attribute::Length];
|
||||||
StatState<int> mSaveSkills[ESM::Skill::Length];
|
StatState<int> mSaveSkills[ESM::Skill::Length];
|
||||||
|
|
||||||
|
typedef std::map<std::string, std::string> PreviousItems; // previous equipped items, needed for bound spells
|
||||||
|
PreviousItems mPreviousItems;
|
||||||
|
|
||||||
void load (ESMReader &esm);
|
void load (ESMReader &esm);
|
||||||
void save (ESMWriter &esm) const;
|
void save (ESMWriter &esm) const;
|
||||||
};
|
};
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
#include "defs.hpp"
|
#include "defs.hpp"
|
||||||
|
|
||||||
unsigned int ESM::SavedGame::sRecordId = ESM::REC_SAVE;
|
unsigned int ESM::SavedGame::sRecordId = ESM::REC_SAVE;
|
||||||
int ESM::SavedGame::sCurrentFormat = 4;
|
int ESM::SavedGame::sCurrentFormat = 5;
|
||||||
|
|
||||||
void ESM::SavedGame::load (ESMReader &esm)
|
void ESM::SavedGame::load (ESMReader &esm)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue