Merge branch 'master-upstream' into expl_int_analyzer

# Conflicts:
#	Content.Server/GameObjects/Components/Body/Part/BodyPartComponent.cs
#	Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs
#	Content.Server/GameObjects/Components/Chemistry/PillComponent.cs
#	Content.Server/GameObjects/Components/Interactable/TilePryingComponent.cs
#	Content.Server/GameObjects/Components/Items/FloorTileItemComponent.cs
#	Content.Server/GameObjects/Components/Items/RCD/RCDAmmoComponent.cs
#	Content.Server/GameObjects/Components/Items/RCD/RCDComponent.cs
#	Content.Server/GameObjects/Components/Medical/HealingComponent.cs
#	Content.Server/GameObjects/Components/Power/WirePlacerComponent.cs
#	Content.Shared/Chemistry/Solution.cs
This commit is contained in:
Paul
2021-02-04 17:50:28 +01:00
499 changed files with 6357 additions and 8689 deletions

View File

@@ -1,20 +1,18 @@
#nullable enable
using System;
using System.Threading;
using Content.Server.Utility;
using Content.Shared.GameObjects.Components;
using Content.Shared.GameObjects.Components.Doors;
using Content.Shared.GameObjects.Components.Singularity;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.GameObjects;
using Robust.Shared.GameObjects.ComponentDependencies;
using Robust.Shared.GameObjects.Components;
using Robust.Shared.Interfaces.GameObjects;
using Robust.Shared.Interfaces.Timing;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Timer = Robust.Shared.Timers.Timer;
namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
{
@@ -27,19 +25,9 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
private bool _enabled;
private TimeSpan _coolDownEnd;
private PhysicsComponent _collidableComponent;
[ComponentDependency] private readonly PhysicsComponent? _collidableComponent = default!;
public override void Initialize()
{
base.Initialize();
if (!Owner.TryGetComponent(out _collidableComponent))
{
Logger.Error("RadiationCollectorComponent created with no CollidableComponent");
return;
}
}
public override void HandleMessage(ComponentMessage message, IComponent component)
public override void HandleMessage(ComponentMessage message, IComponent? component)
{
base.HandleMessage(message, component);
switch (message)
@@ -52,7 +40,8 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
private void OnAnchoredChanged()
{
if(_collidableComponent.Anchored) Owner.SnapToGrid();
if(_collidableComponent != null && _collidableComponent.Anchored)
Owner.SnapToGrid();
}
bool IInteractHand.InteractHand(InteractHandEventArgs eventArgs)
@@ -99,7 +88,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents
protected void SetAppearance(RadiationCollectorVisualState state)
{
if (Owner.TryGetComponent(out AppearanceComponent appearance))
if (Owner.TryGetComponent<AppearanceComponent>(out var appearance))
{
appearance.SetData(RadiationCollectorVisuals.VisualState, state);
}