xenoarch: early merge radiation trigger fix (#4817) Fix radiation damage being misattributed to radiation receiver (caused artifacts to not be triggered by ambient rads) #41065
Fix radiation damage being misattributed to radiation receiver (caused artifacts to not be triggered by ambient rads) (#41065) * Xenoartifact: Fixed ambient radiation damage not triggering Fixed ambient radiation damage not triggering artifact. * Revert "Xenoartifact: Fixed ambient radiation damage not triggering" This reverts commit 30e5c7cdb49c15574b49ddd1a1f7b1768abd2614. * Fix radiation damage misattribution (cherry picked from commit dd9a1de77ffc68e26d097e4671aa269d4d56e724) Co-authored-by: TheGrimbeeper <thegrimbeeper.11@gmail.com>
This commit is contained in:
parent
2ae8858a41
commit
969ed2599a
|
|
@ -51,9 +51,9 @@ public sealed partial class RadiationSystem : EntitySystem
|
|||
_accumulator = 0f;
|
||||
}
|
||||
|
||||
public void IrradiateEntity(EntityUid uid, float radsPerSecond, float time)
|
||||
public void IrradiateEntity(EntityUid uid, float radsPerSecond, float time, EntityUid? origin = null)
|
||||
{
|
||||
var msg = new OnIrradiatedEvent(time, radsPerSecond, uid);
|
||||
var msg = new OnIrradiatedEvent(time, radsPerSecond, origin);
|
||||
RaiseLocalEvent(uid, msg);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,13 +4,13 @@ namespace Content.Shared.Radiation.Events;
|
|||
/// Raised on entity when it was irradiated
|
||||
/// by some radiation source.
|
||||
/// </summary>
|
||||
public readonly record struct OnIrradiatedEvent(float FrameTime, float RadsPerSecond, EntityUid Origin)
|
||||
public readonly record struct OnIrradiatedEvent(float FrameTime, float RadsPerSecond, EntityUid? Origin)
|
||||
{
|
||||
public readonly float FrameTime = FrameTime;
|
||||
|
||||
public readonly float RadsPerSecond = RadsPerSecond;
|
||||
|
||||
public readonly EntityUid Origin = Origin;
|
||||
public readonly EntityUid? Origin = Origin;
|
||||
|
||||
public float TotalRads => RadsPerSecond * FrameTime;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue