Skip to content

Commit

Permalink
Apply suggestions from PR
Browse files Browse the repository at this point in the history
- Open and save the test map so we know for certain it's in line with Tiled output
- If we can't find a property type on a class property, default to an empty string instead of "class"
  • Loading branch information
Deukhoofd committed Feb 20, 2024
1 parent 040036d commit 0870435
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions assets/tiled_class_property.tmx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.5" tiledversion="1.7.2" orientation="orthogonal" renderorder="right-down" width="2" height="2" tilewidth="32" tileheight="32" infinite="0" nextlayerid="3" nextobjectid="4">
<map version="1.10" tiledversion="1.10.2" orientation="orthogonal" renderorder="right-down" width="2" height="2" tilewidth="32" tileheight="32" infinite="0" nextlayerid="3" nextobjectid="4">
<layer id="1" name="Tile Layer 1" width="2" height="2">
<data encoding="csv">
0,0,
Expand All @@ -11,7 +11,7 @@
<properties>
<property name="class property" type="class" propertytype="test_type">
<properties>
<property name="test_property_1" value="3" type="int"/>
<property name="test_property_1" type="int" value="3"/>
</properties>
</property>
<property name="empty property" type="class" propertytype="empty_type"/>
Expand Down
2 changes: 1 addition & 1 deletion src/properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub(crate) fn parse_properties(
HashMap::new()
};
p.insert(k, PropertyValue::ClassValue {
property_type: p_t.unwrap_or_else(|| "class".to_owned()),
property_type: p_t.unwrap_or_default(),
properties,
});
return Ok(());
Expand Down

0 comments on commit 0870435

Please sign in to comment.