Skip to content

Commit 934ed70

Browse files
committed
Include protection from Interkarma#2617 to enable easy merge conflict resolution
1 parent 8561224 commit 934ed70

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Assets/Scripts/Utility/RMBLayout.cs

+7-3
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ private static void AddModels(
840840

841841
// Get model data
842842
ModelData modelData;
843-
dfUnity.MeshReader.GetModelData(obj.ModelIdNum, out modelData);
843+
bool hasModelData = dfUnity.MeshReader.GetModelData(obj.ModelIdNum, out modelData);
844844

845845
// Does this Daggerfall model have any static doors?
846846
StaticDoor[] staticDoors = null;
@@ -851,10 +851,14 @@ private static void AddModels(
851851
GameObject go;
852852
if (!(go = MeshReplacement.ImportCustomGameobject(obj.ModelIdNum, parent, modelMatrix)))
853853
{
854-
if (combiner == null || IsCityGate(obj.ModelIdNum) || IsBulletinBoard(obj.ModelIdNum) || PlayerActivate.HasCustomActivation(obj.ModelIdNum))
854+
if (!hasModelData) {
855+
Debug.LogError($"Could not load model '{obj.ModelIdNum}' in block '{blockData.Name}'");
856+
continue;
857+
} else if (combiner == null || IsCityGate(obj.ModelIdNum) || IsBulletinBoard(obj.ModelIdNum) || PlayerActivate.HasCustomActivation(obj.ModelIdNum)) {
855858
AddStandaloneModel(dfUnity, ref modelData, modelMatrix, parent);
856-
else
859+
} else {
857860
combiner.Add(ref modelData, modelMatrix);
861+
}
858862
}
859863

860864
// Store building information for first model of record

0 commit comments

Comments
 (0)