From 542086d4eba67bf4bd26d6f48132f8e10c42869d Mon Sep 17 00:00:00 2001
From: VALERA771 <72030575+VALERA771@users.noreply.github.com>
Date: Thu, 28 Nov 2024 23:22:06 +0300
Subject: [PATCH] `[Exiled::API]` RoomType & ZoneType & GlassType fix (#252)
---
EXILED/Exiled.API/Enums/RoomType.cs | 7 ++++++-
EXILED/Exiled.API/Enums/ZoneType.cs | 7 ++++++-
EXILED/Exiled.API/Features/Respawn.cs | 1 +
EXILED/Exiled.API/Features/Room.cs | 25 ++++++++++++++-----------
4 files changed, 27 insertions(+), 13 deletions(-)
diff --git a/EXILED/Exiled.API/Enums/RoomType.cs b/EXILED/Exiled.API/Enums/RoomType.cs
index 78d16befb..380db04d0 100644
--- a/EXILED/Exiled.API/Enums/RoomType.cs
+++ b/EXILED/Exiled.API/Enums/RoomType.cs
@@ -210,10 +210,15 @@ public enum RoomType
EzCollapsedTunnel,
///
- /// Entrance Zone's straight hall with Dr.L's locked room.
+ /// Entrance Zone's straight hall with Dr.L's or Dr. Gear's locked room.
///
EzConference,
+ ///
+ /// Entrance Zone's straight hall with Chef's locked room.
+ ///
+ EzChef,
+
///
/// Entrance Zone's straight hall
///
diff --git a/EXILED/Exiled.API/Enums/ZoneType.cs b/EXILED/Exiled.API/Enums/ZoneType.cs
index 7e80190ba..382833528 100644
--- a/EXILED/Exiled.API/Enums/ZoneType.cs
+++ b/EXILED/Exiled.API/Enums/ZoneType.cs
@@ -51,9 +51,14 @@ public enum ZoneType
///
Surface = 8,
+ ///
+ /// The Pocket Dimension.
+ ///
+ Pocket = 16,
+
///
/// An unknown type of zone.
///
- Other = 16,
+ Other = 32,
}
}
\ No newline at end of file
diff --git a/EXILED/Exiled.API/Features/Respawn.cs b/EXILED/Exiled.API/Features/Respawn.cs
index d43ac4e1a..1aecd920c 100644
--- a/EXILED/Exiled.API/Features/Respawn.cs
+++ b/EXILED/Exiled.API/Features/Respawn.cs
@@ -228,6 +228,7 @@ public static void SummonNtfChopper()
///
/// Summons the van.
///
+ /// This will also trigger Music effect.
public static void SummonChaosInsurgencyVan()
{
if (TryGetWaveBase(Faction.FoundationEnemy, out SpawnableWaveBase wave))
diff --git a/EXILED/Exiled.API/Features/Room.cs b/EXILED/Exiled.API/Features/Room.cs
index 4a3d38eab..d21aee638 100644
--- a/EXILED/Exiled.API/Features/Room.cs
+++ b/EXILED/Exiled.API/Features/Room.cs
@@ -434,14 +434,14 @@ private static RoomType FindType(GameObject gameObject)
"HCZ_MicroHID_New" => RoomType.HczHid,
"HCZ_049" => RoomType.Hcz049,
"HCZ_Crossing" => RoomType.HczCrossing,
- "HCZ_106" => RoomType.Hcz106,
+ "HCZ_106_Rework" => RoomType.Hcz106,
"HCZ_Nuke" => RoomType.HczNuke,
"HCZ_Tesla_Rework" => RoomType.HczTesla,
"HCZ_Servers" => RoomType.HczServers,
- "HCZ_Room3" => RoomType.HczTCross,
- "HCZ_457" => RoomType.Hcz096,
- "HCZ_Curve" => RoomType.HczCurve,
- "HCZ_Straight" => RoomType.HczStraight,
+ "HCZ_Room3" or "HCZ_Intersection_Junk" or "HCZ_Intersection" => RoomType.HczTCross,
+ "HCZ_096" => RoomType.Hcz096,
+ "HCZ_Curve" or "HCZ_Corner_Deep" => RoomType.HczCurve,
+ "HCZ_Straight_C" or "HCZ_Straight" or "HCZ_Straight_PipeRoom" or "HCZ_Straight Variant" => RoomType.HczStraight,
"HCZ_Crossroom_Water" => RoomType.HczCrossRoomWater,
"EZ_Endoof" => RoomType.EzVent,
"EZ_Intercom" => RoomType.EzIntercom,
@@ -451,7 +451,8 @@ private static RoomType FindType(GameObject gameObject)
"EZ_PCs" => RoomType.EzPcs,
"EZ_Crossing" => RoomType.EzCrossing,
"EZ_CollapsedTunnel" => RoomType.EzCollapsedTunnel,
- "EZ_Smallrooms2" => RoomType.EzConference,
+ "EZ_Smallrooms2" or "EZ_Smallrooms1" => RoomType.EzConference,
+ "EZ_Chef" => RoomType.EzChef,
"EZ_Straight" => RoomType.EzStraight,
"EZ_Cafeteria" => RoomType.EzCafeteria,
"EZ_upstairs" => RoomType.EzUpstairsPcs,
@@ -461,14 +462,13 @@ private static RoomType FindType(GameObject gameObject)
"PocketWorld" => RoomType.Pocket,
"Outside" => RoomType.Surface,
"HCZ_939" => RoomType.Hcz939,
- "EZ Part" => RoomType.EzCheckpointHallway,
+ "EZ_HCZ_Checkpoint Part" => RoomType.EzCheckpointHallway,
"HCZ_ChkpA" => RoomType.HczElevatorA,
"HCZ_ChkpB" => RoomType.HczElevatorB,
- "HCZ Part" => gameObject.transform.parent.name switch
+ "HCZ_EZ_Checkpoint Part" => gameObject.transform.position.z switch
{
- "HCZ_EZ_Checkpoint (A)" => RoomType.HczEzCheckpointA,
- "HCZ_EZ_Checkpoint (B)" => RoomType.HczEzCheckpointB,
- _ => RoomType.Unknown
+ > 80 => RoomType.HczEzCheckpointA,
+ _ => RoomType.HczEzCheckpointB
},
_ => RoomType.Unknown,
};
@@ -478,6 +478,9 @@ private static ZoneType FindZone(GameObject gameObject)
{
Transform transform = gameObject.transform;
+ if (gameObject.name == "PocketWorld")
+ return ZoneType.Pocket;
+
return transform.parent?.name.RemoveBracketsOnEndOfName() switch
{
"HeavyRooms" => ZoneType.HeavyContainment,