From 715653214b8043ac1e0f9196f77c7c53568a9eab Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 23 Sep 2023 12:33:39 -0400 Subject: [PATCH] Fix spellbook actions (#20437) --- Content.Server/Magic/MagicSystem.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Server/Magic/MagicSystem.cs b/Content.Server/Magic/MagicSystem.cs index 8ee034fd32..5b990412d8 100644 --- a/Content.Server/Magic/MagicSystem.cs +++ b/Content.Server/Magic/MagicSystem.cs @@ -79,8 +79,9 @@ public sealed class MagicSystem : EntitySystem 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); } @@ -89,7 +90,7 @@ public sealed class MagicSystem : EntitySystem private void OnInit(EntityUid uid, SpellbookComponent component, MapInitEvent args) { - if (!component.LearnPermanently) + if (component.LearnPermanently) return; foreach (var (id, charges) in component.SpellActions) -- 2.51.2