diff --git a/PlotLine/Views/Writing/_WritingContextPlace.cshtml b/PlotLine/Views/Writing/_WritingContextPlace.cshtml index 5c2d6829..5c063fa9 100644 --- a/PlotLine/Views/Writing/_WritingContextPlace.cshtml +++ b/PlotLine/Views/Writing/_WritingContextPlace.cshtml @@ -2,9 +2,9 @@ @{ var scene = Model.Context!.Scene!; var floorPlan = Model.FloorPlan; + // Only an explicit scene/occupancy mapping identifies a floor. var floorId = scene.InitialFloorPlanFloorID - ?? floorPlan?.OccupancyScenes.FirstOrDefault(x => x.SceneID == scene.SceneID)?.InitialFloorPlanFloorID - ?? floorPlan?.Floors.OrderBy(x => x.SortOrder).FirstOrDefault()?.FloorPlanFloorID; + ?? floorPlan?.OccupancyScenes.FirstOrDefault(x => x.SceneID == scene.SceneID)?.InitialFloorPlanFloorID; var floor = floorPlan?.Floors.FirstOrDefault(x => x.FloorPlanFloorID == floorId); var blocks = floor is null ? [] : floorPlan!.Blocks.Where(x => x.FloorPlanFloorID == floor.FloorPlanFloorID).ToList(); var tokens = floor is null ? [] : floorPlan!.OccupancyTokens.Where(x => x.SceneID == scene.SceneID && x.FloorPlanFloorID == floor.FloorPlanFloorID).ToList(); @@ -30,7 +30,7 @@ } else if (floor is null || !blocks.Any()) { -

No placed rooms are available for this floor.

+

@(floor is null?"No saved floor mapping for this scene. Open the linked floor plan to choose a floor.":"No placed rooms are available for this floor.")

} else {