diff --git a/src/nostalgia/modules/gfx/src/tilesheet.cpp b/src/nostalgia/modules/gfx/src/tilesheet.cpp index 3853cddc..d59fec07 100644 --- a/src/nostalgia/modules/gfx/src/tilesheet.cpp +++ b/src/nostalgia/modules/gfx/src/tilesheet.cpp @@ -236,13 +236,19 @@ static ox::Result getSubSheet( ox::Result getSubSheet( ox::SpanView const &idx, TileSheet const &ts) noexcept { - return getSubSheet(idx, 1, ts.subsheet); + if (!idx.empty() && idx[0] == ts.subsheet.name) { + return getSubSheet(idx, 1, ts.subsheet); + } + return ox::Error{1, "SubSheet not found"}; } ox::Result getSubSheet( ox::SpanView const &idx, TileSheet &ts) noexcept { - return getSubSheet(idx, 1, ts.subsheet); + if (!idx.empty() && idx[0] == ts.subsheet.name) { + return getSubSheet(idx, 1, ts.subsheet); + } + return ox::Error{1, "SubSheet not found"}; }