- add: Cleanup TelescopeSystem. (#325)

This commit is contained in:
Aviu00
2024-06-02 17:50:04 +00:00
committed by GitHub
parent 981a83799e
commit ad72eea8a1
4 changed files with 29 additions and 9 deletions

View File

@@ -54,7 +54,9 @@ public abstract class SharedTelescopeSystem : EntitySystem
!TryComp(ent, out EyeComponent? eye))
return;
SetOffset((ent, eye), msg.Offset, telescope);
var offset = Vector2.Lerp(eye.Offset, msg.Offset, telescope.LerpAmount);
SetOffset((ent, eye), offset, telescope);
}
private void SetOffset(Entity<EyeComponent> ent, Vector2 offset, TelescopeComponent telescope)

View File

@@ -6,7 +6,10 @@ namespace Content.Shared._White.Telescope;
public sealed partial class TelescopeComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public float Divisor = 1f;
public float Divisor = 0.1f;
[DataField, ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
public float LerpAmount = 0.1f;
[ViewVariables]
public EntityUid? LastHoldingEntity;