mirror of
https://github.com/rehlds/rehlds.git
synced 2025-02-26 21:41:06 +03:00
Merge pull request #643 from s1lentq/master
Check limits up to MAX_MODELS for precached local models (Related #633)
This commit is contained in:
commit
0ce0af7d0f
@ -283,16 +283,19 @@ char *ED_ParseEdict(char *data, edict_t *ent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int index = Q_atoi(com_token + 1);
|
int index = Q_atoi(com_token + 1);
|
||||||
|
if (i == MAX_MODELS)
|
||||||
|
{
|
||||||
|
Host_Error("%s: Model '%s' failed to precache because the item count is over the %d limit.\n"
|
||||||
|
"Reduce the number of brush models and/or regular models in the map to correct this.", __func__,
|
||||||
|
localmodels[index], MAX_MODELS);
|
||||||
|
}
|
||||||
|
|
||||||
g_psv.model_precache[i] = localmodels[index];
|
g_psv.model_precache[i] = localmodels[index];
|
||||||
g_psv.models[i] = Mod_ForName(localmodels[index], FALSE, FALSE);
|
g_psv.models[i] = Mod_ForName(localmodels[index], FALSE, FALSE);
|
||||||
g_psv.model_precache_flags[i] |= RES_FATALIFMISSING;
|
g_psv.model_precache_flags[i] |= RES_FATALIFMISSING;
|
||||||
|
|
||||||
#ifdef REHLDS_OPT_PEDANTIC
|
#ifdef REHLDS_OPT_PEDANTIC
|
||||||
{
|
g_rehlds_sv.modelsMap.put(g_psv.model_precache[i], i);
|
||||||
int __itmp = i;
|
|
||||||
g_rehlds_sv.modelsMap.put(g_psv.model_precache[i], __itmp);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user