diff --git a/src/gamedata/textures/texture.cpp b/src/gamedata/textures/texture.cpp index 85d319ffc..046807b4c 100644 --- a/src/gamedata/textures/texture.cpp +++ b/src/gamedata/textures/texture.cpp @@ -226,7 +226,7 @@ FTexture *FTexture::GetRawTexture() if (OffsetLess) return OffsetLess; // Reject anything that cannot have been a single-patch multipatch texture in vanilla. auto image = static_cast(GetImage()); - if (bMultiPatch != 1 || UseType != ETextureType::Wall || Scale.X != 1 || Scale.Y != 1 || bWorldPanning || image == nullptr || image->NumParts != 1) + if (bMultiPatch != 1 || UseType != ETextureType::Wall || Scale.X != 1 || Scale.Y != 1 || bWorldPanning || image == nullptr || image->NumParts != 1 || _TopOffset[0] == 0) { OffsetLess = this; return this; @@ -234,6 +234,15 @@ FTexture *FTexture::GetRawTexture() // Set up a new texture that directly references the underlying patch. // From here we cannot retrieve the original texture made for it, so just create a new one. FImageSource *source = image->Parts[0].Image; + + // Size must match for this to work as intended + if (source->GetWidth() != Width || source->GetHeight() != Height) + { + OffsetLess = this; + return this; + } + + OffsetLess = new FImageTexture(source, ""); TexMan.AddTexture(OffsetLess); return OffsetLess;