diff --git a/data/dynos_mgr_models.cpp b/data/dynos_mgr_models.cpp index f357de76..ff5681f0 100644 --- a/data/dynos_mgr_models.cpp +++ b/data/dynos_mgr_models.cpp @@ -8,6 +8,8 @@ extern "C" { #include "model_ids.h" } +#define VANILLA_ID_END 255 + enum ModelLoadType { MLT_GEO, MLT_DL, @@ -28,7 +30,7 @@ static std::map> sIdMap; static std::map sOverwriteMap; static u32 find_empty_id() { - u32 id = 256; + u32 id = VANILLA_ID_END + 1; while (true) { if (id != 0) { if (sIdMap.count(id) == 0) { return id; } @@ -199,6 +201,9 @@ void DynOS_Model_ClearPool(enum ModelPool aModelPool) { auto& info = asset.second; if (sIdMap.count(info.id) == 0) { continue; } + // preventing clearing permanent vanilla model slot + if (info.id <= VANILLA_ID_END && sIdMap.count(info.id) <= 1) { continue; } + // erase from id map auto& idMap = sIdMap[info.id]; for (auto info2 = idMap.begin(); info2 != idMap.end(); ) {