OnHitEntities now returns a bool and takes a read only list
This commit is contained in:
@@ -75,8 +75,9 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
serializer.DataField(ref _cooldownTime, "cooldownTime", 1f);
|
||||
}
|
||||
|
||||
public virtual void OnHitEntities(IEnumerable<IEntity> entities)
|
||||
public virtual bool OnHitEntities(IReadOnlyList<IEntity> entities)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void IAttack.Attack(AttackEventArgs eventArgs)
|
||||
@@ -105,7 +106,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
|
||||
}
|
||||
}
|
||||
|
||||
OnHitEntities(hitEntities);
|
||||
if(OnHitEntities(hitEntities)) return;
|
||||
|
||||
var audioSystem = _entitySystemManager.GetEntitySystem<AudioSystem>();
|
||||
var emitter = hitEntities.Count == 0 ? eventArgs.User : hitEntities[0];
|
||||
|
||||
Reference in New Issue
Block a user