diff --git a/engine/client/image.c b/engine/client/image.c index 75068fda7..37b52d660 100644 --- a/engine/client/image.c +++ b/engine/client/image.c @@ -1973,7 +1973,7 @@ int Mod_LoadHiResTexture(char *name, char *subpath, qboolean mipmap, qboolean al int i, e; - COM_StripExtension(name, nicename, sizeof(nicename)); + COM_StripAllExtensions(name, nicename, sizeof(nicename)); while((data = strchr(nicename, '*'))) { diff --git a/engine/common/common.c b/engine/common/common.c index 11ab0c66e..7f71bff5f 100644 --- a/engine/common/common.c +++ b/engine/common/common.c @@ -1469,6 +1469,26 @@ void COM_StripExtension (char *in, char *out, int outlen) } } +void COM_StripAllExtensions (char *in, char *out, int outlen) +{ + char *s; + + if (out != in) + Q_strncpyz(out, in, outlen); + + s = out+strlen(out); + + while(*s != '/' && s != out) + { + if (*s == '.') + { + *s = 0; + } + + s--; + } +} + /* ============ COM_FileExtension