From 6dc1cddb7c040dc0ab938cb0db80a6dfe2ede11a Mon Sep 17 00:00:00 2001 From: Dethrace Labs <78985374+dethrace-labs@users.noreply.github.com> Date: Sun, 25 Jan 2026 12:07:53 +1300 Subject: [PATCH] WallUntexToLinear matching --- src/DETHRACE/common/world.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/DETHRACE/common/world.c b/src/DETHRACE/common/world.c index 1737eeb9..16ba02b8 100644 --- a/src/DETHRACE/common/world.c +++ b/src/DETHRACE/common/world.c @@ -2228,15 +2228,16 @@ br_material* WallUntexToLinear(br_model* pModel, tU16 pFace) { old_mat = pModel->faces[pFace].material; if (HasThisSuffix(old_mat->identifier, ".lwall")) { new_mat = UnsuffixedMaterial(old_mat->identifier, ".lwall"); - } else if (HasThisSuffix(old_mat->identifier, ".pwall")) { - old_mat->colour_map = UnsuffixedMaterial(old_mat->identifier, ".pwall")->colour_map; + return new_mat; + } + if (HasThisSuffix(old_mat->identifier, ".pwall")) { + new_mat = UnsuffixedMaterial(old_mat->identifier, ".pwall"); + old_mat->colour_map = new_mat->colour_map; old_mat->flags &= ~BR_MATF_PERSPECTIVE; BrMaterialUpdate(old_mat, BR_MATU_ALL); - new_mat = NULL; - } else { - new_mat = NULL; + return NULL; } - return new_mat; + return NULL; } // IDA: br_material* __usercall WallUntexToPersp@(br_model *pModel@, tU16 pFace@)