Fix camera not being attached properly when player becomes vampire (Fixes #2319)

openmw-35
scrawl 10 years ago
parent 9bcc84ceec
commit f4c8064d39

@ -453,6 +453,7 @@ namespace MWBase
/// \todo Probably shouldn't be here
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr) = 0;
virtual void reattachPlayerCamera() = 0;
/// \todo this does not belong here
virtual void frameStarted (float dt, bool paused) = 0;

@ -1020,7 +1020,10 @@ void NpcAnimation::setVampire(bool vampire)
return;
if ((mNpcType == Type_Vampire) != vampire)
{
rebuild();
if (mPtr == MWBase::Environment::get().getWorld()->getPlayerPtr())
MWBase::Environment::get().getWorld()->reattachPlayerCamera();
else
rebuild();
}
}

@ -2457,6 +2457,11 @@ namespace MWWorld
return mLevitationEnabled;
}
void World::reattachPlayerCamera()
{
mRendering->rebuildPtr(getPlayerPtr());
}
void World::setWerewolf(const MWWorld::Ptr& actor, bool werewolf)
{
MWMechanics::NpcStats& npcStats = actor.getClass().getNpcStats(actor);

@ -537,6 +537,7 @@ namespace MWWorld
/// \todo Probably shouldn't be here
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr);
virtual void reattachPlayerCamera();
/// \todo this does not belong here
virtual void frameStarted (float dt, bool paused);

Loading…
Cancel
Save