Activate with an EventArg object for a parameter

This commit is contained in:
PrPleGoo
2019-04-05 19:44:32 +02:00
parent c90d54664b
commit 66344c3ac7
2 changed files with 9 additions and 4 deletions

View File

@@ -125,7 +125,12 @@ namespace Content.Server.GameObjects.EntitySystems
/// Called when this component is activated by another entity.
/// </summary>
/// <param name="user">Entity that activated this component.</param>
void Activate(IEntity user);
void Activate(ActivateEventArgs eventArgs);
}
public class ActivateEventArgs : EventArgs
{
public IEntity User { get; set; }
}
/// <summary>
@@ -159,7 +164,7 @@ namespace Content.Server.GameObjects.EntitySystems
if (!playerEnt.Transform.GridPosition.InRange(used.Transform.GridPosition, INTERACTION_RANGE))
return;
activateComp.Activate(playerEnt);
activateComp.Activate(new ActivateEventArgs { User = playerEnt });
}
private void HandleUseItemInHand(ICommonSession session, GridCoordinates coords, EntityUid uid)