address reviews

This commit is contained in:
Víctor Aguilera Puerto
2020-09-02 15:22:26 +02:00
parent 2294c32235
commit 3922759a81
2 changed files with 8 additions and 4 deletions

View File

@@ -119,7 +119,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
} }
} }
if(!OnHitEntities(hitEntities, eventArgs)) return true; if(!OnHitEntities(hitEntities, eventArgs)) return false;
if (Arc != null) if (Arc != null)
{ {
@@ -161,7 +161,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
else else
{ {
audioSystem.PlayFromEntity(_missSound, eventArgs.User); audioSystem.PlayFromEntity(_missSound, eventArgs.User);
return true; return false;
} }
if (target.TryGetComponent(out IDamageableComponent damageComponent)) if (target.TryGetComponent(out IDamageableComponent damageComponent))
@@ -172,7 +172,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
var targets = new[] {target}; var targets = new[] {target};
if (!OnHitEntities(targets, eventArgs)) if (!OnHitEntities(targets, eventArgs))
return true; return false;
if (ClickArc != null) if (ClickArc != null)
{ {

View File

@@ -26,12 +26,16 @@ namespace Content.Shared.Interfaces.GameObjects.Components
ClickLocation = clickLocation; ClickLocation = clickLocation;
WideAttack = wideAttack; WideAttack = wideAttack;
Target = target; Target = target;
IEntity? targetEntity = null;
IoCManager.Resolve<IEntityManager>()?.TryGetEntity(Target, out targetEntity);
TargetEntity = targetEntity;
} }
public IEntity User { get; } public IEntity User { get; }
public GridCoordinates ClickLocation { get; } public GridCoordinates ClickLocation { get; }
public bool WideAttack { get; } public bool WideAttack { get; }
public EntityUid Target { get; } public EntityUid Target { get; }
public IEntity? TargetEntity => Target.IsValid() ? IoCManager.Resolve<IEntityManager>()?.GetEntity(Target) ?? null : null; public IEntity? TargetEntity { get; }
} }
} }