mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-01 04:45:36 +00:00
update main character model
This commit is contained in:
parent
b1ef0026a9
commit
235b565bb7
2 changed files with 18 additions and 1 deletions
|
@ -310,6 +310,9 @@ namespace MWRender
|
||||||
|
|
||||||
void Player::setAnimation(NpcAnimation *anim)
|
void Player::setAnimation(NpcAnimation *anim)
|
||||||
{
|
{
|
||||||
|
if (mAnimation) {
|
||||||
|
delete mAnimation;
|
||||||
|
}
|
||||||
mAnimation = anim;
|
mAnimation = anim;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue