Ticket #4071: anim.diff
File anim.diff, 1.3 KB (added by , 8 years ago) |
---|
-
source/graphics/UnitAnimation.cpp
77 77 78 78 // Recursively add all props 79 79 const std::vector<CModel::Prop>& props = model->GetProps(); 80 for ( std::vector<CModel::Prop>::const_iterator it = props.begin(); it != props.end(); ++it)80 for (const CModel::Prop& prop : props) 81 81 { 82 CModel* propModel = it->m_Model->ToCModel();82 CModel* propModel = prop.m_Model->ToCModel(); 83 83 if (propModel) 84 AddModel(propModel, it->m_ObjectEntry);84 AddModel(propModel, prop.m_ObjectEntry); 85 85 } 86 86 } 87 87 … … 237 237 // we're handling the root model 238 238 // choose animations from the complete state 239 239 anim = it->object->GetRandomAnimation(m_State); 240 m_AnimationName = anim->m_Name;241 240 // if we use a new animation name, 242 241 // update the animations of all non-root models 242 // sync with the root model, unless the root model could 243 // only resort to the "idle" state. 244 if (anim->m_Name != "idle") 245 m_AnimationName = anim->m_Name; 246 else 247 m_AnimationName = m_State; 243 248 if (it->anim->m_Name != m_AnimationName) 244 249 for (SModelAnimState animState : m_AnimStates) 245 250 if (animState.model != m_Model)