Fix 3000 errors
This commit is contained in:
@@ -5,7 +5,6 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Timer = Robust.Shared.Timing.Timer;
|
||||
|
||||
namespace Content.Server.Singularity.Components
|
||||
@@ -14,7 +13,7 @@ namespace Content.Server.Singularity.Components
|
||||
{
|
||||
public readonly ContainmentFieldGeneratorComponent Generator1;
|
||||
public readonly ContainmentFieldGeneratorComponent Generator2;
|
||||
private readonly List<IEntity> _fields = new();
|
||||
private readonly List<EntityUid> _fields = new();
|
||||
private int _sharedEnergyPool;
|
||||
private readonly CancellationTokenSource _powerDecreaseCancellationTokenSource = new();
|
||||
public int SharedEnergyPool
|
||||
@@ -57,7 +56,7 @@ namespace Content.Server.Singularity.Components
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent<ContainmentFieldComponent?>(newEnt, out var containmentFieldComponent))
|
||||
{
|
||||
Logger.Error("While creating Fields in ContainmentFieldConnection, a ContainmentField without a ContainmentFieldComponent was created. Deleting newly spawned ContainmentField...");
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) newEnt);
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(newEnt);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -72,7 +71,7 @@ namespace Content.Server.Singularity.Components
|
||||
Timer.SpawnRepeating(1000, () => { SharedEnergyPool--;}, _powerDecreaseCancellationTokenSource.Token);
|
||||
}
|
||||
|
||||
public bool CanRepell(IEntity toRepell)
|
||||
public bool CanRepell(EntityUidtoRepell)
|
||||
{
|
||||
var powerNeeded = 1;
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<ServerSingularityComponent?>(toRepell, out var singularityComponent))
|
||||
@@ -88,7 +87,7 @@ namespace Content.Server.Singularity.Components
|
||||
_powerDecreaseCancellationTokenSource.Cancel();
|
||||
foreach (var field in _fields)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) field);
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(field);
|
||||
}
|
||||
_fields.Clear();
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ using Robust.Shared.IoC;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Maths;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Broadphase;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.Singularity.Components
|
||||
@@ -63,7 +62,7 @@ namespace Content.Server.Singularity.Components
|
||||
private Tuple<Direction, ContainmentFieldConnection>? _connection1;
|
||||
private Tuple<Direction, ContainmentFieldConnection>? _connection2;
|
||||
|
||||
public bool CanRepell(IEntity toRepell) => _connection1?.Item2?.CanRepell(toRepell) == true ||
|
||||
public bool CanRepell(EntityUidtoRepell) => _connection1?.Item2?.CanRepell(toRepell) == true ||
|
||||
_connection2?.Item2?.CanRepell(toRepell) == true;
|
||||
|
||||
public void OnAnchoredChanged()
|
||||
|
||||
@@ -2,15 +2,10 @@ using Content.Shared.Singularity;
|
||||
using Content.Shared.Singularity.Components;
|
||||
using Content.Shared.Sound;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Physics.Collision;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.Singularity.Components
|
||||
@@ -32,7 +27,7 @@ namespace Content.Server.Singularity.Components
|
||||
_energy = value;
|
||||
if (_energy <= 0)
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) Owner);
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(Owner);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(projectile).WorldRotation = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(component.Owner).WorldRotation;
|
||||
|
||||
// TODO: Move to projectile's code.
|
||||
Timer.Spawn(3000, () => IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) projectile));
|
||||
Timer.Spawn(3000, () => IoCManager.Resolve<IEntityManager>().DeleteEntity(projectile));
|
||||
|
||||
SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound.GetSound(), component.Owner,
|
||||
AudioHelpers.WithVariation(EmitterComponent.Variation).WithVolume(EmitterComponent.Volume).WithMaxDistance(EmitterComponent.Distance));
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
return component.Level - 0.5f;
|
||||
}
|
||||
|
||||
private bool CanDestroy(SharedSingularityComponent component, IEntity entity)
|
||||
private bool CanDestroy(SharedSingularityComponent component, EntityUid entity)
|
||||
{
|
||||
return entity == component.Owner ||
|
||||
IoCManager.Resolve<IEntityManager>().HasComponent<IMapGridComponent>(entity) ||
|
||||
@@ -108,7 +108,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
IoCManager.Resolve<IEntityManager>().HasComponent<ContainmentFieldGeneratorComponent>(entity);
|
||||
}
|
||||
|
||||
private void HandleDestroy(ServerSingularityComponent component, IEntity entity)
|
||||
private void HandleDestroy(ServerSingularityComponent component, EntityUid entity)
|
||||
{
|
||||
// TODO: Need singuloimmune tag
|
||||
if (CanDestroy(component, entity)) return;
|
||||
@@ -125,7 +125,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
otherSingulo.BeingDeletedByAnotherSingularity = true;
|
||||
}
|
||||
|
||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity((EntityUid) entity);
|
||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(entity);
|
||||
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SinguloFoodComponent?>(entity, out var singuloFood))
|
||||
component.Energy += singuloFood.Energy;
|
||||
@@ -147,7 +147,7 @@ namespace Content.Server.Singularity.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
private bool CanPull(IEntity entity)
|
||||
private bool CanPull(EntityUid entity)
|
||||
{
|
||||
return !(IoCManager.Resolve<IEntityManager>().HasComponent<GhostComponent>(entity) ||
|
||||
IoCManager.Resolve<IEntityManager>().HasComponent<IMapGridComponent>(entity) ||
|
||||
|
||||
Reference in New Issue
Block a user