mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 10:39:39 +00:00
Savegame: Disable CustomData load optimization for npcs and creatures for now to preserve compatibility (still enabled for containers)
This commit is contained in:
parent
d878456d0f
commit
4234c70232
2 changed files with 13 additions and 0 deletions
|
@ -798,6 +798,12 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
const ESM::CreatureState& state2 = dynamic_cast<const ESM::CreatureState&> (state);
|
const ESM::CreatureState& state2 = dynamic_cast<const ESM::CreatureState&> (state);
|
||||||
|
|
||||||
|
ensureCustomData(ptr);
|
||||||
|
|
||||||
|
// If we do the following instead we get a sizable speedup, but this causes compatibility issues
|
||||||
|
// with 0.30 savegames, where some state in CreatureStats was not saved yet,
|
||||||
|
// and therefore needs to be loaded from ESM records. TODO: re-enable this in a future release.
|
||||||
|
/*
|
||||||
if (!ptr.getRefData().getCustomData())
|
if (!ptr.getRefData().getCustomData())
|
||||||
{
|
{
|
||||||
// Create a CustomData, but don't fill it from ESM records (not needed)
|
// Create a CustomData, but don't fill it from ESM records (not needed)
|
||||||
|
@ -812,6 +818,7 @@ namespace MWClass
|
||||||
|
|
||||||
ptr.getRefData().setCustomData (data.release());
|
ptr.getRefData().setCustomData (data.release());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
CreatureCustomData& customData = dynamic_cast<CreatureCustomData&> (*ptr.getRefData().getCustomData());
|
CreatureCustomData& customData = dynamic_cast<CreatureCustomData&> (*ptr.getRefData().getCustomData());
|
||||||
|
|
||||||
|
|
|
@ -1293,12 +1293,18 @@ namespace MWClass
|
||||||
{
|
{
|
||||||
const ESM::NpcState& state2 = dynamic_cast<const ESM::NpcState&> (state);
|
const ESM::NpcState& state2 = dynamic_cast<const ESM::NpcState&> (state);
|
||||||
|
|
||||||
|
ensureCustomData(ptr);
|
||||||
|
// If we do the following instead we get a sizable speedup, but this causes compatibility issues
|
||||||
|
// with 0.30 savegames, where some state in CreatureStats was not saved yet,
|
||||||
|
// and therefore needs to be loaded from ESM records. TODO: re-enable this in a future release.
|
||||||
|
/*
|
||||||
if (!ptr.getRefData().getCustomData())
|
if (!ptr.getRefData().getCustomData())
|
||||||
{
|
{
|
||||||
// Create a CustomData, but don't fill it from ESM records (not needed)
|
// Create a CustomData, but don't fill it from ESM records (not needed)
|
||||||
std::auto_ptr<NpcCustomData> data (new NpcCustomData);
|
std::auto_ptr<NpcCustomData> data (new NpcCustomData);
|
||||||
ptr.getRefData().setCustomData (data.release());
|
ptr.getRefData().setCustomData (data.release());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
NpcCustomData& customData = dynamic_cast<NpcCustomData&> (*ptr.getRefData().getCustomData());
|
NpcCustomData& customData = dynamic_cast<NpcCustomData&> (*ptr.getRefData().getCustomData());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue