2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-01 01:25:38 +03:00

Workaround for texture precaching on case-sensitive filesystem (#325)

That fixes a problem when texture file for model ends with "t.mdl", not "T.mdl"
This commit is contained in:
Artem Golubikhin 2017-01-28 00:02:43 +03:00 committed by Lev
parent 8513a0eae6
commit 6715402425

View File

@ -5663,7 +5663,7 @@ void PrecacheModelTexture(const char *s, studiohdr_t *pStudioHeader)
return;
size_t modelNameLength = Q_strlen(s);
if (modelNameLength >= MAX_QPATH - 1)
if (modelNameLength > MAX_QPATH - 2)
return;
char textureModelName[MAX_QPATH];
@ -5673,6 +5673,11 @@ void PrecacheModelTexture(const char *s, studiohdr_t *pStudioHeader)
char *modelExtension = &textureModelName[modelNameLength - modelExtensionLength];
Q_strcpy(modelExtension, "T.mdl");
#ifndef _WIN32
if (!FS_FileExists(textureModelName))
modelExtension[0] = 't';
#endif
// Use generic, because model max count is 512...
PF_precache_generic_I(textureModelName);
}