mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-10 16:14:45 +00:00
Elevator initializer no longer sticks in place
Revert of previous commit (c61d228fd8690ae72533b1792a112523b81b4d93) The person who initialized the elevator will drift in front of the elevator again. This is base game behavior.
This commit is contained in:
parent
c61d228fd8
commit
3ce50935c6
@ -3,7 +3,6 @@ using QSB.ElevatorSync.Messages;
|
||||
using QSB.ElevatorSync.WorldObjects;
|
||||
using QSB.Messaging;
|
||||
using QSB.Patches;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
|
||||
namespace QSB.ElevatorSync.Patches;
|
||||
@ -26,22 +25,4 @@ public class ElevatorPatches : QSBPatch
|
||||
var qsbElevator = __instance.GetWorldObject<QSBElevator>();
|
||||
qsbElevator.SendMessage(new ElevatorMessage(isGoingUp));
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(Elevator), nameof(Elevator.AttachPlayerAndStartLift))]
|
||||
public static void Elevator_AttachPlayerAndStartLift(Elevator __instance)
|
||||
{
|
||||
// attach player to their current position instead of gliding them
|
||||
// to the attach point.
|
||||
var attachPoint = __instance._attachPoint;
|
||||
var qsbElevator = __instance.GetWorldObject<QSBElevator>();
|
||||
attachPoint.transform.position = Locator.GetPlayerTransform().position;
|
||||
|
||||
// Runs when the lift/elevator is done moving.
|
||||
// Reset the position of the attach point.
|
||||
Delay.RunWhen(() => !__instance.enabled, () =>
|
||||
{
|
||||
attachPoint.transform.localPosition = qsbElevator.originalAttachPosition;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user