Skip to content

Commit d687eed

Browse files
committed
Warn if the import range has a negative size (start greater than end)
1 parent 5f94110 commit d687eed

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/supertux/tile_set_parser.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ TileSetParser::parse(uint32_t start, uint32_t end, int32_t offset)
4343
{
4444
if (offset && (int)start + offset < 1) {
4545
start = -offset + 1;
46-
log_warning << "The defined offset would assign non-positive ids to tiles, tiles below " << -offset + 1 << " will be ignored" << std::endl;
46+
log_warning << "The defined offset would assign non-positive ids to tiles, tiles below " << -offset + 1 << " will be ignored." << std::endl;
47+
}
48+
if (end < start) {
49+
log_warning << "The defined range has a negative size, no tiles will be imported." << std::endl;
50+
return;
4751
}
4852

4953
m_tiles_path = FileSystem::dirname(m_filename);

0 commit comments

Comments
 (0)