File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -935,8 +935,12 @@ namespace MWClass
935
935
936
936
const float normalizedEncumbrance = getNormalizedEncumbrance (ptr);
937
937
938
- bool sneaking = MWBase::Environment::get ().getMechanicsManager ()->isSneaking (ptr) && stats.getStance (MWMechanics::CreatureStats::Stance_Sneak);
939
- bool running = MWBase::Environment::get ().getMechanicsManager ()->isRunning (ptr) && stats.getStance (MWMechanics::CreatureStats::Stance_Run);
938
+ bool swimming = world->isSwimming (ptr);
939
+ bool inair = !world->isOnGround (ptr) && !swimming && !world->isFlying (ptr);
940
+ bool sneaking = stats.getStance (MWMechanics::CreatureStats::Stance_Sneak);
941
+ sneaking = sneaking && (inair || MWBase::Environment::get ().getMechanicsManager ()->isSneaking (ptr));
942
+ bool running = stats.getStance (MWMechanics::CreatureStats::Stance_Run);
943
+ running = running && (inair || MWBase::Environment::get ().getMechanicsManager ()->isRunning (ptr));
940
944
941
945
float walkSpeed = gmst.fMinWalkSpeed ->mValue .getFloat () + 0 .01f *npcdata->mNpcStats .getAttribute (ESM::Attribute::Speed).getModified ()*
942
946
(gmst.fMaxWalkSpeed ->mValue .getFloat () - gmst.fMinWalkSpeed ->mValue .getFloat ());
@@ -961,7 +965,7 @@ namespace MWClass
961
965
flySpeed = std::max (0 .0f , flySpeed);
962
966
moveSpeed = flySpeed;
963
967
}
964
- else if (world-> isSwimming (ptr) )
968
+ else if (swimming )
965
969
{
966
970
float swimSpeed = walkSpeed;
967
971
if (running)
@@ -971,7 +975,7 @@ namespace MWClass
971
975
gmst.fSwimRunAthleticsMult ->mValue .getFloat ();
972
976
moveSpeed = swimSpeed;
973
977
}
974
- else if (running)
978
+ else if (running && !sneaking )
975
979
moveSpeed = runSpeed;
976
980
else
977
981
moveSpeed = walkSpeed;
You can’t perform that action at this time.
0 commit comments