Fix small bug in get_tiles

stinkhead7ds
Ashley N. 2023-09-13 23:18:52 -04:00
parent 1163ee2752
commit c62573e1ed
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@ fn get_tiles( tileset: Node ) -> Result<TiledTileset, Box<dyn Error>> {
for defined_tile in defined_tiles { for defined_tile in defined_tiles {
let tile_id: usize = defined_tile.attribute( "id" ).ok_or( "invalid file: id attribute not defined on a tile" )?.parse()?; let tile_id: usize = defined_tile.attribute( "id" ).ok_or( "invalid file: id attribute not defined on a tile" )?.parse()?;
let properties = defined_tile.descendants().find( | node | node.tag_name() == "properties".into() ).ok_or( "invalid file: no properties descendant in tileset" )?; let properties = defined_tile.descendants().find( | node | node.tag_name() == "properties".into() ).ok_or( "invalid file: no properties descendant in tileset" )?;
let property = properties.descendants().find( | node | node.tag_name() == "property".into() && node.attribute( "reskit-palette" ).is_some() ); let property = properties.descendants().find( | node | node.tag_name() == "property".into() && node.attribute( "name" ).unwrap_or( "" ) == "reskit-palette" );
if let Some( property ) = property { if let Some( property ) = property {
let property_type = property.attribute( "type" ).unwrap_or( "string" ); let property_type = property.attribute( "type" ).unwrap_or( "string" );
if property_type == "int" { if property_type == "int" {