diff --git a/AUTHORS.md b/AUTHORS.md index c3a27dea2..c806a96d0 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -135,6 +135,7 @@ Programmers Mitchell Schwitzer (schwitzerm) naclander Narmo + Nat Meo (Utopium) Nathan Jeffords (blunted2night) NeveHanter Nialsy diff --git a/CHANGELOG.md b/CHANGELOG.md index b344edcca..d05942952 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ Bug #4800: Standing collisions are not updated immediately when an object is teleported without a cell change Bug #4803: Stray special characters before begin statement break script compilation Bug #4804: Particle system with the "Has Sizes = false" causes an exception + Bug #4805: NPC movement speed calculations do not take race Weight into account Bug #4810: Raki creature broken in OpenMW Bug #4813: Creatures with known file but no "Sound Gen Creature" assigned use default sounds Bug #4815: "Finished" journal entry with lower index doesn't close journal, SetJournalIndex closes journal diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 8dd5c4297..c8a99174b 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -2368,6 +2368,19 @@ void CharacterController::update(float duration, bool animationOnly) else moved = osg::Vec3f(0.f, 0.f, 0.f); + float scale = mPtr.getCellRef().getScale(); + moved.x() *= scale; + moved.y() *= scale; + + if(mPtr.getClass().isNpc()) + { + const ESM::NPC* npc = mPtr.get()->mBase; + const ESM::Race* race = world->getStore().get().find(npc->mRace); + float weight = npc->isMale() ? race->mData.mWeight.mMale : race->mData.mWeight.mFemale; + moved.x() *= weight; + moved.y() *= weight; + } + // Ensure we're moving in generally the right direction... if(speed > 0.f) {