From ee3ed710988a39fe4377741d833bf58ec10ad844 Mon Sep 17 00:00:00 2001 From: GrafDimenzio Date: Tue, 21 Jul 2020 10:11:13 +0200 Subject: [PATCH] fixed Room Surface bug that in Player.Room the Surface is a Room and in Map.Rooms it is not --- Synapse/Api/Map.cs | 2 +- Synapse/Api/Player.cs | 2 +- Synapse/Api/Room.cs | 11 +---------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/Synapse/Api/Map.cs b/Synapse/Api/Map.cs index 0df934a..fb561bd 100644 --- a/Synapse/Api/Map.cs +++ b/Synapse/Api/Map.cs @@ -30,7 +30,7 @@ public static List Rooms { get { - return Object.FindObjectsOfType().Where(transform => transform.CompareTag("Room")) + return Object.FindObjectsOfType().Where(transform => transform.CompareTag("Room") || transform.name == "Root_*&*Outside Cams") .Select(obj => new Room {Name = obj.name, Position = obj.position, Transform = obj.transform}) .ToList(); } diff --git a/Synapse/Api/Player.cs b/Synapse/Api/Player.cs index 139f187..7a4b35a 100644 --- a/Synapse/Api/Player.cs +++ b/Synapse/Api/Player.cs @@ -247,7 +247,7 @@ public Room Room var playerPos = Position; var end = playerPos - new Vector3(0f, 10f, 0f); var flag = Physics.Linecast(playerPos, end, out var rayCastHit, -84058629); - + if (!flag || rayCastHit.transform == null) return null; diff --git a/Synapse/Api/Room.cs b/Synapse/Api/Room.cs index 9cc502e..0fcec88 100644 --- a/Synapse/Api/Room.cs +++ b/Synapse/Api/Room.cs @@ -5,20 +5,11 @@ namespace Synapse.Api { public class Room { - private string name; private ZoneType _zone = ZoneType.Unspecified; /// /// The name of the room /// - public string Name - { - get => name; - set - { - if (value == "Root_*&*Outside Cams") name = "Outside"; - else name = value; - } - } + public string Name { get; set; } // ReSharper disable once UnusedAutoPropertyAccessor.Global ///