Allow zoom command to ignore zoom limits (#19419)
This commit is contained in:
@@ -4,6 +4,7 @@ using Robust.Client.Console;
|
||||
using Robust.Client.Player;
|
||||
using Robust.Shared.ContentPack;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Client.Administration.Managers
|
||||
@@ -121,5 +122,13 @@ namespace Content.Client.Administration.Managers
|
||||
? _adminData
|
||||
: null;
|
||||
}
|
||||
|
||||
public AdminData? GetAdminData(ICommonSession session, bool includeDeAdmin = false)
|
||||
{
|
||||
if (_player.LocalPlayer?.UserId == session.UserId)
|
||||
return _adminData;
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ public sealed class ZoomCommand : IConsoleCommand
|
||||
|
||||
if (_entManager.TryGetComponent<ContentEyeComponent>(player, out var content))
|
||||
{
|
||||
_entManager.System<ContentEyeSystem>().RequestZoom(player.Value, zoom, content);
|
||||
_entManager.System<ContentEyeSystem>().RequestZoom(player.Value, zoom, true, content);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
|
||||
{
|
||||
[Dependency] private readonly IPlayerManager _player = default!;
|
||||
|
||||
public void RequestZoom(EntityUid uid, Vector2 zoom, ContentEyeComponent? content = null)
|
||||
public void RequestZoom(EntityUid uid, Vector2 zoom, bool ignoreLimit, ContentEyeComponent? content = null)
|
||||
{
|
||||
if (!Resolve(uid, ref content, false))
|
||||
return;
|
||||
@@ -18,6 +18,7 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
|
||||
RaisePredictiveEvent(new RequestTargetZoomEvent()
|
||||
{
|
||||
TargetZoom = zoom,
|
||||
IgnoreLimit = ignoreLimit,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user