ValueNode::Handle waypoint_value_node;
+ xmlpp::Element::NodeList list = child->get_children();
if(child->get_attribute("use"))
{
- waypoint_value_node=canvas->surefind_value_node(child->get_attribute("use")->get_value());
+ if(!list.empty())
+ warning(child,_("Found \"use\" attribute for <waypoint>, but it wasn't empty. Ignoring contents..."));
+
+ // the waypoint might look like this, in which case we won't find "mycanvas" in the list of valuenodes, 'cos it's a canvas
+ //
+ // <animated type="canvas">
+ // <waypoint time="0s" use="mycanvas"/>
+ // </animated>
+ if (type==ValueBase::TYPE_CANVAS)
+ waypoint_value_node=ValueNode_Const::create(canvas->surefind_canvas(child->get_attribute("use")->get_value()));
+ else
+ waypoint_value_node=canvas->surefind_value_node(child->get_attribute("use")->get_value());
}
else
{
continue;
}
- xmlpp::Element::NodeList list = child->get_children();
xmlpp::Element::NodeList::iterator iter;
// Search for the first non-text XML element
if(child->get_attribute("use"))
{
+ // \todo does this need to be able to read 'use="canvas"', like waypoints can now? (see 'surefind_canvas' in this file)
string id=child->get_attribute("use")->get_value();
try
{