Skip to content

Commit

Permalink
Fix spellbook actions (space-wizards#20437)
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectroJr authored Sep 23, 2023
1 parent 52d3d13 commit 7156532
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Content.Server/Magic/MagicSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ private void OnDoAfter(EntityUid uid, SpellbookComponent component, DoAfterEvent

foreach (var (id, charges) in component.SpellActions)
{
// TOOD store spells entity ids on some sort of innate magic user component or something like that.
EntityUid? actionId = null;
if (_actionsSystem.AddAction(uid, ref actionId, id))
if (_actionsSystem.AddAction(args.Args.User, ref actionId, id))
_actionsSystem.SetCharges(actionId, charges < 0 ? null : charges);
}

Expand All @@ -89,7 +90,7 @@ private void OnDoAfter(EntityUid uid, SpellbookComponent component, DoAfterEvent

private void OnInit(EntityUid uid, SpellbookComponent component, MapInitEvent args)
{
if (!component.LearnPermanently)
if (component.LearnPermanently)
return;

foreach (var (id, charges) in component.SpellActions)
Expand Down

0 comments on commit 7156532

Please sign in to comment.