Replace Houdini's magical piloting locker with buckle (#1336)

This commit is contained in:
DrSmugleaf
2020-07-26 12:12:53 +02:00
committed by GitHub
parent 4e1597eeb3
commit 96ec60adab
9 changed files with 308 additions and 53 deletions

View File

@@ -273,6 +273,8 @@ namespace Content.Server.GameObjects.Components.Buckle
ReAttach(strap);
BuckleStatus();
SendMessage(new BuckleMessage(Owner, to));
return true;
}
@@ -317,19 +319,13 @@ namespace Content.Server.GameObjects.Components.Buckle
}
}
if (BuckledTo.Owner.TryGetComponent(out StrapComponent strap))
{
strap.Remove(this);
_entitySystem.GetEntitySystem<AudioSystem>()
.PlayFromEntity(strap.UnbuckleSound, Owner);
}
if (Owner.Transform.Parent == BuckledTo.Owner.Transform)
{
ContainerHelpers.AttachParentToContainerOrGrid(Owner.Transform);
Owner.Transform.WorldRotation = BuckledTo.Owner.Transform.WorldRotation;
}
var oldBuckledTo = BuckledTo;
BuckledTo = null;
if (Owner.TryGetComponent(out AppearanceComponent appearance))
@@ -353,6 +349,15 @@ namespace Content.Server.GameObjects.Components.Buckle
BuckleStatus();
if (oldBuckledTo.Owner.TryGetComponent(out StrapComponent strap))
{
strap.Remove(this);
_entitySystem.GetEntitySystem<AudioSystem>()
.PlayFromEntity(strap.UnbuckleSound, Owner);
}
SendMessage(new UnbuckleMessage(Owner, oldBuckledTo.Owner));
return true;
}