1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00

update main character model

This commit is contained in:
greye 2012-11-10 11:51:48 +04:00
parent b1ef0026a9
commit 235b565bb7
2 changed files with 18 additions and 1 deletions

View File

@ -310,6 +310,9 @@ namespace MWRender
void Player::setAnimation(NpcAnimation *anim) void Player::setAnimation(NpcAnimation *anim)
{ {
if (mAnimation) {
delete mAnimation;
}
mAnimation = anim; mAnimation = anim;
} }

View File

@ -801,7 +801,21 @@ namespace MWWorld
const ESM::NPC *World::createRecord(const ESM::NPC &record) const ESM::NPC *World::createRecord(const ESM::NPC &record)
{ {
return mStore.insert(record); bool update = false;
if (StringUtils::ciEqual(record.mId, "player")) {
const ESM::NPC *player =
mPlayer->getPlayer().get<ESM::NPC>()->mBase;
update = record.isMale() != player->isMale() ||
!StringUtils::ciEqual(record.mRace, player->mRace) ||
!StringUtils::ciEqual(record.mHead, player->mHead) ||
!StringUtils::ciEqual(record.mHair, player->mHair);
}
const ESM::NPC *ret = mStore.insert(record);
if (update) {
mRendering->renderPlayer(mPlayer->getPlayer());
}
return ret;
} }
void World::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode, void World::playAnimationGroup (const MWWorld::Ptr& ptr, const std::string& groupName, int mode,