Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A compilation of simple one-line fixes #5661

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
90798ef
Fix warnings in SharedJointSystem
TemporalOroboros Feb 6, 2025
af6958d
Fix reference to EC TransformComponent method
TemporalOroboros Feb 6, 2025
f26225b
Fix obsolete calls in SharedPhysicsSystem.Contacts.cs
TemporalOroboros Feb 6, 2025
4ad6cb1
Fix obsolete call in SharedPhysicsSystem.Components.cs
TemporalOroboros Feb 6, 2025
1a28629
Removes unused local var
TemporalOroboros Feb 6, 2025
fff345d
One-line fixes in SharedPhysicsSystem.Islands.cs
TemporalOroboros Feb 6, 2025
4f1b018
Fix obsolete method call in SharedMapSystem
TemporalOroboros Feb 6, 2025
392fd38
Fix a few obsolete ToMap calls in EntityLookup.Queries
TemporalOroboros Feb 6, 2025
0a432a4
Fix calls to obsolete EntityCoordinate methods in SharedMapSystem.Grids
TemporalOroboros Feb 6, 2025
96437ee
Fix calls to obsolete EntityCoordinate methods in SharedLookupSystem.…
TemporalOroboros Feb 6, 2025
3937c58
Fix a few obsolete method calls in entity spawning
TemporalOroboros Feb 6, 2025
f868548
Fix obsolete method calls in MapLoaderSystem
TemporalOroboros Feb 6, 2025
f35984c
Fix obsolete method call in GridFixtureSystem
TemporalOroboros Feb 6, 2025
4141ff1
Fix obsolete IsMapInitialized call in SaveMap command
TemporalOroboros Feb 6, 2025
e05e023
Fix obsolete MapPosition reference in Client.EyeSystem
TemporalOroboros Feb 6, 2025
e1699e0
Fix obsolete EntitySystem.Get<TSystem> references in DebugLightTreeSy…
TemporalOroboros Feb 6, 2025
2731fca
Fix obsolete EntitySystem.Get<TSystem> reference in DebugEntityLookup…
TemporalOroboros Feb 6, 2025
37b8a2e
Fix obsolete method calls in SpriteBoundsOverlay
TemporalOroboros Feb 6, 2025
1e96ccc
Remove unused IClyde references from controls
TemporalOroboros Feb 6, 2025
92a7319
Remove use of EntitySystem.Get from lightbb command
TemporalOroboros Feb 6, 2025
43a80ea
Fix DebugDrawingSystem
TemporalOroboros Feb 6, 2025
2377cb5
Removes duplicate position set when splitting grids
TemporalOroboros Feb 6, 2025
5c6c250
Fix obsolete method use in PlacementMode
TemporalOroboros Feb 6, 2025
1816592
Fix obsolete method use in Placement Modes
TemporalOroboros Feb 6, 2025
d0f0224
Removes unused local var in gamestate management
TemporalOroboros Feb 6, 2025
073dde5
Fix unreachable code warnings in gamestate management
TemporalOroboros Feb 6, 2025
14618e8
Fix obsolete ToMap use in EyeManager
TemporalOroboros Feb 6, 2025
9f633e9
Make InputManager use a sawmill to log
TemporalOroboros Feb 6, 2025
60b5b6a
Fix obsolete ContainerManagerComponent method calls in ContainerSystem
TemporalOroboros Feb 6, 2025
c09d632
Make ClientPrototypeManager use a sawmill for logging
TemporalOroboros Feb 6, 2025
69ac472
poke tests
TemporalOroboros Feb 6, 2025
0d6b379
Merge branch 'space-wizards:master' into fix-warnings-2
TemporalOroboros Feb 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Robust.Client/Console/Commands/LightBBCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Robust.Client.GameObjects;
using Robust.Shared.Console;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;

namespace Robust.Client.Console.Commands
{
Expand All @@ -11,7 +12,9 @@ internal sealed class LightDebugCommand : LocalizedCommands

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
EntitySystem.Get<DebugLightTreeSystem>().Enabled ^= true;
IoCManager.Resolve<IEntitySystemManager>()
.GetEntitySystem<DebugLightTreeSystem>()
.Enabled ^= true;
}
}
}
Expand Down
17 changes: 7 additions & 10 deletions Robust.Client/Debugging/DebugDrawingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public bool DebugPositions

