This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 21828 for ps


Ignore:
Timestamp:
05/28/18 21:06:09 (7 years ago)
Author:
Stan
Message:

Fix non-visual replay hash mismatch caused by CCmpSound condition in CCmpVisualActor
Differential Revision: ​https://code.wildfiregames.com/D1519
Reviewed by: temple, elexis, wraitii
refs: rP21359

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/simulation2/components/CCmpVisualActor.cpp

    r21375 r21828  
    6969    std::wstring m_BaseActorName, m_ActorName;
    7070    bool m_IsFoundationActor;
     71
     72    // Not initialized in non-visual mode
    7173    CUnit* m_Unit;
    7274
     
    451453        SetVariant("animation", m_AnimName);
    452454
     455        CmpPtr<ICmpSound> cmpSound(GetEntityHandle());
     456        if (cmpSound)
     457            m_SoundGroup = cmpSound->GetSoundGroup(wstring_from_utf8(m_AnimName));
     458
    453459        if (!m_Unit || !m_Unit->GetAnimation() || !m_Unit->GetID())
    454460            return;
    455 
    456         CmpPtr<ICmpSound> cmpSound(GetSimContext(), m_Unit->GetID());
    457         if (cmpSound)
    458             m_SoundGroup = cmpSound->GetSoundGroup(wstring_from_utf8(m_AnimName));
    459461
    460462        m_Unit->GetAnimation()->SetAnimationState(m_AnimName, m_AnimOnce, m_AnimSpeed.ToFloat(), m_AnimDesync.ToFloat(), m_SoundGroup.c_str());
Note: See TracChangeset for help on using the changeset viewer.