Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed a bug that caused trails to not inherit attributes correctly #353

Merged
merged 4 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@
</MarkerCategory>
</MarkerCategory>

<MarkerCategory Name="TrailNestedLevel1" Texture="texture_one.png" TrailData="trail.trl" AnimationSpeed="1">
<MarkerCategory Name="TrailNestedLevel2"></MarkerCategory>
</MarkerCategory>

<MarkerCategory Name="NestedLevel1" XPos="111"></MarkerCategory>


<POIs>
<POI Type="mycategory" MapID="50" />
<POI Type="mycategory" XPos="170.81" MapID="50" />
Expand All @@ -17,5 +22,6 @@
<POI Type="nestedlevel1" MapID="50" />
<POI Type="nestedlevel1.nestedlevel2" MapID="50" />
<POI Type="nestedlevel1.nestedlevel2.nestedlevel3" MapID="50" />
<Trail Type="trailnestedlevel1.trailnestedlevel2" />
</POIs>
</OverlayData>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Full Diff
--- xml_converter/integration_tests/test_cases/xml_category_inheritance/output_proto/markers.bin.textproto._old	2024-09-19 23:40:11.478056205 +0000
+++ xml_converter/integration_tests/test_cases/xml_category_inheritance/output_proto/markers.bin.textproto._new	2024-09-19 23:40:11.485056202 +0000
@@ -55,3 +55,30 @@
   }
   id: ",\222\247\355j@\016:"
 }
+category {
+  children {
+    trail {
+      texture_id: 1
+      map_id: 50
+      trail_data {
+        points_x: 1
+        points_x: 2
+        points_x: 3
+        points_y: 4
+        points_y: 5
+        points_y: 6
+        points_z: 7
+        points_z: 8
+        points_z: 9
+      }
+      animation_speed: 1
+    }
+    id: "\361@\242\320/\212\204\001"
+  }
+  id: "s\357U\206f\255\240\345"
+}
+textures {
+}
+textures {
+  filepath: "texture_one.png"
+}

Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@
</MarkerCategory>
</MarkerCategory>

<MarkerCategory ID="c+9VhmatoOU=" Name="TrailNestedLevel1">
<MarkerCategory ID="8UCi0C+KhAE=" Name="TrailNestedLevel2">
</MarkerCategory>
</MarkerCategory>

<POIs>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="210.649994" ZPos="215.830002"/>
<POI Type="mycategory" MapID="50" XPos="170.809998" YPos="210.649994" ZPos="215.830002"/>
<POI Type="mycategory" MapID="50" XPos="169.809998" YPos="211.649994" ZPos="215.830002"/>
<POI Type="nestedlevel1" MapID="50" XPos="111.000000" YPos="0.000000" ZPos="0.000000"/>
<POI Type="nestedlevel1.nestedlevel2" MapID="50" XPos="111.000000" YPos="222.000000" ZPos="0.000000"/>
<POI Type="nestedlevel1.nestedlevel2.nestedlevel3" MapID="50" XPos="111.000000" YPos="222.000000" ZPos="333.000000"/>
<Trail AnimSpeed="1.000000" Type="trailnestedlevel1.trailnestedlevel2" MapID="50" Texture="texture_one.png" TrailData="037aa160e392f1c8.trl"/>
</POIs>
</OverlayData>
4 changes: 2 additions & 2 deletions xml_converter/src/packaging_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ vector<Parseable*> parse_pois(rapidxml::xml_node<>* root_node, map<string, Categ
Trail* trail = new Trail();

for (size_t category_index = 0; category_index < categories.size(); category_index++) {
for (size_t i = 0; i < categories[category_index]->icon_attributes.size(); i++) {
for (size_t i = 0; i < categories[category_index]->trail_attributes.size(); i++) {
trail->init_xml_attribute(
categories[category_index]->icon_attributes[i],
categories[category_index]->trail_attributes[i],
&ignored_errors,
state);
}
Expand Down
Loading