diff --git a/QSB/SectorSync/QSBSectorManager.cs b/QSB/SectorSync/QSBSectorManager.cs index 73810001..97ced643 100644 --- a/QSB/SectorSync/QSBSectorManager.cs +++ b/QSB/SectorSync/QSBSectorManager.cs @@ -114,10 +114,45 @@ public class QSBSectorManager : WorldObjectManager x => x._triggerRoot = raft._rideVolume.gameObject); } - // todo cage elevators - // todo prisoner elevator // todo black hole forge + // cage elevators + foreach (var cageElevator in QSBWorldSync.GetUnityObjects()) + { + FakeSector.Create(cageElevator._platformBody.gameObject, + cageElevator.gameObject.GetComponentInParent(), + x => + { + x.gameObject.AddComponent(); + var shape = x.gameObject.AddComponent(); + shape.size = new Vector3(2.5f, 4.25f, 2.5f); + shape.center = new Vector3(0, 2.15f, 0); + + // When the cage elevator warps when entering/exiting the underground, + // the player's sector detector is removed from the fake sector. + // So when the elevator is moving and they leave the sector, it means they have warped + // and should be added back in. + x.OnOccupantExitSector.AddListener((e) => + { + if (cageElevator.isMoving) x.AddOccupant(e); + }); + }); + } + + // prisoner elevator + { + var prisonerElevator = QSBWorldSync.GetUnityObject(); + FakeSector.Create(prisonerElevator._elevatorBody.gameObject, + prisonerElevator.gameObject.GetComponentInParent(), + x => + { + x.gameObject.AddComponent(); + var shape = x.gameObject.AddComponent(); + shape.size = new Vector3(4f, 6.75f, 6.7f); + shape.center = new Vector3(0, 3.3f, 3.2f); + }); + } + // OPC probe { var probe = Locator._orbitalProbeCannon