Play the left-arm torch animation when it's equipped

pull/16/head
Chris Robinson 12 years ago
parent ee585046ac
commit e8bbb755c3

@ -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…
Cancel
Save