diff --git a/Content.Server/Vampire/VampireSystem.Transform.cs b/Content.Server/Vampire/VampireSystem.Transform.cs index fbe63403902..045bf0051fa 100644 --- a/Content.Server/Vampire/VampireSystem.Transform.cs +++ b/Content.Server/Vampire/VampireSystem.Transform.cs @@ -101,26 +101,20 @@ public void AddStartingAbilities(EntityUid vampire) if (!action.HasValue) return; - if (!TryComp(action, out var instantActionComponent) || !TryComp(action, out var entityActionComponent)) - return; - - if (instantActionComponent != null) + if (TryComp(action, out var instantActionComponent)) { - var instantActionEvent = instantActionComponent.Event as VampireSelfPowerEvent; - - if (instantActionEvent == null) - return; - - comp.UnlockedPowers.Add(instantActionEvent.DefinitionName, action); + if (instantActionComponent.Event is VampireSelfPowerEvent instantActionEvent) + { + comp.UnlockedPowers.Add(instantActionEvent.DefinitionName, action); + } } - else if (entityActionComponent != null) - { - var entityActionEvent = entityActionComponent.Event as VampireTargetedPowerEvent; - - if (entityActionEvent == null) - return; - comp.UnlockedPowers.Add(entityActionEvent.DefinitionName, action); + if (TryComp(action, out var entityActionComponent)) + { + if (entityActionComponent.Event is VampireTargetedPowerEvent entityActionEvent) + { + comp.UnlockedPowers.Add(entityActionEvent.DefinitionName, action); + } } }