From 0030f6ad2be3d2f59336748c2ba485c38501c93b Mon Sep 17 00:00:00 2001 From: Itms Date: Sat, 8 Oct 2016 08:49:35 +0000 Subject: [PATCH] In CCmpVisualActor, m_Unit is not initialized when running without graphics, so we must check that pointer everytime. Also make one call consistent with the rest of the file. Fixes #4238, refs #3952 This was SVN commit r18812. --- source/simulation2/components/CCmpVisualActor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/simulation2/components/CCmpVisualActor.cpp b/source/simulation2/components/CCmpVisualActor.cpp index 8b2a0382fb..0d701d5f49 100644 --- a/source/simulation2/components/CCmpVisualActor.cpp +++ b/source/simulation2/components/CCmpVisualActor.cpp @@ -264,7 +264,7 @@ public: // If we serialized a different seed or different actor, reload actor if (oldSeed != GetActorSeed() || m_BaseActorName != m_ActorName) ReloadActor(); - else + else if (m_Unit) m_Unit->SetEntitySelection(m_VariantSelections); fixed repeattime = m_AnimSyncRepeatTime; // save because SelectAnimation overwrites it @@ -745,7 +745,7 @@ void CCmpVisualActor::ReloadActor() void CCmpVisualActor::Update(fixed UNUSED(turnLength)) { - if (m_Unit == NULL) + if (!m_Unit) return; // If we're in the special movement mode, select an appropriate animation