Fixes singularity collision and consume range (#13424)
Co-authored-by: keronshb <keronshb@live.com>
This commit is contained in:
@@ -256,7 +256,7 @@ public sealed class SingularitySystem : SharedSingularitySystem
|
||||
/// <param name="uid">The entity UID of the singularity that is consuming the entity.</param>
|
||||
/// <param name="comp">The component of the singularity that is consuming the entity.</param>
|
||||
/// <param name="args">The event arguments.</param>
|
||||
public void OnConsumedEntity(EntityUid uid, SingularityComponent comp, EntityConsumedByEventHorizonEvent args)
|
||||
public void OnConsumedEntity(EntityUid uid, SingularityComponent comp, ref EntityConsumedByEventHorizonEvent args)
|
||||
{
|
||||
AdjustEnergy(uid, BaseEntityEnergy, singularity: comp);
|
||||
}
|
||||
@@ -267,21 +267,21 @@ public sealed class SingularitySystem : SharedSingularitySystem
|
||||
/// <param name="uid">The entity UID of the singularity that is consuming the tiles.</param>
|
||||
/// <param name="comp">The component of the singularity that is consuming the tiles.</param>
|
||||
/// <param name="args">The event arguments.</param>
|
||||
public void OnConsumedTiles(EntityUid uid, SingularityComponent comp, TilesConsumedByEventHorizonEvent args)
|
||||
public void OnConsumedTiles(EntityUid uid, SingularityComponent comp, ref TilesConsumedByEventHorizonEvent args)
|
||||
{
|
||||
AdjustEnergy(uid, args.Tiles.Count * BaseTileEnergy, singularity: comp);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the energy of this singularity to singularities consume it.
|
||||
/// Adds the energy of this singularity to singularities that consume it.
|
||||
/// </summary>
|
||||
/// <param name="uid">The entity UID of the singularity that is being consumed.</param>
|
||||
/// <param name="comp">The component of the singularity that is being consumed.</param>
|
||||
/// <param name="args">The event arguments.</param>
|
||||
private void OnConsumed(EntityUid uid, SingularityComponent comp, EventHorizonConsumedEntityEvent args)
|
||||
private void OnConsumed(EntityUid uid, SingularityComponent comp, ref EventHorizonConsumedEntityEvent args)
|
||||
{
|
||||
// Should be slightly more efficient than checking literally everything we consume for a singularity component and doing the reverse.
|
||||
if (EntityManager.TryGetComponent<SingularityComponent>(args.EventHorizon.Owner, out var singulo))
|
||||
if (EntityManager.TryGetComponent<SingularityComponent>(args.EventHorizonUid, out var singulo))
|
||||
{
|
||||
AdjustEnergy(singulo.Owner, comp.Energy, singularity: singulo);
|
||||
SetEnergy(uid, 0.0f, comp);
|
||||
@@ -294,10 +294,10 @@ public sealed class SingularitySystem : SharedSingularitySystem
|
||||
/// <param name="uid">The entity UID of the singularity food that is being consumed.</param>
|
||||
/// <param name="comp">The component of the singularity food that is being consumed.</param>
|
||||
/// <param name="args">The event arguments.</param>
|
||||
public void OnConsumed(EntityUid uid, SinguloFoodComponent comp, EventHorizonConsumedEntityEvent args)
|
||||
public void OnConsumed(EntityUid uid, SinguloFoodComponent comp, ref EventHorizonConsumedEntityEvent args)
|
||||
{
|
||||
if (EntityManager.TryGetComponent<SingularityComponent>(args.EventHorizon.Owner, out var singulo))
|
||||
AdjustEnergy(args.EventHorizon.Owner, comp.Energy, singularity: singulo);
|
||||
if (EntityManager.TryGetComponent<SingularityComponent>(args.EventHorizonUid, out var singulo))
|
||||
AdjustEnergy(args.EventHorizonUid, comp.Energy, singularity: singulo);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user