fix BlockIterator always starting at pos 0 (even if there's no Block there)

This commit is contained in:
2026-02-20 00:07:42 +01:00
parent a48a6caefc
commit ca83d5724f

View File

@ -237,7 +237,13 @@ public:
bool operator!=(const State &other) const { return !(*this == other); } bool operator!=(const State &other) const { return !(*this == other); }
BlockIterator begin() const { return BlockIterator(*this); } BlockIterator begin() const {
BlockIterator it = BlockIterator(*this);
if (!(*it).IsValid()) {
++it;
}
return it;
}
BlockIterator end() const { return BlockIterator(*this, width * height); } BlockIterator end() const { return BlockIterator(*this, width * height); }