Small MeleeWeaponSystem cleanup.

Now it TryGets the entities for lunges.
This commit is contained in:
Vera Aguilera Puerto
2021-03-17 17:44:37 +01:00
parent c455b745ba
commit a93e9e9401

View File

@@ -115,10 +115,15 @@ namespace Content.Client.GameObjects.EntitySystems
private void PlayLunge(PlayLungeAnimationMessage msg) private void PlayLunge(PlayLungeAnimationMessage msg)
{ {
EntityManager if (EntityManager.TryGetEntity(msg.Source, out var entity))
.GetEntity(msg.Source) {
.EnsureComponent<MeleeLungeComponent>() entity.EnsureComponent<MeleeLungeComponent>().SetData(msg.Angle);
.SetData(msg.Angle); }
else
{
// FIXME: This should never happen.
Logger.Error($"Tried to play a lunge animation, but the entity \"{msg.Source}\" does not exist.");
}
} }
} }
} }