Cleanup some events.

This commit is contained in:
Vera Aguilera Puerto
2021-05-26 11:11:14 +02:00
parent 0f703b8f02
commit 74518a421f
2 changed files with 14 additions and 8 deletions

View File

@@ -187,7 +187,7 @@ namespace Content.Shared.GameObjects.EntitySystems
message.PushColor(Color.DarkGray);
// Raise the event and let things that subscribe to it change the message...
RaiseLocalEvent(entity.Uid, new ExaminedEvent(message, examiner, IsInDetailsRange(examiner, entity)));
RaiseLocalEvent(entity.Uid, new ExaminedEvent(message, entity, examiner, IsInDetailsRange(examiner, entity)));
//Add component statuses from components that report one
foreach (var examineComponent in entity.GetAllComponents<IExamine>())
@@ -228,14 +228,20 @@ namespace Content.Shared.GameObjects.EntitySystems
/// </summary>
public IEntity Examiner { get; }
/// <summary>
/// Entity being examined, for broadcast event purposes.
/// </summary>
public IEntity Examined { get; }
/// <summary>
/// Whether the examiner is in range of the entity to get some extra details.
/// </summary>
public bool IsInDetailsRange { get; }
public ExaminedEvent(FormattedMessage message, IEntity examiner, bool isInDetailsRange)
public ExaminedEvent(FormattedMessage message, IEntity examined, IEntity examiner, bool isInDetailsRange)
{
Message = message;
Examined = examined;
Examiner = examiner;
IsInDetailsRange = isInDetailsRange;
}