mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:23:51 +00:00
Force walk animation when flying (Fixes #2015)
This commit is contained in:
parent
6d7f4085a5
commit
f117a75747
1 changed files with 4 additions and 2 deletions
|
@ -387,7 +387,8 @@ void CharacterController::refreshCurrentAnims(CharacterState idle, CharacterStat
|
||||||
{
|
{
|
||||||
float vel, speedmult = 1.0f;
|
float vel, speedmult = 1.0f;
|
||||||
|
|
||||||
bool isrunning = mPtr.getClass().getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Run);
|
bool isrunning = mPtr.getClass().getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Run)
|
||||||
|
&& !MWBase::Environment::get().getWorld()->isFlying(mPtr);
|
||||||
|
|
||||||
// For non-flying creatures, MW uses the Walk animation to calculate the animation velocity
|
// For non-flying creatures, MW uses the Walk animation to calculate the animation velocity
|
||||||
// even if we are running. This must be replicated, otherwise the observed speed would differ drastically.
|
// even if we are running. This must be replicated, otherwise the observed speed would differ drastically.
|
||||||
|
@ -1269,9 +1270,10 @@ void CharacterController::update(float duration)
|
||||||
{
|
{
|
||||||
bool onground = world->isOnGround(mPtr);
|
bool onground = world->isOnGround(mPtr);
|
||||||
bool inwater = world->isSwimming(mPtr);
|
bool inwater = world->isSwimming(mPtr);
|
||||||
bool isrunning = cls.getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Run);
|
|
||||||
bool sneak = cls.getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Sneak);
|
bool sneak = cls.getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Sneak);
|
||||||
bool flying = world->isFlying(mPtr);
|
bool flying = world->isFlying(mPtr);
|
||||||
|
// Can't run while flying (see speed formula in Npc/Creature::getSpeed)
|
||||||
|
bool isrunning = cls.getCreatureStats(mPtr).getStance(MWMechanics::CreatureStats::Stance_Run) && !flying;
|
||||||
CreatureStats &stats = cls.getCreatureStats(mPtr);
|
CreatureStats &stats = cls.getCreatureStats(mPtr);
|
||||||
|
|
||||||
//Force Jump Logic
|
//Force Jump Logic
|
||||||
|
|
Loading…
Reference in a new issue