diff --git a/src/graphics/engine/engine.cpp b/src/graphics/engine/engine.cpp index b2aa631f..3110cd37 100644 --- a/src/graphics/engine/engine.cpp +++ b/src/graphics/engine/engine.cpp @@ -4404,6 +4404,9 @@ void CEngine::UpdateGroundSpotTextures() { int px = x / 4.0f / 254.0f * size.x; int py = y / 4.0f / 254.0f * size.y; + // This can happen because the shadow??.png textures have a 1 pixel margin around them + if (px < 0 || px >= size.x || py < 0 || py >= size.y) + continue; shadowImg.SetPixelInt(Math::IntPoint(x-min.x, y-min.y), m_displayGotoImage->GetPixelInt(Math::IntPoint(px, py))); } }