mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-19 20:53:52 +00:00
Play the left-arm torch animation when it's equipped
This commit is contained in:
parent
ee585046ac
commit
e8bbb755c3
3 changed files with 22 additions and 0 deletions
|
@ -441,6 +441,17 @@ void CharacterController::update(float duration, Movement &movement)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
MWWorld::ContainerStoreIterator torch = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||
if(torch != inv.end() && torch->getTypeName() == typeid(ESM::Light).name())
|
||||
{
|
||||
if(!mAnimation->isPlaying("torch"))
|
||||
mAnimation->play("torch", Priority_Torch,
|
||||
MWRender::Animation::Group_LeftArm, false,
|
||||
"start", "stop", 0.0f, (~(size_t)0));
|
||||
}
|
||||
else if(mAnimation->isPlaying("torch"))
|
||||
mAnimation->disable("torch");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ class Movement;
|
|||
enum Priority {
|
||||
Priority_Default,
|
||||
Priority_Weapon,
|
||||
Priority_Torch,
|
||||
|
||||
Priority_Death,
|
||||
|
||||
|
|
|
@ -175,6 +175,16 @@ namespace MWRender
|
|||
mAnimation->play(mCurrentAnimGroup, 1, Animation::Group_All, false, "start", "stop", 0.0f, 0);
|
||||
}
|
||||
|
||||
MWWorld::ContainerStoreIterator torch = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedLeft);
|
||||
if(torch != inv.end() && torch->getTypeName() == typeid(ESM::Light).name())
|
||||
{
|
||||
if(!mAnimation->getInfo("torch"))
|
||||
mAnimation->play("torch", 2, MWRender::Animation::Group_LeftArm, false,
|
||||
"start", "stop", 0.0f, (~(size_t)0));
|
||||
}
|
||||
else if(mAnimation->getInfo("torch"))
|
||||
mAnimation->disable("torch");
|
||||
|
||||
mAnimation->forceUpdate();
|
||||
mAnimation->runAnimation(0.0f);
|
||||
|
||||
|
|
Loading…
Reference in a new issue