]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix actions not initially appearing (#19990)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Mon, 11 Sep 2023 00:45:35 +0000 (12:45 +1200)
committerGitHub <noreply@github.com>
Mon, 11 Sep 2023 00:45:35 +0000 (10:45 +1000)
Content.Client/Actions/ActionsSystem.cs

index c95ce2d526a49c9029a0aaf179e6c0f836562b00..07b0e6331d19d24f6f48a75556e8a5b49d904a21 100644 (file)
@@ -67,7 +67,7 @@ namespace Content.Client.Actions
                 return;
 
             component.Actions.Clear();
-            component.Actions.UnionWith(GetEntitySet(state.Actions));
+            component.Actions.UnionWith(EnsureEntitySet<ActionsComponent>(state.Actions, uid));
 
             _actionHoldersQueue.Enqueue(uid);
         }
@@ -200,28 +200,6 @@ namespace Content.Client.Actions
             }
         }
 
-        /*public void SaveActionAssignments(string path)
-        {
-
-            // Currently only tested with temporary innate actions (i.e., mapping actions). No guarantee it works with
-            // other actions. If its meant to be used for full game state saving/loading, the entity that provides
-            // actions needs to keep the same uid.
-
-            var sequence = new SequenceDataNode();
-
-            foreach (var (action, assigns) in Assignments.Assignments)
-            {
-                var slot = new MappingDataNode();
-                slot.Add("action", _serializationManager.WriteValue(action));
-                slot.Add("assignments", _serializationManager.WriteValue(assigns));
-                sequence.Add(slot);
-            }
-
-            using var writer = _resourceManager.UserData.OpenWriteText(new ResourcePath(path).ToRootedPath());
-            var stream = new YamlStream { new(sequence.ToSequenceNode()) };
-            stream.Save(new YamlMappingFix(new Emitter(writer)), false);
-        }*/
-
         /// <summary>
         ///     Load actions and their toolbar assignments from a file.
         /// </summary>