Add mHidden field to AiTravel

0.6.3
Andrei Kortunov 7 years ago
parent 81f29d8dcd
commit 5105c67642

@ -48,7 +48,8 @@ namespace MWMechanics
TypeIdPursue = 6,
TypeIdAvoidDoor = 7,
TypeIdFace = 8,
TypeIdBreathe = 9
TypeIdBreathe = 9,
TypeIdInternalTravel = 10
};
///Default constructor

@ -28,15 +28,14 @@ bool isWithinMaxRange(const osg::Vec3f& pos1, const osg::Vec3f& pos2)
namespace MWMechanics
{
AiTravel::AiTravel(float x, float y, float z)
: mX(x),mY(y),mZ(z)
AiTravel::AiTravel(float x, float y, float z, bool hidden)
: mX(x),mY(y),mZ(z),mHidden(hidden)
{
}
AiTravel::AiTravel(const ESM::AiSequence::AiTravel *travel)
: mX(travel->mData.mX), mY(travel->mData.mY), mZ(travel->mData.mZ)
{
}
AiTravel *MWMechanics::AiTravel::clone() const
@ -64,7 +63,8 @@ namespace MWMechanics
int AiTravel::getTypeId() const
{
return TypeIdTravel;
// TODO: store mHidden in the savegame?
return mHidden ? TypeIdInternalTravel : TypeIdTravel;
}
void AiTravel::fastForward(const MWWorld::Ptr& actor, AiState& state)

@ -20,7 +20,7 @@ namespace MWMechanics
{
public:
/// Default constructor
AiTravel(float x, float y, float z);
AiTravel(float x, float y, float z, bool hidden = false);
AiTravel(const ESM::AiSequence::AiTravel* travel);
/// Simulates the passing of time
@ -38,6 +38,8 @@ namespace MWMechanics
float mX;
float mY;
float mZ;
bool mHidden;
};
}

@ -1620,7 +1620,7 @@ namespace MWMechanics
dest = activePackage->getDestination(ptr);
}
MWMechanics::AiTravel travelPackage(dest.x(), dest.y(), dest.z());
MWMechanics::AiTravel travelPackage(dest.x(), dest.y(), dest.z(), true);
aiSequence.stack(travelPackage, ptr, false);
}

Loading…
Cancel
Save