8 player fix for existing scenarios. Closed slots don't have to be set any more.

This commit is contained in:
Titus Tscharntke
2010-02-28 13:16:03 +00:00
parent 775386190a
commit bb637920fa
3 changed files with 34 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
// ==============================================================
// This file is part of Glest Shared Library (www.glest.org)
//
// Copyright (C) 2001-2008 Marti<74>o Figueroa
// Copyright (C) 2001-2008 Marti<74>o Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
@@ -269,6 +269,24 @@ XmlNode *XmlNode::getChild(const string &childName, int i) const{
throw runtime_error("Node \""+getName()+"\" doesn't have "+intToStr(i+1)+" children named \""+childName+"\"\n\nTree: "+getTreeString());
}
bool XmlNode::hasChildAtIndex(const string &childName, int i) const
{
int count= 0;
for(int j = 0; j < children.size(); ++j)
{
if(children[j]->getName()==childName)
{
if(count==i){
return true;
}
count++;
}
}
return false;
}
bool XmlNode::hasChild(const string &childName) const
{
int count= 0;