forked from teamnwah/openmw-tes3coop
Fixes #1224: Store class name instead of id in savegame header
This commit is contained in:
parent
793649c854
commit
53ba23e303
4 changed files with 10 additions and 5 deletions
|
@ -86,7 +86,7 @@ namespace MWGui
|
|||
{
|
||||
std::stringstream title;
|
||||
title << it->getSignature().mPlayerName;
|
||||
title << " (Level " << it->getSignature().mPlayerLevel << " " << it->getSignature().mPlayerClass << ")";
|
||||
title << " (Level " << it->getSignature().mPlayerLevel << " " << it->getSignature().mPlayerClassName << ")";
|
||||
|
||||
mCharacterSelection->addItem (title.str());
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ void MWState::StateManager::saveGame (const std::string& description, const Slot
|
|||
|
||||
profile.mPlayerName = player.getClass().getName (player);
|
||||
profile.mPlayerLevel = player.getClass().getNpcStats (player).getLevel();
|
||||
profile.mPlayerClass = player.get<ESM::NPC>()->mBase->mClass;
|
||||
profile.mPlayerClassName = world.getStore().get<ESM::Class>().find(player.get<ESM::NPC>()->mBase->mClass)->mName;
|
||||
|
||||
profile.mPlayerCell = world.getCellName();
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ void ESM::SavedGame::load (ESMReader &esm)
|
|||
{
|
||||
mPlayerName = esm.getHNString("PLNA");
|
||||
esm.getHNOT (mPlayerLevel, "PLLE");
|
||||
mPlayerClass = esm.getHNString("PLCL");
|
||||
mPlayerClassName = esm.getHNString("PLCL");
|
||||
mPlayerCell = esm.getHNString("PLCE");
|
||||
esm.getHNT (mInGameTime, "TSTM", 16);
|
||||
esm.getHNT (mTimePlayed, "TIME");
|
||||
|
@ -30,7 +30,7 @@ void ESM::SavedGame::save (ESMWriter &esm) const
|
|||
{
|
||||
esm.writeHNString ("PLNA", mPlayerName);
|
||||
esm.writeHNT ("PLLE", mPlayerLevel);
|
||||
esm.writeHNString ("PLCL", mPlayerClass);
|
||||
esm.writeHNString ("PLCL", mPlayerClassName);
|
||||
esm.writeHNString ("PLCE", mPlayerCell);
|
||||
esm.writeHNT ("TSTM", mInGameTime, 16);
|
||||
esm.writeHNT ("TIME", mTimePlayed);
|
||||
|
|
|
@ -26,7 +26,12 @@ namespace ESM
|
|||
std::vector<std::string> mContentFiles;
|
||||
std::string mPlayerName;
|
||||
int mPlayerLevel;
|
||||
std::string mPlayerClass; // this is the ID and not the name of the class
|
||||
// The (translated) name of the player class. So it will be displayed in the MW language
|
||||
// the savegame was made in, not the currently running language of MW.
|
||||
// However, savegames from a different MW language are not compatible anyway.
|
||||
// And if only the ID was stored here, we would need to
|
||||
// peek into the savegame to look for a class record in case it is a custom class.
|
||||
std::string mPlayerClassName;
|
||||
std::string mPlayerCell;
|
||||
TimeStamp mInGameTime;
|
||||
double mTimePlayed;
|
||||
|
|
Loading…
Reference in a new issue