Fix invalid model cache on mission change

This commit is contained in:
Jarrod Doyle 2024-08-31 12:03:29 +01:00
parent 4ab115440c
commit ed13b4edc0
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ public class ModelLoader
// We don't care if this is null actually, we'll still cache that it's null lol // We don't care if this is null actually, we'll still cache that it's null lol
var model = Timing.TimeStage("Load Models", () => { return LoadModel(_pathManager, ref campaignName, modelName); }); var model = Timing.TimeStage("Load Models", () => { return LoadModel(_pathManager, ref campaignName, modelName); });
_cache[(campaignName, modelName)] = model; _cache[(campaignName, modelName)] = model;
return model; return model?.Duplicate() as MeshInstance3D;
} }
public static MeshInstance3D LoadModel(ResourcePathManager pathManager, ref string campaignName, string modelName) public static MeshInstance3D LoadModel(ResourcePathManager pathManager, ref string campaignName, string modelName)