Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
Rinary1 committed Oct 31, 2024
1 parent 47ad633 commit 8f2fa95
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions Content.Server/Vampire/VampireSystem.Transform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,20 @@ public void AddStartingAbilities(EntityUid vampire)
if (!action.HasValue)
return;

if (!TryComp<InstantActionComponent>(action, out var instantActionComponent) || !TryComp<EntityTargetActionComponent>(action, out var entityActionComponent))
return;

if (instantActionComponent != null)
if (TryComp<InstantActionComponent>(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<EntityTargetActionComponent>(action, out var entityActionComponent))
{
if (entityActionComponent.Event is VampireTargetedPowerEvent entityActionEvent)
{
comp.UnlockedPowers.Add(entityActionEvent.DefinitionName, action);
}
}
}

Expand Down

0 comments on commit 8f2fa95

Please sign in to comment.