Avoid errors when using planes in formations, by not allowing them to join formations

This was SVN commit r9776.
This commit is contained in:
Ykkrosh
2011-07-07 17:05:22 +00:00
parent 519b0020ba
commit b6d04004b6
6 changed files with 141 additions and 49 deletions
+10 -3
View File
@@ -83,6 +83,7 @@ void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element)
int at_disable = xmb.GetAttributeID("disable");
int at_replace = xmb.GetAttributeID("replace");
int at_datatype = xmb.GetAttributeID("datatype");
bool replacing = false;
{
XERO_ITER_ATTR(element, attr)
{
@@ -94,16 +95,22 @@ void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element)
else if (attr.Name == at_replace)
{
m_Childs.erase(name);
break;
replacing = true;
}
else if (attr.Name == at_datatype && std::wstring(attr.Value.begin(), attr.Value.end()) == L"tokens")
}
}
{
XERO_ITER_ATTR(element, attr)
{
if (attr.Name == at_datatype && std::wstring(attr.Value.begin(), attr.Value.end()) == L"tokens")
{
CParamNode& node = m_Childs[name];
// Split into tokens
std::vector<std::wstring> oldTokens;
std::vector<std::wstring> newTokens;
boost::algorithm::split(oldTokens, node.m_Value, boost::algorithm::is_space());
if (!replacing) // ignore the old tokens if replace="" was given
boost::algorithm::split(oldTokens, node.m_Value, boost::algorithm::is_space());
boost::algorithm::split(newTokens, value, boost::algorithm::is_space());
// Delete empty tokens