From 9b38888ac9a80b92dd4640f72234a9a1416e9a81 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 17 Aug 2014 17:01:04 +0200 Subject: [PATCH] Add missing AiFollow ActorId initialization (Fixes #1818) --- apps/openmw/mwmechanics/aifollow.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/apps/openmw/mwmechanics/aifollow.cpp b/apps/openmw/mwmechanics/aifollow.cpp index fb24946a59..f830d09d5b 100644 --- a/apps/openmw/mwmechanics/aifollow.cpp +++ b/apps/openmw/mwmechanics/aifollow.cpp @@ -32,6 +32,15 @@ MWMechanics::AiFollow::AiFollow(const std::string &actorId, bool commanded) { } +MWMechanics::AiFollow::AiFollow(const ESM::AiSequence::AiFollow *follow) + : mAlwaysFollow(follow->mAlwaysFollow), mRemainingDuration(follow->mRemainingDuration) + , mX(follow->mData.mX), mY(follow->mData.mY), mZ(follow->mData.mZ) + , mActorRefId(follow->mTargetId), mActorId(-1), mCellId(follow->mCellId) + , mCommanded(follow->mCommanded) +{ + +} + bool MWMechanics::AiFollow::execute (const MWWorld::Ptr& actor,float duration) { MWWorld::Ptr target = getTarget(); @@ -131,15 +140,6 @@ void MWMechanics::AiFollow::writeState(ESM::AiSequence::AiSequence &sequence) co sequence.mPackages.push_back(package); } -MWMechanics::AiFollow::AiFollow(const ESM::AiSequence::AiFollow *follow) - : mAlwaysFollow(follow->mAlwaysFollow), mRemainingDuration(follow->mRemainingDuration) - , mX(follow->mData.mX), mY(follow->mData.mY), mZ(follow->mData.mZ) - , mActorRefId(follow->mTargetId), mCellId(follow->mCellId) - , mCommanded(follow->mCommanded) -{ - -} - MWWorld::Ptr MWMechanics::AiFollow::getTarget() { if (mActorId == -2)