AfterAttack with an EventArg object for a parameter

This commit is contained in:
PrPleGoo
2019-04-05 19:40:46 +02:00
parent 9b2be2ba50
commit 7d85141c9b
5 changed files with 31 additions and 24 deletions

View File

@@ -31,14 +31,14 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
serializer.DataField(ref Damage, "damage", DamageType.Brute);
}
void IAfterAttack.Afterattack(IEntity user, GridCoordinates clicklocation, IEntity attacked)
void IAfterAttack.AfterAttack(AfterAttackEventArgs eventArgs)
{
if (attacked == null)
if (eventArgs.Attacked == null)
{
return;
}
if (!attacked.TryGetComponent(out DamageableComponent damagecomponent)) return;
if (!eventArgs.Attacked.TryGetComponent(out DamageableComponent damagecomponent)) return;
if (Owner.TryGetComponent(out StackComponent stackComponent))
{
if (!stackComponent.Use(1))