AiTravel: store mHidden flag in savegame

pull/456/head
Andrei Kortunov 7 years ago
parent 2f5beb8853
commit 3a0ee78d2b

@ -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)

@ -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;

@ -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)

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

@ -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)
{

Loading…
Cancel
Save