Unverified Commit 0ce0af7d authored by theAsmodai's avatar theAsmodai Committed by GitHub

Merge pull request #643 from s1lentq/master

Check limits up to MAX_MODELS for precached local models (Related #633)
parents 4da8c9eb 3eed9d11
......@@ -283,16 +283,19 @@ char *ED_ParseEdict(char *data, edict_t *ent)
}
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.models[i] = Mod_ForName(localmodels[index], FALSE, FALSE);
g_psv.model_precache_flags[i] |= RES_FATALIFMISSING;
#ifdef REHLDS_OPT_PEDANTIC
{
int __itmp = i;
g_rehlds_sv.modelsMap.put(g_psv.model_precache[i], __itmp);
}
g_rehlds_sv.modelsMap.put(g_psv.model_precache[i], i);
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment