Fix can't return to body bug (#4424)
This commit is contained in:
@@ -10,36 +10,20 @@ namespace Content.Shared.Ghost
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SharedGhostComponent, GhostChangeCanReturnToBodyEvent>(OnGhostChangeCanReturnToBody);
|
||||
}
|
||||
|
||||
private void OnGhostChangeCanReturnToBody(EntityUid uid, SharedGhostComponent component, GhostChangeCanReturnToBodyEvent args)
|
||||
public void SetCanReturnToBody(SharedGhostComponent component, bool canReturn)
|
||||
{
|
||||
if (component.CanReturnToBody == args.CanReturnToBody)
|
||||
if (component.CanReturnToBody == canReturn)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
component.CanReturnToBody = args.CanReturnToBody;
|
||||
component.CanReturnToBody = canReturn;
|
||||
component.Dirty();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Raised to change the value of <see cref="SharedGhostComponent.CanReturnToBody"/>
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public class GhostChangeCanReturnToBodyEvent : EntityEventArgs
|
||||
{
|
||||
public GhostChangeCanReturnToBodyEvent(bool canReturnToBody)
|
||||
{
|
||||
CanReturnToBody = canReturnToBody;
|
||||
}
|
||||
|
||||
public bool CanReturnToBody { get; }
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class GhostWarpsRequestEvent : EntityEventArgs
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user