Fixes bug in map reader that caused actor variations to default to seed 0. Fixes #1861.

Fixes maps that were affected by this bug.

This was SVN commit r13264.
This commit is contained in:
historic_bruno 2013-03-11 16:42:41 +00:00
parent dab9175f30
commit ca40764dc6
4 changed files with 13 additions and 8 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -954,7 +954,7 @@ int CXMLReader::ReadEntities(XMBElement parent, double end_time)
int PlayerID = 0;
CFixedVector3D Position;
CFixedVector3D Orientation;
long Seed = 0;
long Seed = -1;
// Obstruction control groups.
entity_id_t ControlGroup = INVALID_ENTITY;
@ -1004,7 +1004,12 @@ int CXMLReader::ReadEntities(XMBElement parent, double end_time)
else if (element_name == el_actor)
{
XMBAttributeList attrs = setting.GetAttributes();
Seed = attrs.GetNamedItem(at_seed).ToLong();
CStr seedStr = attrs.GetNamedItem(at_seed);
if (!seedStr.empty())
{
Seed = seedStr.ToLong();
ENSURE(Seed >= 0);
}
}
else
debug_warn(L"Invalid map XML data");