Fixes serialization test failure from CmpVisualActor not setting initial animation state with graphics disabled, fixes #1812

This was SVN commit r13053.
This commit is contained in:
historic_bruno 2013-01-06 07:37:22 +00:00
parent 8a2baec240
commit e89193d66d

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2012 Wildfire Games.
/* Copyright (C) 2013 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -144,9 +144,6 @@ public:
m_R = m_G = m_B = fixed::FromInt(1);
if (!GetSimContext().HasUnitManager())
return; // do nothing further if graphics are disabled
// TODO: we should do some fancy animation of under-construction buildings rising from the ground,
// but for now we'll just use the foundation actor and ignore the normal one
if (paramNode.GetChild("Foundation").IsOk() && paramNode.GetChild("FoundationActor").IsOk())
@ -154,6 +151,8 @@ public:
else
m_ActorName = paramNode.GetChild("Actor").ToString();
if (GetSimContext().HasUnitManager())
{
std::set<CStr> selections;
m_Unit = GetSimContext().GetUnitManager().CreateUnit(m_ActorName, GetActorSeed(), selections);
if (m_Unit)
@ -185,7 +184,9 @@ public:
m_Unit->SetID(GetEntityId());
}
}
// We need to select animation even if graphics are disabled, as this modifies serialized state
SelectAnimation("idle", false, fixed::FromInt(1), L"");
}