mirror of
https://github.com/glest/glest-source.git
synced 2025-08-22 07:52:51 +02:00
- added new attribute for tileset objects named "height". Air units will try to fly above the height of units and objects now (up to a max of terrain height + 15)
This commit is contained in:
@@ -241,13 +241,17 @@ XmlAttribute *XmlNode::getAttribute(unsigned int i) const{
|
||||
return attributes[i];
|
||||
}
|
||||
|
||||
XmlAttribute *XmlNode::getAttribute(const string &name) const{
|
||||
XmlAttribute *XmlNode::getAttribute(const string &name,bool mustExist) const {
|
||||
for(unsigned int i=0; i<attributes.size(); ++i){
|
||||
if(attributes[i]->getName()==name){
|
||||
return attributes[i];
|
||||
}
|
||||
}
|
||||
throw runtime_error("\"" + getName() + "\" node doesn't have a attribute named \"" + name + "\"");
|
||||
if(mustExist == true) {
|
||||
throw runtime_error("\"" + getName() + "\" node doesn't have a attribute named \"" + name + "\"");
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
XmlNode *XmlNode::getChild(unsigned int i) const {
|
||||
|
Reference in New Issue
Block a user