1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 19:19:56 +00:00

AiTravel: store mHidden flag in savegame

This commit is contained in:
Andrei Kortunov 2018-05-25 19:31:31 +04:00
parent 2f5beb8853
commit 3a0ee78d2b
5 changed files with 8 additions and 4 deletions

View file

@ -184,7 +184,8 @@ bool isActualAiPackage(int packageTypeId)
&& packageTypeId != AiPackage::TypeIdPursue
&& packageTypeId != AiPackage::TypeIdAvoidDoor
&& packageTypeId != AiPackage::TypeIdFace
&& packageTypeId != AiPackage::TypeIdBreathe);
&& packageTypeId != AiPackage::TypeIdBreathe
&& packageTypeId != AiPackage::TypeIdInternalTravel);
}
void AiSequence::execute (const MWWorld::Ptr& actor, CharacterController& characterController, AiState& state, float duration)

View file

@ -34,7 +34,7 @@ namespace MWMechanics
}
AiTravel::AiTravel(const ESM::AiSequence::AiTravel *travel)
: mX(travel->mData.mX), mY(travel->mData.mY), mZ(travel->mData.mZ)
: mX(travel->mData.mX), mY(travel->mData.mY), mZ(travel->mData.mZ), mHidden(travel->mHidden)
{
}
@ -63,7 +63,6 @@ namespace MWMechanics
int AiTravel::getTypeId() const
{
// TODO: store mHidden in the savegame?
return mHidden ? TypeIdInternalTravel : TypeIdTravel;
}
@ -83,6 +82,7 @@ namespace MWMechanics
travel->mData.mX = mX;
travel->mData.mY = mY;
travel->mData.mZ = mZ;
travel->mHidden = mHidden;
ESM::AiSequence::AiPackageContainer package;
package.mType = ESM::AiSequence::Ai_Travel;

View file

@ -35,11 +35,13 @@ namespace AiSequence
void AiTravel::load(ESMReader &esm)
{
esm.getHNT (mData, "DATA");
esm.getHNOT (mHidden, "HIDD");
}
void AiTravel::save(ESMWriter &esm) const
{
esm.writeHNT ("DATA", mData);
esm.writeHNT ("HIDD", mHidden);
}
void AiEscort::load(ESMReader &esm)

View file

@ -80,6 +80,7 @@ namespace ESM
struct AiTravel : AiPackage
{
AiTravelData mData;
bool mHidden;
void load(ESMReader &esm);
void save(ESMWriter &esm) const;

View file

@ -5,7 +5,7 @@
#include "defs.hpp"
unsigned int ESM::SavedGame::sRecordId = ESM::REC_SAVE;
int ESM::SavedGame::sCurrentFormat = 3;
int ESM::SavedGame::sCurrentFormat = 4;
void ESM::SavedGame::load (ESMReader &esm)
{