i am a dumb

This commit is contained in:
JohnCorby 2022-01-24 11:46:16 -08:00
parent d0634df2e5
commit ef18f207bf

View File

@ -36,23 +36,27 @@ namespace QSB.ElevatorSync.WorldObjects
public void RemoteCall(bool isGoingUp) public void RemoteCall(bool isGoingUp)
{ {
if (AttachedObject._goingToTheEnd == isGoingUp)
{
return;
}
if (_elevatorTrigger.IsTrackingObject(Locator.GetPlayerDetector())) if (_elevatorTrigger.IsTrackingObject(Locator.GetPlayerDetector()))
{ {
SetDirection(isGoingUp); SetDirection(isGoingUp);
AttachedObject._attachPoint.AttachPlayer(); AttachedObject._attachPoint.AttachPlayer();
if (Locator.GetPlayerSuit().IsWearingSuit() && Locator.GetPlayerSuit().IsTrainingSuit()) if (Locator.GetPlayerSuit().IsWearingSuit() && Locator.GetPlayerSuit().IsTrainingSuit())
{ {
Locator.GetPlayerSuit().RemoveSuit(); Locator.GetPlayerSuit().RemoveSuit();
} }
AttachedObject.StartLift(); RemoteStartLift();
} }
else else
{ {
SetDirection(isGoingUp); SetDirection(isGoingUp);
AttachedObject.StartLift(); RemoteStartLift();
} }
} }
@ -63,6 +67,16 @@ namespace QSB.ElevatorSync.WorldObjects
AttachedObject._targetLocalPos = isGoingUp ? AttachedObject._endLocalPos : AttachedObject._startLocalPos; AttachedObject._targetLocalPos = isGoingUp ? AttachedObject._endLocalPos : AttachedObject._startLocalPos;
} }
private void RemoteStartLift()
{
AttachedObject.enabled = true;
AttachedObject._initLocalPos = AttachedObject.transform.localPosition;
AttachedObject._initLiftTime = Time.time;
AttachedObject._owAudioSourceOneShot.PlayOneShot(AudioType.TH_LiftActivate);
AttachedObject._owAudioSourceLP.FadeIn(0.5f);
AttachedObject._interactVolume.DisableInteraction();
}
public override void DisplayLines() public override void DisplayLines()
{ {
var boxShape = (BoxShape)_elevatorTrigger._shape; var boxShape = (BoxShape)_elevatorTrigger._shape;