diff --git a/source/rendering/StarTilePainter.cpp b/source/rendering/StarTilePainter.cpp index de49910..5655930 100644 --- a/source/rendering/StarTilePainter.cpp +++ b/source/rendering/StarTilePainter.cpp @@ -292,7 +292,9 @@ bool TilePainter::produceTerrainPrimitives(HashMapvariants.get(materialColorVariant).wrap(variance); + auto variant = piecePair.first->variants.ptr(materialColorVariant); + if (!variant) continue; + RectF textureCoords = variant->wrap(variance); RectF worldCoords = RectF::withSize(piecePair.second / TilePixels + Vec2F(pos), textureCoords.size() / TilePixels); quadList.emplace_back(std::in_place_type_t(), move(texture), worldCoords .min(), @@ -317,7 +319,9 @@ bool TilePainter::produceTerrainPrimitives(HashMapvariants.get(modColorVariant).wrap(variance); + auto variant = piecePair.first->variants.ptr(modColorVariant); + if (!variant) continue; + auto& textureCoords = variant->wrap(variance); RectF worldCoords = RectF::withSize(piecePair.second / TilePixels + Vec2F(pos), textureCoords.size() / TilePixels); quadList.emplace_back(std::in_place_type_t(), move(texture), worldCoords.min(), textureCoords.min(),