Merge branch 'cherry-pick-98f52fa8' into 'master'

Issue 4805 MR attempt #2

See merge request OpenMW/openmw!95
pull/541/head
Alexei Dobrohotov 6 years ago
commit ef985ab422

@ -135,6 +135,7 @@ Programmers
Mitchell Schwitzer (schwitzerm)
naclander
Narmo
Nat Meo (Utopium)
Nathan Jeffords (blunted2night)
NeveHanter
Nialsy

@ -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

@ -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<ESM::NPC>()->mBase;
const ESM::Race* race = world->getStore().get<ESM::Race>().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)
{

Loading…
Cancel
Save