Remove ICollideSpecial

Handled in an ECS way by PreventCollideEvent.
The disposals one doesn't work anyway and would've required a larger refactor of disposals to fix so out of scope.
This commit is contained in:
metalgearsloth
2021-05-30 23:30:44 +10:00
parent 8a6ab624ab
commit d93ebe9409
17 changed files with 119 additions and 107 deletions

View File

@@ -413,12 +413,12 @@ namespace Content.Server.GameObjects.Components.Buckle
return new BuckleComponentState(Buckled, drawDepth, LastEntityBuckledTo, DontCollide);
}
public void Update()
public void Update(PhysicsComponent physics)
{
if (!DontCollide || Physics == null)
if (!DontCollide)
return;
Physics.WakeBody();
physics.WakeBody();
if (!IsOnStrapEntityThisFrame && DontCollide)
{

View File

@@ -231,7 +231,7 @@ namespace Content.Server.GameObjects.Components.Doors
// Disabled because it makes it suck hard to walk through double doors.
TryOpen(otherFixture.Body.Owner);
}
#region Opening
@@ -266,14 +266,14 @@ namespace Content.Server.GameObjects.Components.Doors
return true;
}
var doorSystem = EntitySystem.Get<ServerDoorSystem>();
var doorSystem = EntitySystem.Get<DoorSystem>();
var isAirlockExternal = HasAccessType("External");
return doorSystem.AccessType switch
{
ServerDoorSystem.AccessTypes.AllowAll => true,
ServerDoorSystem.AccessTypes.AllowAllIdExternal => isAirlockExternal || access.IsAllowed(user),
ServerDoorSystem.AccessTypes.AllowAllNoExternal => !isAirlockExternal,
DoorSystem.AccessTypes.AllowAll => true,
DoorSystem.AccessTypes.AllowAllIdExternal => isAirlockExternal || access.IsAllowed(user),
DoorSystem.AccessTypes.AllowAllNoExternal => !isAirlockExternal,
_ => access.IsAllowed(user)
};
}

View File

@@ -15,11 +15,9 @@ using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Projectiles
{
[RegisterComponent]
[ComponentReference(typeof(SharedProjectileComponent))]
public class ProjectileComponent : SharedProjectileComponent, IStartCollide
{
protected override EntityUid Shooter => _shooter;
private EntityUid _shooter = EntityUid.Invalid;
[DataField("damages")] private Dictionary<DamageType, int> _damages = new();
@@ -49,7 +47,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
/// <param name="shooter"></param>
public void IgnoreEntity(IEntity shooter)
{
_shooter = shooter.Uid;
Shooter = shooter.Uid;
Dirty();
}
@@ -77,7 +75,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
if (damage != null)
{
Owner.EntityManager.TryGetEntity(_shooter, out var shooter);
Owner.EntityManager.TryGetEntity(Shooter, out var shooter);
foreach (var (damageType, amount) in _damages)
{
@@ -100,7 +98,7 @@ namespace Content.Server.GameObjects.Components.Projectiles
public override ComponentState GetComponentState(ICommonSession player)
{
return new ProjectileComponentState(NetID!.Value, _shooter, IgnoreShooter);
return new ProjectileComponentState(Shooter, IgnoreShooter);
}
}
}

View File

@@ -2,6 +2,7 @@
using Content.Server.GameObjects.Components.Buckle;
using Content.Server.GameObjects.Components.Strap;
using Content.Server.GameObjects.EntitySystems.Click;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces.GameObjects.Components;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
@@ -11,7 +12,7 @@ using Robust.Shared.GameObjects;
namespace Content.Server.GameObjects.EntitySystems
{
[UsedImplicitly]
internal sealed class BuckleSystem : EntitySystem
internal sealed class BuckleSystem : SharedBuckleSystem
{
public override void Initialize()
{
@@ -40,9 +41,9 @@ namespace Content.Server.GameObjects.EntitySystems
public override void Update(float frameTime)
{
foreach (var comp in ComponentManager.EntityQuery<BuckleComponent>())
foreach (var (buckle, physics) in ComponentManager.EntityQuery<BuckleComponent, PhysicsComponent>())
{
comp.Update();
buckle.Update(physics);
}
}

View File

@@ -1,4 +1,5 @@
#nullable enable
using Content.Shared.GameObjects.EntitySystems;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
@@ -7,7 +8,7 @@ namespace Content.Server.GameObjects.EntitySystems
/// <summary>
/// Used on the server side to manage global access level overrides.
/// </summary>
class ServerDoorSystem : EntitySystem
internal sealed class DoorSystem : SharedDoorSystem
{
/// <summary>
/// Determines the base access behavior of all doors on the station.

View File

@@ -53,7 +53,7 @@ namespace Content.Server.GameTicking.GameRules
SoundSystem.Play(filter, "/Audio/Misc/tatoralert.ogg", AudioParams.Default);
EntitySystem.Get<SuspicionEndTimerSystem>().EndTime = _endTime;
EntitySystem.Get<ServerDoorSystem>().AccessType = ServerDoorSystem.AccessTypes.AllowAllNoExternal;
EntitySystem.Get<DoorSystem>().AccessType = DoorSystem.AccessTypes.AllowAllNoExternal;
Timer.SpawnRepeating(DeadCheckDelay, CheckWinConditions, _checkTimerCancel.Token);
}
@@ -62,7 +62,7 @@ namespace Content.Server.GameTicking.GameRules
{
base.Removed();
EntitySystem.Get<ServerDoorSystem>().AccessType = ServerDoorSystem.AccessTypes.Id;
EntitySystem.Get<DoorSystem>().AccessType = DoorSystem.AccessTypes.Id;
EntitySystem.Get<SuspicionEndTimerSystem>().EndTime = null;
_checkTimerCancel.Cancel();