From bef514fabb2a5c7ed7e72a795d06d8b6592d6988 Mon Sep 17 00:00:00 2001
From: Derek MacDonald <derekmd@hotmail.com>
Date: Tue, 6 Apr 2021 15:16:50 -0400
Subject: [PATCH] Ignore texture patch negative vertical offset (#544)

https://doomwiki.org/wiki/Vertical_offsets_are_ignored_in_texture_patches

BIGDOOR7 & STEP2 in doom.wad and doom2.wad contain
negative Y-offsets some a patch but instead the
renderer defaults to Y-offset value of 0.

This stops UDB's 3D visual mode from using the
negative value - change it to 0 to match the game
renderer. (G)ZDoom behaves the same as vanilla.
---
 Source/Core/Data/TexturePatch.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Source/Core/Data/TexturePatch.cs b/Source/Core/Data/TexturePatch.cs
index 7820cc289..ffda23e14 100755
--- a/Source/Core/Data/TexturePatch.cs
+++ b/Source/Core/Data/TexturePatch.cs
@@ -65,7 +65,7 @@ namespace CodeImp.DoomBuilder.Data
 			// Initialize
 			this.LumpName = lumpname;
 			this.X = x;
-			this.Y = y;
+			this.Y = y < 0 ? 0 : y;
 			this.FlipX = false;
 			this.FlipY = false;
 			this.Rotate = 0;
-- 
GitLab