Revert "Goida revert (#600)" (#601)

This reverts commit a95fe131
This commit is contained in:
ThereDrD
2024-08-09 21:08:34 +03:00
committed by GitHub
parent e2f75bb380
commit 8e4ebf02aa
408 changed files with 49995 additions and 42785 deletions

View File

@@ -2,6 +2,7 @@ using System.Numerics;
using Content.Client.Viewport;
using Content.Shared._White.Telescope;
using Content.Shared.Hands.Components;
using Content.Shared.Input;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.Input;
@@ -23,6 +24,7 @@ public sealed class TelescopeSystem : SharedTelescopeSystem
private ScalingViewport? _viewport;
public override void FrameUpdate(float frameTime)
{
base.FrameUpdate(frameTime);
@@ -32,19 +34,25 @@ public sealed class TelescopeSystem : SharedTelescopeSystem
var player = _player.LocalEntity;
if (!TryComp<HandsComponent>(player, out var hands) ||
!TryComp<TelescopeComponent>(hands.ActiveHandEntity, out var telescope) ||
!TryComp<EyeComponent>(player.Value, out var eye))
var entity = GetRightEntity(player);
if (entity == EntityUid.Invalid)
return;
var telescope = Comp<TelescopeComponent>(entity);
if (!TryComp<EyeComponent>(player, out var eye))
return;
var offset = Vector2.Zero;
if (_inputSystem.CmdStates.GetState(EngineKeyFunctions.UseSecondary) != BoundKeyState.Down)
if (_inputSystem.CmdStates.GetState(ContentKeyFunctions.LookUp) != BoundKeyState.Down)
{
RaisePredictiveEvent(new EyeOffsetChangedEvent
{
Offset = offset
});
return;
}