UseEntity with an EventArg object for a parameter

This commit is contained in:
PrPleGoo
2019-04-05 19:42:49 +02:00
parent 7d85141c9b
commit c90d54664b
6 changed files with 18 additions and 13 deletions

View File

@@ -108,7 +108,12 @@ namespace Content.Server.GameObjects.EntitySystems
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
bool UseEntity(IEntity user);
bool UseEntity(UseEntityEventArgs eventArgs);
}
public class UseEntityEventArgs : EventArgs
{
public IEntity User { get; set; }
}
/// <summary>
@@ -356,7 +361,7 @@ namespace Content.Server.GameObjects.EntitySystems
//Try to use item on any components which have the interface
for (var i = 0; i < usables.Count; i++)
{
if (usables[i].UseEntity(user)) //If an attackby returns a status completion we finish our attack
if (usables[i].UseEntity(new UseEntityEventArgs { User = user })) //If an attackby returns a status completion we finish our attack
{
return;
}