if (value && !_overlayManager.HasOverlay<EntityPositionOverlay>())
{
_overlayManager.AddOverlay(new EntityPositionOverlay(_lookup, EntityManager, _transform));
_overlayManager.AddOverlay(new EntityPositionOverlay(_lookup, _transform));
}
else
{
Expand All @@ -64,7 +64,7 @@ public bool DebugRotations

if (value && !_overlayManager.HasOverlay<EntityRotationOverlay>())
{
_overlayManager.AddOverlay(new EntityRotationOverlay(_lookup, EntityManager));
_overlayManager.AddOverlay(new EntityRotationOverlay(_lookup, _transform));
}
else
{
Expand All @@ -76,15 +76,13 @@ public bool DebugRotations
private sealed class EntityPositionOverlay : Overlay
{
private readonly EntityLookupSystem _lookup;
private readonly IEntityManager _entityManager;
private readonly SharedTransformSystem _transform;

public override OverlaySpace Space => OverlaySpace.WorldSpace;

public EntityPositionOverlay(EntityLookupSystem lookup, IEntityManager entityManager, SharedTransformSystem transform)
public EntityPositionOverlay(EntityLookupSystem lookup, SharedTransformSystem transform)
{
_lookup = lookup;
_entityManager = entityManager;
_transform = transform;
}

Expand All @@ -110,25 +108,24 @@ protected internal override void Draw(in OverlayDrawArgs args)
private sealed class EntityRotationOverlay : Overlay
{
private readonly EntityLookupSystem _lookup;
private readonly IEntityManager _entityManager;
private readonly TransformSystem _xformSystem;

public override OverlaySpace Space => OverlaySpace.WorldSpace;

public EntityRotationOverlay(EntityLookupSystem lookup, IEntityManager entityManager)
public EntityRotationOverlay(EntityLookupSystem lookup, TransformSystem xformSystem)
{
_lookup = lookup;
_entityManager = entityManager;
_xformSystem = xformSystem;
}

protected internal override void Draw(in OverlayDrawArgs args)
{
const float stubLength = 0.25f;
var worldHandle = (DrawingHandleWorld) args.DrawingHandle;
var xformQuery = _entityManager.GetEntityQuery<TransformComponent>();

foreach (var entity in _lookup.GetEntitiesIntersecting(args.MapId, args.WorldBounds))
{
var (center, worldRotation) = xformQuery.GetComponent(entity).GetWorldPositionRotation();
var (center, worldRotation) = _xformSystem.GetWorldPositionRotation(entity);

var drawLine = worldRotation.RotateVec(-Vector2.UnitY);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@ public sealed class ShowSpriteBBCommand : LocalizedCommands

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
EntitySystem.Get<SpriteBoundsSystem>().Enabled ^= true;
IoCManager.Resolve<IEntityManager>()
.System<SpriteBoundsSystem>()
.Enabled ^= true;
}
}

public sealed class SpriteBoundsSystem : EntitySystem
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly SharedTransformSystem _xformSystem = default!;
[Dependency] private readonly IOverlayManager _overlayManager = default!;
[Dependency] private readonly SpriteTreeSystem _spriteTree = default!;

Expand All @@ -40,7 +42,7 @@ public bool Enabled
if (_enabled)
{
DebugTools.AssertNull(_overlay);
_overlay = new SpriteBoundsOverlay(_spriteTree, _entityManager);
_overlay = new SpriteBoundsOverlay(_spriteTree, _xformSystem);
_overlayManager.AddOverlay(_overlay);
}
else
Expand All @@ -59,13 +61,13 @@ public sealed class SpriteBoundsOverlay : Overlay
{
public override OverlaySpace Space => OverlaySpace.WorldSpace;

private readonly IEntityManager _entityManager;
private readonly SharedTransformSystem _xformSystem;
private SpriteTreeSystem _renderTree;

public SpriteBoundsOverlay(SpriteTreeSystem renderTree, IEntityManager entityManager)
public SpriteBoundsOverlay(SpriteTreeSystem renderTree, SharedTransformSystem xformSystem)
{
_renderTree = renderTree;
_entityManager = entityManager;
_xformSystem = xformSystem;
}

protected internal override void Draw(in OverlayDrawArgs args)
Expand All @@ -76,7 +78,7 @@ protected internal override void Draw(in OverlayDrawArgs args)

foreach (var (sprite, xform) in _renderTree.QueryAabb(currentMap, viewport))
{
var (worldPos, worldRot) = xform.GetWorldPositionRotation();
var (worldPos, worldRot) = _xformSystem.GetWorldPositionRotation(xform);
var bounds = sprite.CalculateRotatedBoundingBox(worldPos, worldRot, args.Viewport.Eye?.Rotation ?? default);

// Get scaled down bounds used to indicate the "south" of a sprite.
Expand Down
4 changes: 2 additions & 2 deletions Robust.Client/GameObjects/EntitySystems/ContainerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private void UpdateEntityRecursively(EntityUid entity)
while (parent.IsValid() && (!spriteOccluded || !lightOccluded))
{
var parentXform = TransformQuery.GetComponent(parent);
if (TryComp<ContainerManagerComponent>(parent, out var manager) && manager.TryGetContainer(child, out var container))
if (TryComp<ContainerManagerComponent>(parent, out var manager) && TryGetContainingContainer(parent, child, out var container, manager))
{
spriteOccluded = spriteOccluded || !container.ShowContents;
lightOccluded = lightOccluded || container.OccludesLight;
Expand Down Expand Up @@ -344,7 +344,7 @@ private void UpdateEntity(
var childLightOccluded = lightOccluded;

// We already know either sprite or light is not occluding so need to check container.
if (manager.TryGetContainer(child, out var container))
if (TryGetContainingContainer(entity, child, out var container, manager))
{
childSpriteOccluded = childSpriteOccluded || !container.ShowContents;
childLightOccluded = childLightOccluded || container.OccludesLight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ namespace Robust.Client.GameObjects;

public sealed class DebugEntityLookupCommand : LocalizedCommands
{
[Dependency] private readonly IEntityManager _entityManager = default!;

public override string Command => "togglelookup";

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
EntitySystem.Get<DebugEntityLookupSystem>().Enabled ^= true;
_entityManager.System<DebugEntityLookupSystem>().Enabled ^= true;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public bool Enabled
if (_enabled)
{
_lightOverlay = new DebugLightOverlay(
EntitySystem.Get<EntityLookupSystem>(),
EntityManager.System<EntityLookupSystem>(),
IoCManager.Resolve<IEyeManager>(),
IoCManager.Resolve<IMapManager>(),
Get<LightTreeSystem>());
EntityManager.System<LightTreeSystem>());

overlayManager.AddOverlay(_lightOverlay);
}
Expand Down
2 changes: 1 addition & 1 deletion Robust.Client/GameObjects/EntitySystems/EyeSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public override void FrameUpdate(float frameTime)
eyeComponent.Target = null;
}

eyeComponent.Eye.Position = xform.MapPosition;
eyeComponent.Eye.Position = TransformSystem.GetMapCoordinates(xform);
}
}
}
Expand Down
10 changes: 6 additions & 4 deletions Robust.Client/GameStates/ClientGameStateManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ public void ApplyGameState()
_processor.UpdateFullRep(curState);
}

IEnumerable<NetEntity> createdEntities;
using (_prof.Group("ApplyGameState"))
{
if (_timing.LastProcessedTick < targetProcessedTick && nextState != null)
Expand Down Expand Up @@ -699,8 +698,9 @@ public void MergeImplicitData()

#if !EXCEPTION_TOLERANCE
throw new KeyNotFoundException();
#endif
#else
continue;
#endif
}

var compData = _compDataPool.Get();
Expand Down Expand Up @@ -961,8 +961,9 @@ private void ApplyEntState(in StateData data, GameTick toTick)
RequestFullState();
#if !EXCEPTION_TOLERANCE
throw;
#endif
#else
return;
#endif
}

if (data.Created)
Expand All @@ -980,8 +981,9 @@ private void ApplyEntState(in StateData data, GameTick toTick)
RequestFullState();
#if !EXCEPTION_TOLERANCE
throw;
#endif
#else
return;
#endif
}
}

Expand Down
3 changes: 2 additions & 1 deletion Robust.Client/Graphics/ClientEye/EyeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ 0 0 1
/// <inheritdoc />
public ScreenCoordinates CoordinatesToScreen(EntityCoordinates point)
{
return MapToScreen(point.ToMap(_entityManager, _entityManager.System<SharedTransformSystem>()));
var transformSystem = _entityManager.System<SharedTransformSystem>();
return MapToScreen(transformSystem.ToMapCoordinates(point));
}

public ScreenCoordinates MapToScreen(MapCoordinates point)
Expand Down
8 changes: 5 additions & 3 deletions Robust.Client/Input/InputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ internal class InputManager : IInputManager
[Dependency] private readonly IUserInterfaceManagerInternal _uiMgr = default!;
[Dependency] private readonly IConsoleHost _console = default!;
[Dependency] private readonly ISerializationManager _serialization = default!;
private ISawmill _logger = default!;

private bool _currentlyFindingViewport;

Expand Down Expand Up @@ -114,6 +115,8 @@ public string GetKeyFunctionButtonString(BoundKeyFunction function)
/// <inheritdoc />
public void Initialize()
{
_logger = Logger.GetSawmill("input");

NetworkBindMap = new BoundKeyMap(_reflectionManager);
NetworkBindMap.PopulateKeyFunctionsMap();

Expand All @@ -130,7 +133,7 @@ public void Initialize()
}
catch (Exception e)
{
Logger.ErrorS("input", "Failed to load user keybindings: " + e);
_logger.Error("Failed to load user keybindings: " + e);
}
}

Expand Down Expand Up @@ -531,8 +534,7 @@ public void LoadKeyFile(ResPath file, bool defaultRegistration, bool userData =

if (reg.Type != KeyBindingType.Command && !NetworkBindMap.FunctionExists(reg.Function.FunctionName))
{
Logger.DebugS("input", "Key function in {0} does not exist: '{1}'.", file,
reg.Function);
_logger.Debug("Key function in {0} does not exist: '{1}'.", file, reg.Function);
invalid = true;
}

Expand Down
13 changes: 8 additions & 5 deletions Robust.Client/Placement/Modes/AlignSimilar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ public override void AlignPlacementMode(ScreenCoordinates mouseScreen)
return;
}

var mapId = MouseCoords.GetMapId(pManager.EntityManager);
var transformSys = pManager.EntityManager.System<SharedTransformSystem>();
var mapId = transformSys.GetMapId(MouseCoords);

var snapToEntities = EntitySystem.Get<EntityLookupSystem>().GetEntitiesInRange(MouseCoords, SnapToRange)
var snapToEntities = pManager.EntityManager.System<EntityLookupSystem>()
.GetEntitiesInRange(MouseCoords, SnapToRange)
.Where(entity => pManager.EntityManager.GetComponent<MetaDataComponent>(entity).EntityPrototype == pManager.CurrentPrototype && pManager.EntityManager.GetComponent<TransformComponent>(entity).MapID == mapId)
.OrderBy(entity => (pManager.EntityManager.GetComponent<TransformComponent>(entity).WorldPosition - MouseCoords.ToMapPos(pManager.EntityManager, pManager.EntityManager.System<SharedTransformSystem>())).LengthSquared())
.OrderBy(entity => (transformSys.GetWorldPosition(entity) - transformSys.ToMapCoordinates(MouseCoords).Position).LengthSquared())
.ToList();

if (snapToEntities.Count == 0)
Expand All @@ -51,10 +53,11 @@ public override void AlignPlacementMode(ScreenCoordinates mouseScreen)

var closestBounds = component.BaseRSI.Size;

var closestPos = transformSys.GetWorldPosition(closestTransform);
var closestRect =
Box2.FromDimensions(
closestTransform.WorldPosition.X - closestBounds.X / 2f,
closestTransform.WorldPosition.Y - closestBounds.Y / 2f,
closestPos.X - closestBounds.X / 2f,
closestPos.Y - closestBounds.Y / 2f,
closestBounds.X, closestBounds.Y);

var sides = new[]
Expand Down
3 changes: 2 additions & 1 deletion Robust.Client/Placement/Modes/AlignSnapgridBorder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ public override void AlignPlacementMode(ScreenCoordinates mouseScreen)
{
MouseCoords = ScreenToCursorGrid(mouseScreen);

var gridIdOpt = MouseCoords.GetGridUid(pManager.EntityManager);
var transformSys = pManager.EntityManager.System<SharedTransformSystem>();
var gridIdOpt = transformSys.GetGrid(MouseCoords);
SnapSize = 1f;
if (gridIdOpt is EntityUid gridId && gridId.IsValid())
{
Expand Down
4 changes: 3 additions & 1 deletion Robust.Client/Placement/Modes/AlignTileDense.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ public override void AlignPlacementMode(ScreenCoordinates mouseScreen)
{
MouseCoords = ScreenToCursorGrid(mouseScreen);

var transformSys = pManager.EntityManager.System<SharedTransformSystem>();

var tileSize = 1f;
var gridIdOpt = MouseCoords.GetGridUid(pManager.EntityManager);
var gridIdOpt = transformSys.GetGrid(MouseCoords);

if (gridIdOpt is EntityUid gridId && gridId.IsValid())
{
Expand Down
4 changes: 3 additions & 1 deletion Robust.Client/Placement/Modes/AlignTileNonDense.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ public override void AlignPlacementMode(ScreenCoordinates mouseScreen)
{
MouseCoords = ScreenToCursorGrid(mouseScreen);

var transformSys = pManager.EntityManager.System<SharedTransformSystem>();

var tileSize = 1f;

var gridIdOpt = MouseCoords.GetGridUid(pManager.EntityManager);
var gridIdOpt = transformSys.GetGrid(MouseCoords);
if (gridIdOpt is EntityUid gridId && gridId.IsValid())
{
var mapGrid = pManager.EntityManager.GetComponent<MapGridComponent>(gridId);
Expand Down
Loading
Loading