forked from teamnwah/openmw-tes3coop
Fix camera not being attached properly when player becomes vampire (Fixes #2319)
This commit is contained in:
parent
9bcc84ceec
commit
f4c8064d39
4 changed files with 11 additions and 1 deletions
|
@ -453,6 +453,7 @@ namespace MWBase
|
||||||
|
|
||||||
/// \todo Probably shouldn't be here
|
/// \todo Probably shouldn't be here
|
||||||
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr) = 0;
|
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr) = 0;
|
||||||
|
virtual void reattachPlayerCamera() = 0;
|
||||||
|
|
||||||
/// \todo this does not belong here
|
/// \todo this does not belong here
|
||||||
virtual void frameStarted (float dt, bool paused) = 0;
|
virtual void frameStarted (float dt, bool paused) = 0;
|
||||||
|
|
|
@ -1020,7 +1020,10 @@ void NpcAnimation::setVampire(bool vampire)
|
||||||
return;
|
return;
|
||||||
if ((mNpcType == Type_Vampire) != vampire)
|
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;
|
return mLevitationEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void World::reattachPlayerCamera()
|
||||||
|
{
|
||||||
|
mRendering->rebuildPtr(getPlayerPtr());
|
||||||
|
}
|
||||||
|
|
||||||
void World::setWerewolf(const MWWorld::Ptr& actor, bool werewolf)
|
void World::setWerewolf(const MWWorld::Ptr& actor, bool werewolf)
|
||||||
{
|
{
|
||||||
MWMechanics::NpcStats& npcStats = actor.getClass().getNpcStats(actor);
|
MWMechanics::NpcStats& npcStats = actor.getClass().getNpcStats(actor);
|
||||||
|
|
|
@ -537,6 +537,7 @@ namespace MWWorld
|
||||||
|
|
||||||
/// \todo Probably shouldn't be here
|
/// \todo Probably shouldn't be here
|
||||||
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr);
|
virtual MWRender::Animation* getAnimation(const MWWorld::Ptr &ptr);
|
||||||
|
virtual void reattachPlayerCamera();
|
||||||
|
|
||||||
/// \todo this does not belong here
|
/// \todo this does not belong here
|
||||||
virtual void frameStarted (float dt, bool paused);
|
virtual void frameStarted (float dt, bool paused);
|
||||||
|
|
Loading…
Reference in a new issue