mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-03 18:45:46 +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:
parent
8513a0eae6
commit
6715402425
@ -5663,7 +5663,7 @@ void PrecacheModelTexture(const char *s, studiohdr_t *pStudioHeader)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
size_t modelNameLength = Q_strlen(s);
|
size_t modelNameLength = Q_strlen(s);
|
||||||
if (modelNameLength >= MAX_QPATH - 1)
|
if (modelNameLength > MAX_QPATH - 2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
char textureModelName[MAX_QPATH];
|
char textureModelName[MAX_QPATH];
|
||||||
@ -5673,6 +5673,11 @@ void PrecacheModelTexture(const char *s, studiohdr_t *pStudioHeader)
|
|||||||
char *modelExtension = &textureModelName[modelNameLength - modelExtensionLength];
|
char *modelExtension = &textureModelName[modelNameLength - modelExtensionLength];
|
||||||
Q_strcpy(modelExtension, "T.mdl");
|
Q_strcpy(modelExtension, "T.mdl");
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
if (!FS_FileExists(textureModelName))
|
||||||
|
modelExtension[0] = 't';
|
||||||
|
#endif
|
||||||
|
|
||||||
// Use generic, because model max count is 512...
|
// Use generic, because model max count is 512...
|
||||||
PF_precache_generic_I(textureModelName);
|
PF_precache_generic_I(textureModelName);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user