]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix spellbook actions (#20437)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Sat, 23 Sep 2023 16:33:39 +0000 (12:33 -0400)
committerGitHub <noreply@github.com>
Sat, 23 Sep 2023 16:33:39 +0000 (09:33 -0700)
Content.Server/Magic/MagicSystem.cs

index 8ee034fd323f989c791b6d44eb8959fb84719c42..5b990412d8a45192124fe3eee6923adfbda57e26 100644 (file)
@@ -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)