Fix nullable errors with AfterInteract in UtensilComponent.

This commit is contained in:
Pieter-Jan Briers
2021-01-11 09:36:21 +01:00
parent 99727e8bc3
commit 96b21ffd1d
4 changed files with 23 additions and 20 deletions

View File

@@ -411,7 +411,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
}
var afterInteracts = weapon.GetAllComponents<IAfterInteract>().ToList();
var afterInteractEventArgs = new AfterInteractEventArgs { User = user, ClickLocation = clickLocation, CanReach = canReach };
var afterInteractEventArgs = new AfterInteractEventArgs(user, clickLocation, null, canReach);
foreach (var afterInteract in afterInteracts)
{
@@ -460,10 +460,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
// If we aren't directly attacking the nearby object, lets see if our item has an after attack we can do
var afterAttacks = weapon.GetAllComponents<IAfterInteract>().ToList();
var afterAttackEventArgs = new AfterInteractEventArgs
{
User = user, ClickLocation = clickLocation, Target = attacked, CanReach = true
};
var afterAttackEventArgs = new AfterInteractEventArgs(user, clickLocation, attacked, canReach: true);
foreach (var afterAttack in afterAttacks)
{
@@ -833,10 +830,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click
return;
var afterAttacks = weapon.GetAllComponents<IAfterInteract>().ToList();
var afterAttackEventArgs = new AfterInteractEventArgs
{
User = user, ClickLocation = clickLocation, Target = attacked, CanReach = false
};
var afterAttackEventArgs = new AfterInteractEventArgs(user, clickLocation, attacked, canReach: false);
//See if we have a ranged attack interaction
foreach (var afterAttack in afterAttacks)