forked from teamnwah/openmw-tes3coop
Store last AI package in savegame
This commit is contained in:
parent
3a0ee78d2b
commit
3d0631cfcc
3 changed files with 14 additions and 2 deletions
|
@ -393,6 +393,8 @@ void AiSequence::writeState(ESM::AiSequence::AiSequence &sequence) const
|
|||
{
|
||||
(*iter)->writeState(sequence);
|
||||
}
|
||||
|
||||
sequence.mLastAiPackage = mLastAiPackage;
|
||||
}
|
||||
|
||||
void AiSequence::readState(const ESM::AiSequence::AiSequence &sequence)
|
||||
|
@ -404,7 +406,7 @@ void AiSequence::readState(const ESM::AiSequence::AiSequence &sequence)
|
|||
int count = 0;
|
||||
for (std::vector<ESM::AiSequence::AiPackageContainer>::const_iterator it = sequence.mPackages.begin();
|
||||
it != sequence.mPackages.end(); ++it)
|
||||
{
|
||||
{
|
||||
if (isActualAiPackage(it->mType))
|
||||
count++;
|
||||
}
|
||||
|
@ -463,6 +465,8 @@ void AiSequence::readState(const ESM::AiSequence::AiSequence &sequence)
|
|||
|
||||
mPackages.push_back(package.release());
|
||||
}
|
||||
|
||||
mLastAiPackage = sequence.mLastAiPackage;
|
||||
}
|
||||
|
||||
void AiSequence::fastForward(const MWWorld::Ptr& actor, AiState& state)
|
||||
|
|
|
@ -156,6 +156,8 @@ namespace AiSequence
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
esm.writeHNT ("LAST", mLastAiPackage);
|
||||
}
|
||||
|
||||
void AiSequence::load(ESMReader &esm)
|
||||
|
@ -223,6 +225,8 @@ namespace AiSequence
|
|||
return;
|
||||
}
|
||||
}
|
||||
|
||||
esm.getHNOT (mLastAiPackage, "LAST");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,10 +148,14 @@ namespace ESM
|
|||
|
||||
struct AiSequence
|
||||
{
|
||||
AiSequence() {}
|
||||
AiSequence()
|
||||
{
|
||||
mLastAiPackage = -1;
|
||||
}
|
||||
~AiSequence();
|
||||
|
||||
std::vector<AiPackageContainer> mPackages;
|
||||
int mLastAiPackage;
|
||||
|
||||
void load (ESMReader &esm);
|
||||
void save (ESMWriter &esm) const;
|
||||
|
|
Loading…
Reference in a new issue