From f972f19f39c191d6fca5309936a5ced36eb6c206 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Tue, 1 Oct 2013 12:41:49 +0930 Subject: [PATCH] qbsp: ignore leading path in texture names for Quake 2 compatibility Signed-off-by: Kevin Shanahan --- qbsp/map.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qbsp/map.c b/qbsp/map.c index 52e0592d..57438e89 100644 --- a/qbsp/map.c +++ b/qbsp/map.c @@ -75,8 +75,14 @@ AddAnimTex(const char *name) int FindMiptex(const char *name) { + const char *pathsep; int i; + /* Ignore leading path in texture names (Q2 map compatibility) */ + pathsep = strrchr(name, '/'); + if (pathsep) + name = pathsep + 1; + for (i = 0; i < map.nummiptex; i++) { if (!strcasecmp(name, map.miptex[i])) return i;