1
0
forked from mirrors/0ad

# Hotloading of actor XML files.

Stop ignoring actor XML animation speeds.
Add decentralised registration of hotloaders.
Move player ID storage into CModel, to simplify CUnit.
Remove obsolete unit ID allocation code.
Remove some material junk.

This was SVN commit r7605.
This commit is contained in:
Ykkrosh
2010-06-03 01:29:43 +00:00
parent 5c03456a38
commit 310f3466a8
27 changed files with 271 additions and 309 deletions
-23
View File
@@ -103,10 +103,7 @@ void CMapReader::LoadMap(const VfsPath& pathname, CTerrain *pTerrain_,
// delete all remaining non-entity units
if (pUnitMan)
{
pUnitMan->DeleteAll();
pUnitMan->SetNextID(0);
}
// unpack the data
if (!only_xml)
@@ -968,26 +965,6 @@ int CXMLReader::ReadOldEntities(XMBElement parent, double end_time)
{
XMBElementList entities = parent.GetChildNodes();
// If this is the first time in ReadOldEntities, find the next free ID number
// in case we need to allocate new ones in the future
if (entity_idx == 0)
{
int maxUnitID = -1;
XERO_ITER_EL(parent, entity)
{
debug_assert(entity.GetNodeName() == el_entity);
XMBAttributeList attrs = entity.GetAttributes();
utf16string uid = attrs.GetNamedItem(at_uid);
int unitId = uid.empty() ? -1 : CStr(uid).ToInt();
maxUnitID = std::max(maxUnitID, unitId);
}
if (m_MapReader.pUnitMan)
m_MapReader.pUnitMan->SetNextID(maxUnitID + 1);
}
while (entity_idx < entities.Count)
{
// all new state at this scope and below doesn't need to be