Skip to content
This repository has been archived by the owner on Sep 12, 2020. It is now read-only.

Commit

Permalink
fixed Room Surface bug that in Player.Room the Surface is a Room and …
Browse files Browse the repository at this point in the history
…in Map.Rooms it is not
  • Loading branch information
GrafDimenzio committed Jul 21, 2020
1 parent 6902fc2 commit ee3ed71
Showing 3 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Synapse/Api/Map.cs
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ public static List<Room> Rooms
{
get
{
return Object.FindObjectsOfType<Transform>().Where(transform => transform.CompareTag("Room"))
return Object.FindObjectsOfType<Transform>().Where(transform => transform.CompareTag("Room") || transform.name == "Root_*&*Outside Cams")
.Select(obj => new Room {Name = obj.name, Position = obj.position, Transform = obj.transform})
.ToList();
}
2 changes: 1 addition & 1 deletion Synapse/Api/Player.cs
Original file line number Diff line number Diff line change
@@ -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;

11 changes: 1 addition & 10 deletions Synapse/Api/Room.cs
Original file line number Diff line number Diff line change
@@ -5,20 +5,11 @@ namespace Synapse.Api
{
public class Room
{
private string name;
private ZoneType _zone = ZoneType.Unspecified;
/// <summary>
/// The name of the room
/// </summary>
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
/// <summary>

0 comments on commit ee3ed71

Please sign in to comment.