Do not scale player's model in the 1st-person view depending on race (bug #4383)

pull/541/head
Andrei Kortunov 6 years ago
parent 91ec1d1c2c
commit 02a43d0b32

@ -4,6 +4,7 @@
Bug #2987: Editor: some chance and AI data fields can overflow
Bug #3623: Fix HiDPI on Windows
Bug #4411: Reloading a saved game while falling prevents damage in some cases
Bug #4383: Bow model obscures crosshair when arrow is drawn
Bug #4540: Rain delay when exiting water
Bug #4701: PrisonMarker record is not hardcoded like other markers
Bug #4714: Crash upon game load in the repair menu while the "Your repair failed!" message is active

@ -1172,6 +1172,17 @@ namespace MWClass
const ESM::Race* race =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Race>().find(ref->mBase->mRace);
// Race weight should not affect 1st-person meshes, otherwise it will change hand proportions and can break aiming.
if (ptr == MWMechanics::getPlayer() && MWBase::Environment::get().getWorld()->isFirstPerson())
{
if (ref->mBase->isMale())
scale *= race->mData.mHeight.mMale;
else
scale *= race->mData.mHeight.mFemale;
return;
}
if (ref->mBase->isMale())
{
scale.x() *= race->mData.mWeight.mMale;
@ -1184,7 +1195,6 @@ namespace MWClass
scale.y() *= race->mData.mWeight.mFemale;
scale.z() *= race->mData.mHeight.mFemale;
}
}
int Npc::getServices(const MWWorld::ConstPtr &actor) const

@ -317,8 +317,9 @@ void NpcAnimation::setViewMode(NpcAnimation::ViewMode viewMode)
mWeaponSheathing = Settings::Manager::getBool("weapon sheathing", "Game");
mViewMode = viewMode;
rebuild();
MWBase::Environment::get().getWorld()->scaleObject(mPtr, mPtr.getCellRef().getScale()); // apply race height after view change
rebuild();
setRenderBin();
}

@ -2438,9 +2438,8 @@ namespace MWWorld
player.getClass().getInventoryStore(player).setInvListener(anim, player);
player.getClass().getInventoryStore(player).setContListener(anim);
scaleObject(getPlayerPtr(), 1.f); // apply race height
rotateObject(getPlayerPtr(), 0.f, 0.f, 0.f, true);
scaleObject(player, player.getCellRef().getScale()); // apply race height
rotateObject(player, 0.f, 0.f, 0.f, true);
MWBase::Environment::get().getMechanicsManager()->add(getPlayerPtr());
MWBase::Environment::get().getMechanicsManager()->watchActor(getPlayerPtr());

Loading…
Cancel
Save