Remove IStartCollide from singulo (#4313)

I accidentally glanced at the rest of singulo code and went blind.
This commit is contained in:
metalgearsloth
2021-07-21 20:33:22 +10:00
committed by GitHub
parent e93692245e
commit 224bd9849b
2 changed files with 50 additions and 41 deletions

View File

@@ -14,7 +14,7 @@ namespace Content.Server.Singularity.Components
{
[RegisterComponent]
[ComponentReference(typeof(SharedSingularityComponent))]
public class ServerSingularityComponent : SharedSingularityComponent, IStartCollide
public class ServerSingularityComponent : SharedSingularityComponent
{
private SharedSingularitySystem _singularitySystem = default!;
@@ -94,46 +94,6 @@ namespace Content.Server.Singularity.Components
Energy -= EnergyDrain * seconds;
}
void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold)
{
// If we're being deleted by another singularity, this call is probably for that singularity.
// Even if not, just don't bother.
if (BeingDeletedByAnotherSingularity)
return;
var otherEntity = otherFixture.Body.Owner;
if (otherEntity.TryGetComponent<IMapGridComponent>(out var mapGridComponent))
{
foreach (var tile in mapGridComponent.Grid.GetTilesIntersecting(ourFixture.Body.GetWorldAABB()))
{
mapGridComponent.Grid.SetTile(tile.GridIndices, Robust.Shared.Map.Tile.Empty);
Energy++;
}
return;
}
if (otherEntity.HasComponent<ContainmentFieldComponent>() ||
(otherEntity.TryGetComponent<ContainmentFieldGeneratorComponent>(out var component) && component.CanRepell(Owner)))
{
return;
}
if (otherEntity.IsInContainer())
return;
// Singularity priority management / etc.
if (otherEntity.TryGetComponent<ServerSingularityComponent>(out var otherSingulo))
otherSingulo.BeingDeletedByAnotherSingularity = true;
otherEntity.QueueDelete();
if (otherEntity.TryGetComponent<SinguloFoodComponent>(out var singuloFood))
Energy += singuloFood.Energy;
else
Energy++;
}
protected override void OnRemove()
{
_playingSound?.Stop();