fixed custom model alloc again

This commit is contained in:
Isaac0-dev 2025-02-14 22:50:57 +10:00
parent 2745f932b1
commit 811e60f7cf

View file

@ -528,7 +528,7 @@ enum ModelExtendedId smlua_model_util_get_id(const char* name) {
// If we've extended past our current custom model limit. Reallocate so we have more space.
if (sCustomModelsCount >= sMaxCustomModelsCount) {
if (sMaxCustomModelsCount + CUSTOM_MODEL_CHUNK_SIZE < 0xFFFF) {
if (sMaxCustomModelsCount + CUSTOM_MODEL_CHUNK_SIZE >= 0xFFFF) {
LOG_LUA("Failed to get model: '%s' (too many custom models!)", name);
return E_MODEL_ERROR_MODEL;
}