@@ -39,7 +39,7 @@ TileSetParser::TileSetParser(TileSet& tileset, const std::string& filename) :
39
39
}
40
40
41
41
void
42
- TileSetParser::parse (uint32_t start, uint32_t end, int32_t offset)
42
+ TileSetParser::parse (uint32_t start, uint32_t end, int32_t offset, bool imported )
43
43
{
44
44
if (offset && static_cast <int32_t >(start) + offset < 1 ) {
45
45
start = -offset + 1 ;
@@ -70,8 +70,8 @@ TileSetParser::parse(uint32_t start, uint32_t end, int32_t offset)
70
70
else if (iter.get_key () == " tilegroup" )
71
71
{
72
72
/* tilegroups are only interesting for the editor */
73
- /* ignore tilegroups for imported tilesets unless there's no limit and no offset */
74
- if (start || end || offset ) continue ;
73
+ /* ignore tilegroups for imported tilesets */
74
+ if (imported ) continue ;
75
75
ReaderMapping reader = iter.as_mapping ();
76
76
Tilegroup tilegroup;
77
77
reader.get (" name" , tilegroup.name );
@@ -85,8 +85,8 @@ TileSetParser::parse(uint32_t start, uint32_t end, int32_t offset)
85
85
}
86
86
else if (iter.get_key () == " autotileset" )
87
87
{
88
- /* ignore autotiles for imported tilesets unless there's no limit and no offset */
89
- if (start || end || offset ) continue ;
88
+ /* ignore autotiles for imported tilesets */
89
+ if (imported ) continue ;
90
90
ReaderMapping reader = iter.as_mapping ();
91
91
std::string autotile_filename;
92
92
if (!reader.get (" source" , autotile_filename))
@@ -111,15 +111,15 @@ TileSetParser::parse(uint32_t start, uint32_t end, int32_t offset)
111
111
reader.get (" end" , import_end);
112
112
reader.get (" offset" , import_offset);
113
113
TileSetParser import_parser (m_tileset, import_filename);
114
- import_parser.parse (import_start, import_end, import_offset);
114
+ import_parser.parse (import_start, import_end, import_offset, true );
115
115
}
116
116
else
117
117
{
118
118
log_warning << " Unknown symbol '" << iter.get_key () << " ' in tileset file" << std::endl;
119
119
}
120
120
}
121
121
/* only create the unassigned tilegroup from the parent strf */
122
- if (g_config->developer_mode && !end )
122
+ if (g_config->developer_mode && !imported )
123
123
{
124
124
m_tileset.add_unassigned_tilegroup ();
125
125
}
0 commit comments