]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix usages of TryIndex() (#39124)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Tue, 9 Sep 2025 16:17:56 +0000 (18:17 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Sep 2025 16:17:56 +0000 (18:17 +0200)
* Fix usages of TryIndex()

Most usages of TryIndex() were using it incorrectly. Checking whether prototype IDs specified in prototypes actually existed before using them. This is not appropriate as it's just hiding bugs that should be getting caught by the YAML linter and other tools. (#39115)

This then resulted in TryIndex() getting modified to log errors (https://github.com/space-wizards/RobustToolbox/commit/94f98073b07bd3fa3133ae6799b34d90f46f467e), which is incorrect as it causes false-positive errors in proper uses of the API: external data validation. (#39098)

This commit goes through and checks every call site of TryIndex() to see whether they were correct. Most call sites were replaced with the new Resolve(), which is suitable for these "defensive programming" use cases.

Fixes #39115

Breaking change: while doing this I noticed IdCardComponent and related systems were erroneously using ProtoId<AccessLevelPrototype> for job prototypes. This has been corrected.

* fix tests

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
136 files changed:
Content.Client/Access/UI/AccessOverriderWindow.xaml.cs
Content.Client/Access/UI/GroupedAccessLevelChecklist.xaml.cs
Content.Client/Access/UI/IdCardConsoleBoundUserInterface.cs
Content.Client/Access/UI/IdCardConsoleWindow.xaml.cs
Content.Client/Administration/UI/BanPanel/BanPanel.xaml.cs
Content.Client/Atmos/AlignAtmosPipeLayers.cs
Content.Client/Audio/Jukebox/JukeboxBoundUserInterface.cs
Content.Client/BarSign/BarSignSystem.cs
Content.Client/BarSign/Ui/BarSignBoundUserInterface.cs
Content.Client/Cargo/UI/BountyEntry.xaml.cs
Content.Client/Cargo/UI/BountyHistoryEntry.xaml.cs
Content.Client/Chat/TypingIndicator/TypingIndicatorVisualizerSystem.cs
Content.Client/Clothing/UI/ChameleonBoundUserInterface.cs
Content.Client/Clothing/UI/ChameleonMenu.xaml.cs
Content.Client/Construction/ConstructionSystem.cs
Content.Client/Construction/UI/ConstructionMenuPresenter.cs
Content.Client/Damage/DamageVisualsSystem.cs
Content.Client/Doors/DoorSystem.cs
Content.Client/Ghost/GhostRoleRadioMenu.xaml.cs
Content.Client/Guidebook/DocumentParsingManager.cs
Content.Client/Implants/ImplanterSystem.cs
Content.Client/Implants/UI/ChameleonControllerMenu.xaml.cs
Content.Client/Implants/UI/ImplanterStatusControl.cs
Content.Client/Lathe/UI/LatheMenu.xaml.cs
Content.Client/Lobby/LobbyUIController.cs
Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs
Content.Client/Lobby/UI/Loadouts/LoadoutContainer.xaml.cs
Content.Client/Lobby/UI/Loadouts/LoadoutGroupContainer.xaml.cs
Content.Client/Lobby/UI/Loadouts/LoadoutWindow.xaml.cs
Content.Client/Overlays/EntityHealthBarOverlay.cs
Content.Client/Overlays/ShowCriminalRecordIconsSystem.cs
Content.Client/Overlays/ShowHealthIconsSystem.cs
Content.Client/Overlays/ShowJobIconsSystem.cs
Content.Client/Overlays/ShowMindShieldIconsSystem.cs
Content.Client/Overlays/StencilOverlay.cs
Content.Client/RCD/RCDMenuBoundUserInterface.cs
Content.Client/Radio/Ui/IntercomMenu.xaml.cs
Content.Client/Revolutionary/RevolutionarySystem.cs
Content.Client/Silicons/StationAi/StationAiCustomizationMenu.xaml.cs
Content.Client/SprayPainter/SprayPainterSystem.cs
Content.Client/Storage/Visualizers/EntityStorageVisualizerSystem.cs
Content.Client/Store/Ui/StoreWithdrawWindow.xaml.cs
Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs
Content.IntegrationTests/Tests/Commands/SuicideCommandTests.cs
Content.IntegrationTests/Tests/ContrabandTest.cs
Content.IntegrationTests/Tests/Lathe/LatheTest.cs
Content.IntegrationTests/Tests/Minds/MindTests.cs
Content.IntegrationTests/Tests/PostMapInitTest.cs
Content.Server/Access/Systems/AgentIDCardSystem.cs
Content.Server/Access/Systems/IdCardConsoleSystem.cs
Content.Server/Access/Systems/PresetIdCardSystem.cs
Content.Server/Administration/Commands/ExplosionCommand.cs
Content.Server/Advertise/EntitySystems/SpeakOnUIClosedSystem.cs
Content.Server/Anomaly/Effects/InnerBodyAnomalySystem.cs
Content.Server/Audio/Jukebox/JukeboxSystem.cs
Content.Server/Cargo/Systems/CargoSystem.Bounty.cs
Content.Server/Cargo/Systems/CargoSystem.Orders.cs
Content.Server/Chat/Systems/ChatSystem.cs
Content.Server/Chemistry/EntitySystems/TransformableContainerSystem.cs
Content.Server/Cloning/CloningSystem.cs
Content.Server/Construction/ConstructionSystem.Guided.cs
Content.Server/Damage/ForceSay/DamageForceSaySystem.cs
Content.Server/Damage/Systems/ExaminableDamageSystem.cs
Content.Server/Delivery/DeliverySystem.cs
Content.Server/Destructible/Thresholds/Behaviors/WeightedSpawnEntityBehavior.cs
Content.Server/EntityEffects/EntityEffectSystem.cs
Content.Server/GameTicking/Rules/AntagLoadProfileRuleSystem.cs
Content.Server/GameTicking/Rules/VariationPass/PuddleMessVariationPassSystem.cs
Content.Server/Ghost/Roles/GhostRoleSystem.cs
Content.Server/Ghost/SpookySpeakerSystem.cs
Content.Server/Implants/ChameleonControllerSystem.cs
Content.Server/Kitchen/EntitySystems/MicrowaveSystem.cs
Content.Server/Lathe/LatheSystem.cs
Content.Server/NameIdentifier/NameIdentifierSystem.cs
Content.Server/Parallax/BiomeSystem.cs
Content.Server/Players/JobWhitelist/JobWhitelistManager.cs
Content.Server/Players/PlayTimeTracking/PlayTimeTrackingSystem.cs
Content.Server/Polymorph/Systems/PolymorphSystem.cs
Content.Server/Polymorph/Toolshed/PolymorphCommand.cs
Content.Server/Procedural/DungeonJob/DungeonJob.Biome.cs
Content.Server/Procedural/DungeonJob/DungeonJob.MiddleConnection.cs
Content.Server/Procedural/DungeonJob/DungeonJob.Ore.cs
Content.Server/Radiation/Systems/RadiationProtectionSystem.cs
Content.Server/Radio/EntitySystems/RadioSystem.cs
Content.Server/Roles/RoleSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs
Content.Server/Silicons/Borgs/BorgSwitchableTypeSystem.cs
Content.Server/Spawners/EntitySystems/ContainerSpawnPointSystem.cs
Content.Server/Speech/EmotesMenuSystem.cs
Content.Server/Spreader/SpreaderSystem.cs
Content.Server/Station/Systems/StationJobsSystem.Roundstart.cs
Content.Server/Station/Systems/StationSpawningSystem.cs
Content.Server/StationEvents/EventManagerSystem.cs
Content.Server/StationEvents/Events/GreytideVirusRule.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraRouterSystem.cs
Content.Server/SurveillanceCamera/Systems/SurveillanceCameraSystem.cs
Content.Server/Telephone/TelephoneSystem.cs
Content.Server/Traitor/Uplink/UplinkSystem.cs
Content.Server/Traits/TraitSystem.cs
Content.Server/Trigger/Systems/SpeakOnTriggerSystem.cs
Content.Server/Wires/WiresSystem.cs
Content.Server/Zombies/ZombieSystem.cs
Content.Shared/Access/Components/AccessComponent.cs
Content.Shared/Access/Components/IdCardComponent.cs
Content.Shared/Access/Components/IdCardConsoleComponent.cs
Content.Shared/Access/Systems/SharedAccessSystem.cs
Content.Shared/Atmos/EntitySystems/SharedAtmosPipeLayersSystem.cs
Content.Shared/BarSign/BarSignSystem.cs
Content.Shared/Body/Systems/SharedBloodstreamSystem.cs
Content.Shared/Cargo/Prototypes/CargoProductPrototype.cs
Content.Shared/Clothing/EntitySystems/SharedChameleonClothingSystem.cs
Content.Shared/Clothing/LoadoutSystem.cs
Content.Shared/ComponentTable/SharedComponentTableSystem.cs
Content.Shared/Construction/MachinePartSystem.cs
Content.Shared/Containers/ContainerCompSystem.cs
Content.Shared/Damage/Systems/DamageableSystem.cs
Content.Shared/Humanoid/Markings/MarkingManager.cs
Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs
Content.Shared/Light/EntitySystems/UnpoweredFlashlightSystem.cs
Content.Shared/Nutrition/EntitySystems/FoodSequenceSystem.cs
Content.Shared/Nutrition/EntitySystems/HungerSystem.cs
Content.Shared/Nutrition/EntitySystems/ThirstSystem.cs
Content.Shared/Nutrition/FoodMetamorphRules/FoodMetamorphRule.cs
Content.Shared/Preferences/HumanoidCharacterProfile.cs
Content.Shared/RCD/Systems/RCDSystem.cs
Content.Shared/Roles/JobRequirement/DepartmentTimeRequirement.cs
Content.Shared/Roles/Jobs/SharedJobSystem.cs
Content.Shared/Roles/SharedRoleSystem.cs
Content.Shared/Silicons/Borgs/SharedBorgSwitchableTypeSystem.cs
Content.Shared/Silicons/StationAi/SharedStationAiSystem.Customization.cs
Content.Shared/SprayPainter/SharedSprayPainterSystem.cs
Content.Shared/Station/SharedStationSpawningSystem.cs
Content.Shared/StatusEffectNew/StatusEffectsSystem.cs
Content.Shared/Storage/EntitySystems/DumpableSystem.cs
Content.Shared/Storage/EntitySystems/SharedStorageSystem.cs
Content.Shared/StoryGen/EntitySystems/StoryGeneratorSystem.cs

index 092a0071fb70643274fbfd5dbc3c8df34dd30dac..8e527d7343a341114a7f3849135085da37075311 100644 (file)
@@ -29,7 +29,7 @@ namespace Content.Client.Access.UI
 
             foreach (var access in accessLevels)
             {
-                if (!protoManager.TryIndex(access, out var accessLevel))
+                if (!protoManager.Resolve(access, out var accessLevel))
                 {
                     continue;
                 }
index 4f07c310092a6c04ecada6508f061b5979dd025f..41d5a84654f9db700437d3e8e58cc03747fffd80 100644 (file)
@@ -57,7 +57,7 @@ public sealed partial class GroupedAccessLevelChecklist : BoxContainer
 
         foreach (var accessGroup in _accessGroups)
         {
-            if (!_protoManager.TryIndex(accessGroup, out var accessGroupProto))
+            if (!_protoManager.Resolve(accessGroup, out var accessGroupProto))
                 continue;
 
             _groupedAccessLevels.Add(accessGroupProto, new());
@@ -65,13 +65,13 @@ public sealed partial class GroupedAccessLevelChecklist : BoxContainer
 
         // Ensure that the 'general' access group is added to handle
         // misc. access levels that aren't associated with any group
-        if (_protoManager.TryIndex(GeneralAccessGroup, out var generalAccessProto))
+        if (_protoManager.Resolve(GeneralAccessGroup, out var generalAccessProto))
             _groupedAccessLevels.TryAdd(generalAccessProto, new());
 
         // Assign known access levels with their associated groups
         foreach (var accessLevel in _accessLevels)
         {
-            if (!_protoManager.TryIndex(accessLevel, out var accessLevelProto))
+            if (!_protoManager.Resolve(accessLevel, out var accessLevelProto))
                 continue;
 
             var assigned = false;
index f3a37f054e55e8731b683a3f60460e54e08353b1..801140f517249a9139528c8d50795150d328ec2b 100644 (file)
@@ -4,6 +4,7 @@ using Content.Shared.Access.Systems;
 using Content.Shared.CCVar;
 using Content.Shared.Containers.ItemSlots;
 using Content.Shared.CrewManifest;
+using Content.Shared.Roles;
 using Robust.Shared.Configuration;
 using Robust.Shared.Prototypes;
 using static Content.Shared.Access.Components.IdCardConsoleComponent;
@@ -74,7 +75,7 @@ namespace Content.Client.Access.UI
             _window?.UpdateState(castState);
         }
 
-        public void SubmitData(string newFullName, string newJobTitle, List<ProtoId<AccessLevelPrototype>> newAccessList, string newJobPrototype)
+        public void SubmitData(string newFullName, string newJobTitle, List<ProtoId<AccessLevelPrototype>> newAccessList, ProtoId<JobPrototype> newJobPrototype)
         {
             if (newFullName.Length > _maxNameLength)
                 newFullName = newFullName[.._maxNameLength];
index 48ae1b0ced5c1669699b0abb761df25d352b1cb4..202653f700ec65a55bc98b4181648f9cee985ad3 100644 (file)
@@ -123,7 +123,7 @@ namespace Content.Client.Access.UI
 
             foreach (var group in job.AccessGroups)
             {
-                if (!_prototypeManager.TryIndex(group, out AccessGroupPrototype? groupPrototype))
+                if (!_prototypeManager.Resolve(group, out AccessGroupPrototype? groupPrototype))
                 {
                     continue;
                 }
index 46090a6f3d04bca79885d87dc5df28bf4e7c7170..c7aed30c1cdf98f32b449509dfae2b04261a7034 100644 (file)
@@ -316,8 +316,9 @@ public sealed partial class BanPanel : DefaultWindow
         };
 
         // This is adding the icon before the role name
-        // Yeah, this is sus, but having to split the functions up and stuff is worse imo.
-        if (_protoMan.TryIndex<JobPrototype>(role, out var jobPrototype) && _protoMan.TryIndex(jobPrototype.Icon, out var iconProto))
+        // TODO: This should not be using raw strings for prototypes as it means it won't be validated at all.
+        // I know the ban manager is doing the same thing, but that should not leak into UI code.
+        if (_protoMan.TryIndex<JobPrototype>(role, out var jobPrototype) && _protoMan.Resolve(jobPrototype.Icon, out var iconProto))
         {
             var jobIconTexture = new TextureRect
             {
index 1bf3310a6cee551ec6c8ca454de0037f37e8c2af..51a6ce0c026d3af2607ccae6a19d394fc3fd207d 100644 (file)
@@ -134,7 +134,7 @@ public sealed class AlignAtmosPipeLayers : SnapgridCenter
 
         var newProtoId = altPrototypes[(int)layer];
 
-        if (!_protoManager.TryIndex(newProtoId, out var newProto))
+        if (!_protoManager.Resolve(newProtoId, out var newProto))
             return;
 
         if (newProto.Type != ConstructionType.Structure)
index 865dfc478d0680fc1e174d79b08f19014a7a4c40..510b9d3def3d8b6688db2dd67777e00f948c562d 100644 (file)
@@ -58,7 +58,7 @@ public sealed class JukeboxBoundUserInterface : BoundUserInterface
 
         _menu.SetAudioStream(jukebox.AudioStream);
 
-        if (_protoManager.TryIndex(jukebox.SelectedSongId, out var songProto))
+        if (_protoManager.Resolve(jukebox.SelectedSongId, out var songProto))
         {
             var length = EntMan.System<AudioSystem>().GetAudioLength(songProto.Path.Path.ToString());
             _menu.SetSelectedSong(songProto.Name, (float) length.TotalSeconds);
index 02e33861b74b9f84b3a769bf0f83c659f49013bf..1ea99864a1a6a2001b7561fe1f104c5598260aed 100644 (file)
@@ -39,7 +39,7 @@ public sealed class BarSignSystem : VisualizerSystem<BarSignComponent>
 
         if (powered
             && sign.Current != null
-            && _prototypeManager.TryIndex(sign.Current, out var proto))
+            && _prototypeManager.Resolve(sign.Current, out var proto))
         {
             SpriteSystem.LayerSetSprite((id, sprite), 0, proto.Icon);
             sprite.LayerSetShader(0, "unshaded");
index 1d1280b2f35f3695308f825818e739684c147b87..fe07f0f1d1494e7ddd811e00e3b51c464717749b 100644 (file)
@@ -35,7 +35,7 @@ public sealed class BarSignBoundUserInterface(EntityUid owner, Enum uiKey) : Bou
 
     public void Update(ProtoId<BarSignPrototype>? sign)
     {
-        if (_prototype.TryIndex(sign, out var signPrototype))
+        if (_prototype.Resolve(sign, out var signPrototype))
             _menu?.UpdateState(signPrototype);
     }
 
index 027d7b3e8011be238db28d7057cfcbee1a5ff3dc..d813f70ff4d4b3d09ec463cb017302db3afe68bb 100644 (file)
@@ -29,7 +29,7 @@ public sealed partial class BountyEntry : BoxContainer
 
         UntilNextSkip = untilNextSkip;
 
-        if (!_prototype.TryIndex<CargoBountyPrototype>(bounty.Bounty, out var bountyPrototype))
+        if (!_prototype.Resolve<CargoBountyPrototype>(bounty.Bounty, out var bountyPrototype))
             return;
 
         var items = new List<string>();
index 54804be641c3b18f23d1dd7688aa6d60c8d49488..98658e5f0a5ba477d55cfc5616c3d760e8fc68fd 100644 (file)
@@ -19,7 +19,7 @@ public sealed partial class BountyHistoryEntry : BoxContainer
         RobustXamlLoader.Load(this);
         IoCManager.InjectDependencies(this);
 
-        if (!_prototype.TryIndex(bounty.Bounty, out var bountyPrototype))
+        if (!_prototype.Resolve(bounty.Bounty, out var bountyPrototype))
             return;
 
         var items = new List<string>();
index c4b0c8f282bdf27eb53b833455b380ade316bbb0..e1197d4ac4ad6ba981b9fd376c370b61c764d56b 100644 (file)
@@ -27,7 +27,7 @@ public sealed class TypingIndicatorVisualizerSystem : VisualizerSystem<TypingInd
         if (overrideIndicator != null)
             currentTypingIndicator = overrideIndicator.Value;
 
-        if (!_prototypeManager.TryIndex(currentTypingIndicator, out var proto))
+        if (!_prototypeManager.Resolve(currentTypingIndicator, out var proto))
         {
             Log.Error($"Unknown typing indicator id: {component.TypingIndicatorPrototype}");
             return;
index 876f300e50c380a7b3ce960a1dd4d7340586d8eb..6595426d481b843f20e5b4fbd8e6c8f7dec60bce 100644 (file)
@@ -45,7 +45,7 @@ public sealed class ChameleonBoundUserInterface : BoundUserInterface
             var newTargets = new List<EntProtoId>();
             foreach (var target in targets)
             {
-                if (string.IsNullOrEmpty(target) || !_proto.TryIndex(target, out EntityPrototype? proto))
+                if (string.IsNullOrEmpty(target) || !_proto.Resolve(target, out EntityPrototype? proto))
                     continue;
 
                 if (!proto.TryGetComponent(out TagComponent? tag, EntMan.ComponentFactory) || !_tag.HasTag(tag, st.RequiredTag))
index c6dce107767e1450b92759b77cc297251f183585..fb4447bdf986374774644f1e2af9d3542e88837e 100644 (file)
@@ -54,7 +54,7 @@ public sealed partial class ChameleonMenu : DefaultWindow
 
         foreach (var id in _possibleIds)
         {
-            if (!_prototypeManager.TryIndex(id, out EntityPrototype? proto))
+            if (!_prototypeManager.Resolve(id, out EntityPrototype? proto))
                 continue;
 
             var lowId = id.Id.ToLowerInvariant();
index 0e7557724fd28b01b7ca96ada7754c2b71585cbc..d693f4ac47c5292e3c8f9ab9b29f23674a237bce 100644 (file)
@@ -80,7 +80,7 @@ namespace Content.Client.Construction
         {
             foreach (var constructionProto in PrototypeManager.EnumeratePrototypes<ConstructionPrototype>())
             {
-                if (!PrototypeManager.TryIndex(constructionProto.Graph, out var graphProto))
+                if (!PrototypeManager.Resolve(constructionProto.Graph, out var graphProto))
                     continue;
 
                 if (constructionProto.TargetNode is not { } targetNodeId)
@@ -121,17 +121,14 @@ namespace Content.Client.Construction
                     // If we got the id of the prototype, we exit the “recursion” by clearing the stack.
                     stack.Clear();
 
-                    if (!PrototypeManager.TryIndex(constructionProto.ID, out ConstructionPrototype? recipe))
+                    if (!PrototypeManager.Resolve(entityId, out var proto))
                         continue;
 
-                    if (!PrototypeManager.TryIndex(entityId, out var proto))
-                        continue;
-
-                    var name = recipe.SetName.HasValue ? Loc.GetString(recipe.SetName) : proto.Name;
-                    var desc = recipe.SetDescription.HasValue ? Loc.GetString(recipe.SetDescription) : proto.Description;
+                    var name = constructionProto.SetName.HasValue ? Loc.GetString(constructionProto.SetName) : proto.Name;
+                    var desc = constructionProto.SetDescription.HasValue ? Loc.GetString(constructionProto.SetDescription) : proto.Description;
 
-                    recipe.Name = name;
-                    recipe.Description = desc;
+                    constructionProto.Name = name;
+                    constructionProto.Description = desc;
 
                     _recipesMetadataCache.Add(constructionProto.ID, entityId);
                 } while (stack.Count > 0);
@@ -172,7 +169,7 @@ namespace Content.Client.Construction
                     "construction-ghost-examine-message",
                     ("name", component.Prototype.Name)));
 
-                if (!PrototypeManager.TryIndex(component.Prototype.Graph, out var graph))
+                if (!PrototypeManager.Resolve(component.Prototype.Graph, out var graph))
                     return;
 
                 var startNode = graph.Nodes[component.Prototype.StartNode];
index 119e92fc6ffddd36f2056caf91783fb52d11cfd6..d5fee2bdda79c7beb77e455a709a5fa141b75a44 100644 (file)
@@ -510,7 +510,7 @@ namespace Content.Client.Construction.UI
 
             foreach (var id in favorites)
             {
-                if (_prototypeManager.TryIndex(id, out ConstructionPrototype? recipe, logError: false))
+                if (_prototypeManager.TryIndex(id, out ConstructionPrototype? recipe))
                     _favoritedRecipes.Add(recipe);
             }
 
index de866ca9a42030a29217910bb8e81be3f618a42c..065bf628bc25fbdde35dad78ff3ea663c0aa38aa 100644 (file)
@@ -150,7 +150,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
         // If the damage container on our entity's DamageableComponent
         // is not null, we can try to check through its groups.
         if (damageComponent.DamageContainerID != null
-            && _prototypeManager.TryIndex<DamageContainerPrototype>(damageComponent.DamageContainerID, out var damageContainer))
+            && _prototypeManager.Resolve<DamageContainerPrototype>(damageComponent.DamageContainerID, out var damageContainer))
         {
             // Are we using damage overlay sprites by group?
             // Check if the container matches the supported groups,
index 3d9a3e2a9aa503d09fcba1e88151ccbae2cedb42..f1697b820d5a3dd856ef1941674876238d8c82c0 100644 (file)
@@ -142,7 +142,7 @@ public sealed class DoorSystem : SharedDoorSystem
 
     private void UpdateSpriteLayers(Entity<SpriteComponent> sprite, string targetProto)
     {
-        if (!_prototypeManager.TryIndex(targetProto, out var target))
+        if (!_prototypeManager.Resolve(targetProto, out var target))
             return;
 
         if (!target.TryGetComponent(out SpriteComponent? targetSprite, _componentFactory))
index 1b65eac6ed952dfb13278fe2e4c51bc93d9cf241..718b6c4995f02f8861b18c5699af8b5ef27976d5 100644 (file)
@@ -65,7 +65,7 @@ public sealed partial class GhostRoleRadioMenu : RadialMenu
             };
 
             // pick the icon if it exists, otherwise fallback to the ghost role's entity
-            if (_prototypeManager.TryIndex(ghostRoleProto.IconPrototype, out var iconProto))
+            if (_prototypeManager.Resolve(ghostRoleProto.IconPrototype, out var iconProto))
                 entProtoView.SetPrototype(iconProto);
             else
                 entProtoView.SetPrototype(ghostRoleProto.EntityPrototype);
index ecf11d4725b3cc6bd28806cadf5c41ae9c92fdd8..8bc1a834fc67243a9e4c2e19d501feefd2c760c5 100644 (file)
@@ -53,7 +53,7 @@ public sealed partial class DocumentParsingManager
 
     public bool TryAddMarkup(Control control, ProtoId<GuideEntryPrototype> entryId, bool log = true)
     {
-        if (!_prototype.TryIndex(entryId, out var entry))
+        if (!_prototype.Resolve(entryId, out var entry))
             return false;
 
         using var file = _resourceManager.ContentFileReadText(entry.Text);
index 4ba4d015ca576b78792dd13331876e0ba923695d..a8c501daf1a01205a12856e231f9552c2eb5ce82 100644 (file)
@@ -28,7 +28,7 @@ public sealed class ImplanterSystem : SharedImplanterSystem
             Dictionary<string, string> implants = new();
             foreach (var implant in component.DeimplantWhitelist)
             {
-                if (_proto.TryIndex(implant, out var proto))
+                if (_proto.Resolve(implant, out var proto))
                     implants.Add(proto.ID, proto.Name);
             }
 
index a41e2e9293edbc3a8d7b30cedd38f28400748bf3..c12ddb9319e2bd5414e2ea626daaf3b9090129df 100644 (file)
@@ -62,7 +62,7 @@ public sealed partial class ChameleonControllerMenu : FancyWindow
         // Go through every outfit and add them to the correct department.
         foreach (var outfit in _outfits)
         {
-            _prototypeManager.TryIndex(outfit.Job, out var jobProto);
+            _prototypeManager.Resolve(outfit.Job, out var jobProto);
 
             var name = outfit.LoadoutName ?? outfit.Name ?? jobProto?.Name ?? "Prototype has no name or job.";
 
index 569dd785d749ae7b47b39ae7e4f9ec80b466e460..24445eeecf079ce3f91a92ebb1d2ab21740bc7bd 100644 (file)
@@ -49,7 +49,7 @@ public sealed class ImplanterStatusControl : Control
         if (_parent.CurrentMode == ImplanterToggleMode.Draw)
         {
             string implantName = _parent.DeimplantChosen != null
-                ? (_prototype.TryIndex(_parent.DeimplantChosen.Value, out EntityPrototype? implantProto) ? implantProto.Name : Loc.GetString("implanter-empty-text"))
+                ? (_prototype.Resolve(_parent.DeimplantChosen.Value, out EntityPrototype? implantProto) ? implantProto.Name : Loc.GetString("implanter-empty-text"))
                 : Loc.GetString("implanter-empty-text");
 
             _label.SetMarkup(Loc.GetString("implanter-label-draw",
index a0dc241c29b711f0ee94a36dd6c094ccab51ad36..f6688a63af4f2f43922c156dcfc60b4466b7948e 100644 (file)
@@ -97,7 +97,7 @@ public sealed partial class LatheMenu : DefaultWindow
         var recipesToShow = new List<LatheRecipePrototype>();
         foreach (var recipe in Recipes)
         {
-            if (!_prototypeManager.TryIndex(recipe, out var proto))
+            if (!_prototypeManager.Resolve(recipe, out var proto))
                 continue;
 
             // Category filtering
@@ -183,7 +183,7 @@ public sealed partial class LatheMenu : DefaultWindow
 
         foreach (var (id, amount) in prototype.Materials)
         {
-            if (!_prototypeManager.TryIndex(id, out var proto))
+            if (!_prototypeManager.Resolve(id, out var proto))
                 continue;
 
             var adjustedAmount = SharedLatheSystem.AdjustMaterial(amount, prototype.ApplyMaterialDiscount, multiplier);
index ec052adea55a50deb02c8b27cd847191d6cc490b..e36a2cd174bd0170344c2f45f44d627e76566477 100644 (file)
@@ -362,7 +362,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
         {
             foreach (var loadout in group)
             {
-                if (!_prototypeManager.TryIndex(loadout.Prototype, out var loadoutProto))
+                if (!_prototypeManager.Resolve(loadout.Prototype, out var loadoutProto))
                     continue;
 
                 _spawn.EquipStartingGear(uid, loadoutProto);
@@ -385,14 +385,14 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
             {
                 foreach (var loadout in loadouts)
                 {
-                    if (!_prototypeManager.TryIndex(loadout.Prototype, out var loadoutProto))
+                    if (!_prototypeManager.Resolve(loadout.Prototype, out var loadoutProto))
                         continue;
 
                     // TODO: Need some way to apply starting gear to an entity and replace existing stuff coz holy fucking shit dude.
                     foreach (var slot in slots)
                     {
                         // Try startinggear first
-                        if (_prototypeManager.TryIndex(loadoutProto.StartingGear, out var loadoutGear))
+                        if (_prototypeManager.Resolve(loadoutProto.StartingGear, out var loadoutGear))
                         {
                             var itemType = ((IEquipmentLoadout) loadoutGear).GetGear(slot.Name);
 
@@ -427,7 +427,7 @@ public sealed class LobbyUIController : UIController, IOnStateEntered<LobbyState
             }
         }
 
-        if (!_prototypeManager.TryIndex(job.StartingGear, out var gear))
+        if (!_prototypeManager.Resolve(job.StartingGear, out var gear))
             return;
 
         foreach (var slot in slots)
index d95cb5bb8cb0f8a6ff140accb08d576dfcde4179..52dba841d06800ce9c69a71992279f1b683b0a58 100644 (file)
@@ -810,7 +810,7 @@ namespace Content.Client.Lobby.UI
             if (_prototypeManager.HasIndex<GuideEntryPrototype>(species))
                 page = new ProtoId<GuideEntryPrototype>(species.Id); // Gross. See above todo comment.
 
-            if (_prototypeManager.TryIndex(DefaultSpeciesGuidebook, out var guideRoot))
+            if (_prototypeManager.Resolve(DefaultSpeciesGuidebook, out var guideRoot))
             {
                 var dict = new Dictionary<ProtoId<GuideEntryPrototype>, GuideEntry>();
                 dict.Add(DefaultSpeciesGuidebook, guideRoot);
@@ -1291,7 +1291,7 @@ namespace Content.Client.Lobby.UI
             var sexes = new List<Sex>();
 
             // add species sex options, default to just none if we are in bizzaro world and have no species
-            if (_prototypeManager.TryIndex<SpeciesPrototype>(Profile.Species, out var speciesProto))
+            if (_prototypeManager.Resolve<SpeciesPrototype>(Profile.Species, out var speciesProto))
             {
                 foreach (var sex in speciesProto.Sexes)
                 {
@@ -1384,7 +1384,7 @@ namespace Content.Client.Lobby.UI
             if (species is null)
                 return;
 
-            if (!_prototypeManager.TryIndex<SpeciesPrototype>(species, out var speciesProto))
+            if (!_prototypeManager.Resolve<SpeciesPrototype>(species, out var speciesProto))
                 return;
 
             // Don't display the info button if no guide entry is found
index 2264cecd230ebc59cb171a984d98af03bf16b8ee..035f4a3c1a82628246b38a3141fdafbf132de1f5 100644 (file)
@@ -40,7 +40,7 @@ public sealed partial class LoadoutContainer : BoxContainer
             SelectButton.TooltipSupplier = _ => tooltip;
         }
 
-        if (_protoManager.TryIndex(proto, out var loadProto))
+        if (_protoManager.Resolve(proto, out var loadProto))
         {
             var ent = loadProto.DummyEntity ?? _entManager.System<LoadoutSystem>().GetFirstOrNull(loadProto);
 
index b06e7e41d1fc62d3fd47e40116b5591e4e9713d1..644910db601c64c5582c2b7801a019cde1c796d0 100644 (file)
@@ -62,7 +62,7 @@ public sealed partial class LoadoutGroupContainer : BoxContainer
             });
         }
 
-        if (protoMan.TryIndex(loadout.Role, out var roleProto) && roleProto.Points != null && loadout.Points != null)
+        if (protoMan.Resolve(loadout.Role, out var roleProto) && roleProto.Points != null && loadout.Points != null)
         {
             RestrictionsContainer.AddChild(new Label()
             {
@@ -112,14 +112,14 @@ public sealed partial class LoadoutGroupContainer : BoxContainer
                     })
                     .ToList();
 
-                /* 
-                * Determine which element should be displayed first: 
-                * - If any element is currently selected (its button is pressed), use it. 
-                * - Otherwise, fallback to the first element in the list. 
-                * 
-                * This moves the selected item outside of the sublist for better usability, 
-                * making it easier for players to quickly toggle loadout options (e.g. clothing, accessories) 
-                * without having to search inside expanded subgroups. 
+                /*
+                * Determine which element should be displayed first:
+                * - If any element is currently selected (its button is pressed), use it.
+                * - Otherwise, fallback to the first element in the list.
+                *
+                * This moves the selected item outside of the sublist for better usability,
+                * making it easier for players to quickly toggle loadout options (e.g. clothing, accessories)
+                * without having to search inside expanded subgroups.
                 */
                 var firstElement = uiElements.FirstOrDefault(e => e.Select.Pressed) ?? uiElements[0];
 
@@ -195,8 +195,8 @@ public sealed partial class LoadoutGroupContainer : BoxContainer
     /// <summary>
     /// Creates a UI container for a single Loadout item.
     ///
-    /// This method was extracted from RefreshLoadouts because the logic for creating 
-    /// individual loadout items is used multiple times inside that method, and duplicating 
+    /// This method was extracted from RefreshLoadouts because the logic for creating
+    /// individual loadout items is used multiple times inside that method, and duplicating
     /// the code made it harder to maintain.
     ///
     /// Logic:
index 68e1ecbeaeefdb8c22b8ffc8440634db35a4fefe..50860b349a9e9d8ebc77b3f27a59dbc09ca7be39 100644 (file)
@@ -68,7 +68,7 @@ public sealed partial class LoadoutWindow : FancyWindow
         {
             foreach (var group in proto.Groups)
             {
-                if (!protoManager.TryIndex(group, out var groupProto))
+                if (!protoManager.Resolve(group, out var groupProto))
                     continue;
 
                 if (groupProto.Hidden)
index 9ff0422aba0f41f055f747d3bb9c60b70220a86d..cf9d879844d834404b02f33e95c40f46c1849928 100644 (file)
@@ -57,7 +57,7 @@ public sealed class EntityHealthBarOverlay : Overlay
         const float scale = 1f;
         var scaleMatrix = Matrix3Helpers.CreateScale(new Vector2(scale, scale));
         var rotationMatrix = Matrix3Helpers.CreateRotation(-rotation);
-        _prototype.TryIndex(StatusIcon, out var statusIcon);
+        _prototype.Resolve(StatusIcon, out var statusIcon);
 
         var query = _entManager.AllEntityQueryEnumerator<MobThresholdsComponent, MobStateComponent, DamageableComponent, SpriteComponent>();
         while (query.MoveNext(out var uid,
index c353b1727295c4739f59cffe48595dbad38d9ffc..9a84defba0268bfcacebf797c3a5f6a451dea097 100644 (file)
@@ -22,7 +22,7 @@ public sealed class ShowCriminalRecordIconsSystem : EquipmentHudSystem<ShowCrimi
         if (!IsActive)
             return;
 
-        if (_prototype.TryIndex(component.StatusIcon, out var iconPrototype))
+        if (_prototype.Resolve(component.StatusIcon, out var iconPrototype))
             ev.StatusIcons.Add(iconPrototype);
     }
 }
index 3301261bd09e3931089160d64946c15e27242b34..0a875e79c58249996c2ca3bf502d145a79b849a7 100644 (file)
@@ -78,9 +78,9 @@ public sealed class ShowHealthIconsSystem : EquipmentHudSystem<ShowHealthIconsCo
             if (TryComp<MobStateComponent>(entity, out var state))
             {
                 // Since there is no MobState for a rotting mob, we have to deal with this case first.
-                if (HasComp<RottingComponent>(entity) && _prototypeMan.TryIndex(damageableComponent.RottingIcon, out var rottingIcon))
+                if (HasComp<RottingComponent>(entity) && _prototypeMan.Resolve(damageableComponent.RottingIcon, out var rottingIcon))
                     result.Add(rottingIcon);
-                else if (damageableComponent.HealthIcons.TryGetValue(state.CurrentState, out var value) && _prototypeMan.TryIndex(value, out var icon))
+                else if (damageableComponent.HealthIcons.TryGetValue(state.CurrentState, out var value) && _prototypeMan.Resolve(value, out var icon))
                     result.Add(icon);
             }
         }
index d0d14449f66a9637e14dd786224b93ea5c0966b3..faf4024c2fa38c3cd70452d6c98a82392e893966 100644 (file)
@@ -51,7 +51,7 @@ public sealed class ShowJobIconsSystem : EquipmentHudSystem<ShowJobIconsComponen
             }
         }
 
-        if (_prototype.TryIndex(iconId, out var iconPrototype))
+        if (_prototype.Resolve(iconId, out var iconPrototype))
             ev.StatusIcons.Add(iconPrototype);
         else
             Log.Error($"Invalid job icon prototype: {iconPrototype}");
index 8f8b8e6407754e598a46b9bdf3197ffc9e7b6b6a..33cb3ddd932871330d3ca642d02d4f4745f77fd1 100644 (file)
@@ -23,7 +23,7 @@ public sealed class ShowMindShieldIconsSystem : EquipmentHudSystem<ShowMindShiel
     {
         if(!IsActive)
             return;
-        if (component.IsEnabled && _prototype.TryIndex(component.MindShieldStatusIcon, out var fakeStatusIconPrototype))
+        if (component.IsEnabled && _prototype.Resolve(component.MindShieldStatusIcon, out var fakeStatusIconPrototype))
             ev.StatusIcons.Add(fakeStatusIconPrototype);
     }
 
@@ -32,7 +32,7 @@ public sealed class ShowMindShieldIconsSystem : EquipmentHudSystem<ShowMindShiel
         if (!IsActive)
             return;
 
-        if (_prototype.TryIndex(component.MindShieldStatusIcon, out var iconPrototype))
+        if (_prototype.Resolve(component.MindShieldStatusIcon, out var iconPrototype))
             ev.StatusIcons.Add(iconPrototype);
     }
 }
index 0796be08e1683bdff9c17af0ba4643f76b285362..55cb1811a51359bf4a52046a58e6bb3d7b8c6cc7 100644 (file)
@@ -65,7 +65,7 @@ public sealed partial class StencilOverlay : Overlay
         {
             foreach (var (proto, weather) in comp.Weather)
             {
-                if (!_protoManager.TryIndex<WeatherPrototype>(proto, out var weatherProto))
+                if (!_protoManager.Resolve<WeatherPrototype>(proto, out var weatherProto))
                     continue;
 
                 var alpha = _weather.GetPercent(weather, mapUid);
index c001b7ec70a5850ed0aa6bba7529bc2b966765e5..3c9d5d1e55aedd03f1dbefc2161f284349344c0b 100644 (file)
@@ -125,8 +125,10 @@ public sealed class RCDMenuBoundUserInterface : BoundUserInterface
             var name = Loc.GetString(proto.SetName);
 
             if (proto.Prototype != null &&
-                _prototypeManager.TryIndex(proto.Prototype, out var entProto, logError: false))
+                _prototypeManager.Resolve(proto.Prototype, out var entProto))
+            {
                 name = entProto.Name;
+            }
 
             msg = Loc.GetString("rcd-component-change-build-mode", ("name", name));
         }
@@ -142,7 +144,7 @@ public sealed class RCDMenuBoundUserInterface : BoundUserInterface
 
         if (proto.Mode is RcdMode.ConstructTile or RcdMode.ConstructObject
             && proto.Prototype != null
-            && _prototypeManager.TryIndex(proto.Prototype, out var entProto, logError: false))
+            && _prototypeManager.Resolve(proto.Prototype, out var entProto))
         {
             tooltip = Loc.GetString(entProto.Name);
         }
index f66b3db000e5a6a8b3c7c751b62fb781f340a2bb..887c6f64432b7d6f49acabb246a6e4c8f3ab6829 100644 (file)
@@ -42,7 +42,7 @@ public sealed partial class IntercomMenu : FancyWindow
         for (var i = 0; i < entity.Comp.SupportedChannels.Count; i++)
         {
             var channel = entity.Comp.SupportedChannels[i];
-            if (!_prototype.TryIndex(channel, out var prototype))
+            if (!_prototype.Resolve(channel, out var prototype))
                 continue;
 
             _channels.Add(channel);
index 8e7e687fa8fcfba4859b7e444d27ef029162ac33..2dc16d9c11f5cfa026cd03def5715800392b83e3 100644 (file)
@@ -25,13 +25,13 @@ public sealed class RevolutionarySystem : SharedRevolutionarySystem
         if (HasComp<HeadRevolutionaryComponent>(ent))
             return;
 
-        if (_prototype.TryIndex(ent.Comp.StatusIcon, out var iconPrototype))
+        if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
             args.StatusIcons.Add(iconPrototype);
     }
 
     private void GetHeadRevIcon(Entity<HeadRevolutionaryComponent> ent, ref GetStatusIconsEvent args)
     {
-        if (_prototype.TryIndex(ent.Comp.StatusIcon, out var iconPrototype))
+        if (_prototype.Resolve(ent.Comp.StatusIcon, out var iconPrototype))
             args.StatusIcons.Add(iconPrototype);
     }
 }
index 009969196ba0c18e873d29f38bc033a6f8c46f7d..3c5375a8e46af21af5881041c5f7cca13e880cea 100644 (file)
@@ -44,7 +44,7 @@ public sealed partial class StationAiCustomizationMenu : FancyWindow
             StationAiCustomizationPrototype? selectedPrototype = null;
 
             if (stationAiCustomization?.ProtoIds.TryGetValue(groupPrototype, out var selectedProtoId) == true)
-                _protoManager.TryIndex(selectedProtoId, out selectedPrototype);
+                _protoManager.Resolve(selectedProtoId, out selectedPrototype);
 
             _buttonGroups[groupPrototype] = new ButtonGroup();
             _groupContainers[groupPrototype] = new StationAiCustomizationGroupContainer(groupPrototype, selectedPrototype, _buttonGroups[groupPrototype], this, _protoManager);
@@ -76,7 +76,7 @@ public sealed partial class StationAiCustomizationMenu : FancyWindow
             // Create UI entries for all customization in the group
             foreach (var protoId in groupPrototype.ProtoIds)
             {
-                if (!protoManager.TryIndex(protoId, out var prototype))
+                if (!protoManager.Resolve(protoId, out var prototype))
                     continue;
 
                 var entry = new StationAiCustomizationEntryContainer(groupPrototype, prototype, buttonGroup, menu);
index 8f7d7f03622e798bceac0fe10a8c510516c97aae..788e97bef1685f467361f8c4ab73bcc9cfe04c2f 100644 (file)
@@ -65,7 +65,7 @@ public sealed class SprayPainterSystem : SharedSprayPainterSystem
             var groupList = new List<string>();
             foreach (var groupId in category.Groups)
             {
-                if (!Proto.TryIndex(groupId, out var group))
+                if (!Proto.Resolve(groupId, out var group))
                     continue;
 
                 groupList.Add(groupId);
index c10a24ac3230654a08c8c51f150301db27852008..ea0b800ccc4b1ff8e0963aca9120d471d09aa193 100644 (file)
@@ -42,7 +42,7 @@ public sealed class EntityStorageVisualizerSystem : VisualizerSystem<EntityStora
         var forceRedrawBase = false;
         if (AppearanceSystem.TryGetData<string>(uid, PaintableVisuals.Prototype, out var prototype, args.Component))
         {
-            if (_prototypeManager.TryIndex(prototype, out var proto))
+            if (_prototypeManager.Resolve(prototype, out var proto))
             {
                 if (proto.TryGetComponent(out SpriteComponent? sprite, _componentFactory))
                 {
index a8b93cd2b3a010a8831821bf7b276ad124a51555..e706e74bc33ed33966bb148e6d84e2a497246492 100644 (file)
@@ -33,7 +33,7 @@ public sealed partial class StoreWithdrawWindow : DefaultWindow
         _validCurrencies.Clear();
         foreach (var currency in balance)
         {
-            if (!_prototypeManager.TryIndex(currency.Key, out var proto))
+            if (!_prototypeManager.Resolve(currency.Key, out var proto))
                 continue;
 
             _validCurrencies.Add(proto, currency.Value);
index 41d29e8080a51a4aad28cbdfdb29a1e7bfdb4e13..9077f95565d86c0c19896e6bdf590c104e9942c9 100644 (file)
@@ -120,7 +120,7 @@ namespace Content.Client.VendingMachines.UI
             {
                 var entry = inventory[i];
 
-                if (!_prototypeManager.TryIndex(entry.ID, out var prototype))
+                if (!_prototypeManager.Resolve(entry.ID, out var prototype))
                 {
                     _amounts[entry.ID] = 0;
                     continue;
index 61b8d544484dfdc6f2e7a68a91dbe242a28fe9ab..c232ccf415e538dae422086d46082b819df0e27c 100644 (file)
@@ -146,8 +146,8 @@ public sealed class SuicideCommandTests
             mobThresholdsComp = entManager.GetComponent<MobThresholdsComponent>(player);
             damageableComp = entManager.GetComponent<DamageableComponent>(player);
 
-            if (protoMan.TryIndex(DamageType, out var slashProto))
-                damageableSystem.TryChangeDamage(player, new DamageSpecifier(slashProto, FixedPoint2.New(46.5)));
+            var slashProto = protoMan.Index(DamageType);
+            damageableSystem.TryChangeDamage(player, new DamageSpecifier(slashProto, FixedPoint2.New(46.5)));
         });
 
         // Check that running the suicide command kills the player
index a33e7c2067bc15033b2535b36fd6060ea4a8e6f2..c52ef293e1eb853532f8dd6d2b4fc162a84d1b08 100644 (file)
@@ -27,8 +27,11 @@ public sealed class ContrabandTest
                     if (!proto.TryGetComponent<ContrabandComponent>(out var contraband, componentFactory))
                         continue;
 
-                    Assert.That(protoMan.TryIndex(contraband.Severity, out var severity, false),
-                        @$"{proto.ID} has a ContrabandComponent with a unknown severity.");
+                    if (!protoMan.TryIndex(contraband.Severity, out var severity))
+                    {
+                        Assert.Fail($"{proto.ID} has a ContrabandComponent with a unknown severity.");
+                        continue;
+                    }
 
                     if (!severity.ShowDepartmentsAndJobs)
                         continue;
index 2fe347f6362303a3c744b82b265c8be154c35f02..c335f8d6c8a8ff948354d6619a0c9a9c3c600983 100644 (file)
@@ -88,14 +88,18 @@ public sealed class LatheTest
                     // Check each recipe assigned to this lathe
                     foreach (var recipeId in recipes)
                     {
-                        Assert.That(protoMan.TryIndex(recipeId, out var recipeProto));
+                        if (!protoMan.TryIndex(recipeId, out var recipeProto))
+                        {
+                            Assert.Fail($"Lathe recipe '{recipeId}' does not exist");
+                            continue;
+                        }
 
                         // Track the total material volume of the recipe
                         var totalQuantity = 0;
                         // Check each material called for by the recipe
                         foreach (var (materialId, quantity) in recipeProto.Materials)
                         {
-                            Assert.That(protoMan.TryIndex(materialId, out var materialProto));
+                            Assert.That(protoMan.HasIndex(materialId), $"Material '{materialId}' does not exist");
                             // Make sure the material is accepted by the lathe
                             Assert.That(acceptedMaterials, Does.Contain(materialId), $"Lathe {latheProto.ID} has recipe {recipeId} but does not accept any materials containing {materialId}");
                             totalQuantity += quantity;
index 2f7751982938d3d8d947f3c73f16a4f012b77efa..1bda6fd4dba8c97e2f9b794e740def7ac6036324 100644 (file)
@@ -145,10 +145,7 @@ public sealed partial class MindTests
         await server.WaitAssertion(() =>
         {
             var damageable = entMan.GetComponent<DamageableComponent>(entity);
-            if (!protoMan.TryIndex(BluntDamageType, out var prototype))
-            {
-                return;
-            }
+            var prototype = protoMan.Index(BluntDamageType);
 
             damageableSystem.SetDamage(entity, damageable, new DamageSpecifier(prototype, FixedPoint2.New(401)));
             Assert.That(mindSystem.GetMind(entity, mindContainerComp), Is.EqualTo(mindId));
index a7a50a5270fb5e603684aaba7ecee505428c8140..22db3ca31f85d107877e0ecc9d8ad579e756fa47 100644 (file)
@@ -256,8 +256,7 @@ namespace Content.IntegrationTests.Tests
                 return;
 
             var yamlEntities = node["entities"];
-            if (!protoManager.TryIndex(DoNotMapCategory, out var dnmCategory))
-                return;
+            var dnmCategory = protoManager.Index(DoNotMapCategory);
 
             Assert.Multiple(() =>
             {
@@ -266,7 +265,7 @@ namespace Content.IntegrationTests.Tests
                     var protoId = yamlEntity["proto"].AsString();
 
                     // This doesn't properly handle prototype migrations, but thats not a significant issue.
-                    if (!protoManager.TryIndex(protoId, out var proto, false))
+                    if (!protoManager.TryIndex(protoId, out var proto))
                         continue;
 
                     Assert.That(!proto.Categories.Contains(dnmCategory),
index 0df760baef1de26882274ea85a65c679c0b87570..1706908e72d9860ada2c0e25d8d46783279e5c90 100644 (file)
@@ -45,7 +45,7 @@ namespace Content.Server.Access.Systems
             if (!TryComp<IdCardComponent>(ent, out var idCardComp))
                 return;
 
-            _prototypeManager.TryIndex(args.Args.ChameleonOutfit.Job, out var jobProto);
+            _prototypeManager.Resolve(args.Args.ChameleonOutfit.Job, out var jobProto);
 
             var jobIcon = args.Args.ChameleonOutfit.Icon ?? jobProto?.Icon;
             var jobName = args.Args.ChameleonOutfit.Name ?? jobProto?.Name ?? "";
@@ -130,7 +130,7 @@ namespace Content.Server.Access.Systems
             if (!TryComp<IdCardComponent>(uid, out var idCard))
                 return;
 
-            if (!_prototypeManager.TryIndex(args.JobIconId, out var jobIcon))
+            if (!_prototypeManager.Resolve(args.JobIconId, out var jobIcon))
                 return;
 
             _cardSystem.TryChangeJobIcon(uid, jobIcon, idCard);
index 62dfddbb5890cfddd7b5dcc67b1e45c327148758..13f2430b3d9132f50444a8317a28c0826944bd5a 100644 (file)
@@ -98,7 +98,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
             var targetIdComponent = Comp<IdCardComponent>(targetId);
             var targetAccessComponent = Comp<AccessComponent>(targetId);
 
-            var jobProto = targetIdComponent.JobPrototype ?? new ProtoId<AccessLevelPrototype>(string.Empty);
+            var jobProto = targetIdComponent.JobPrototype ?? new ProtoId<JobPrototype>(string.Empty);
             if (TryComp<StationRecordKeyStorageComponent>(targetId, out var keyStorage)
                 && keyStorage.Key is { } key
                 && _record.TryGetRecord<GeneralStationRecord>(key, out var record))
@@ -130,7 +130,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
         string newFullName,
         string newJobTitle,
         List<ProtoId<AccessLevelPrototype>> newAccessList,
-        ProtoId<AccessLevelPrototype> newJobProto,
+        ProtoId<JobPrototype> newJobProto,
         EntityUid player,
         IdCardConsoleComponent? component = null)
     {
@@ -144,7 +144,7 @@ public sealed class IdCardConsoleSystem : SharedIdCardConsoleSystem
         _idCard.TryChangeJobTitle(targetId, newJobTitle, player: player);
 
         if (_prototype.TryIndex<JobPrototype>(newJobProto, out var job)
-            && _prototype.TryIndex(job.Icon, out var jobIcon))
+            && _prototype.Resolve(job.Icon, out var jobIcon))
         {
             _idCard.TryChangeJobIcon(targetId, jobIcon, player: player);
             _idCard.TryChangeJobDepartment(targetId, job);
index 426e523243c3208b03bcfb571ca07f2af519b734..6d9f61d941189cbfd8bc1a11749d27c1d314ae27 100644 (file)
@@ -82,7 +82,7 @@ public sealed class PresetIdCardSystem : EntitySystem
         _cardSystem.TryChangeJobTitle(uid, job.LocalizedName);
         _cardSystem.TryChangeJobDepartment(uid, job);
 
-        if (_prototypeManager.TryIndex(job.Icon, out var jobIcon))
+        if (_prototypeManager.Resolve(job.Icon, out var jobIcon))
             _cardSystem.TryChangeJobIcon(uid, jobIcon);
     }
 }
index 787886f164a36a61f078f993474621072f067c39..6f9e89243d7c920e0b789057399ef8f19ad89257 100644 (file)
@@ -118,7 +118,7 @@ public sealed class ExplosionCommand : LocalizedEntityCommands
                 return;
             }
         }
-        else if (!_prototypeManager.TryIndex(ExplosionSystem.DefaultExplosionPrototypeId, out type))
+        else if (!_prototypeManager.Resolve(ExplosionSystem.DefaultExplosionPrototypeId, out type))
         {
             // no prototype was specified, so lets default to whichever one was defined first
             type = _prototypeManager.EnumeratePrototypes<ExplosionPrototype>().FirstOrDefault();
index 3fca640d4af77b5b9832f7e1431f5b7de74d59b1..94b20c7b77edf74e9b101f688b9a49b2ca539742 100644 (file)
@@ -38,7 +38,7 @@ public sealed partial class SpeakOnUIClosedSystem : SharedSpeakOnUIClosedSystem
         if (!entity.Comp.Enabled)
             return false;
 
-        if (!_prototypeManager.TryIndex(entity.Comp.Pack, out var messagePack))
+        if (!_prototypeManager.Resolve(entity.Comp.Pack, out var messagePack))
             return false;
 
         var message = Loc.GetString(_random.Pick(messagePack.Values), ("name", Name(entity)));
index bed249929865c185dfe8708bab99d08bb2c9af2e..d6039fac0158bae822609e7846a93d53ca5d8d96 100644 (file)
@@ -86,7 +86,7 @@ public sealed class InnerBodyAnomalySystem : SharedInnerBodyAnomalySystem
 
     private void AddAnomalyToBody(Entity<InnerBodyAnomalyComponent> ent)
     {
-        if (!_proto.TryIndex(ent.Comp.InjectionProto, out var injectedAnom))
+        if (!_proto.Resolve(ent.Comp.InjectionProto, out var injectedAnom))
             return;
 
         if (ent.Comp.Injected)
@@ -210,7 +210,7 @@ public sealed class InnerBodyAnomalySystem : SharedInnerBodyAnomalySystem
         if (!ent.Comp.Injected)
             return;
 
-        if (_proto.TryIndex(ent.Comp.InjectionProto, out var injectedAnom))
+        if (_proto.Resolve(ent.Comp.InjectionProto, out var injectedAnom))
             EntityManager.RemoveComponents(ent, injectedAnom.Components);
 
         _stun.TryUpdateParalyzeDuration(ent, TimeSpan.FromSeconds(ent.Comp.StunDuration));
index 3535f6b238258bcdb7c237a28e870878ef1b70a9..81d71894b8620f40aa0bf47fe091e052522acae1 100644 (file)
@@ -51,7 +51,7 @@ public sealed class JukeboxSystem : SharedJukeboxSystem
             component.AudioStream = Audio.Stop(component.AudioStream);
 
             if (string.IsNullOrEmpty(component.SelectedSongId) ||
-                !_protoManager.TryIndex(component.SelectedSongId, out var jukeboxProto))
+                !_protoManager.Resolve(component.SelectedSongId, out var jukeboxProto))
             {
                 return;
             }
index 934517eadc8d151137d48aebf8c42a617b9a6994..c2c2a8365cf316a0f55799f676ca1a241a830941 100644 (file)
@@ -113,7 +113,7 @@ public sealed partial class CargoSystem
 
     public void SetupBountyLabel(EntityUid uid, EntityUid stationId, CargoBountyData bounty, PaperComponent? paper = null, CargoBountyLabelComponent? label = null)
     {
-        if (!Resolve(uid, ref paper, ref label) || !_protoMan.TryIndex<CargoBountyPrototype>(bounty.Bounty, out var prototype))
+        if (!Resolve(uid, ref paper, ref label) || !_protoMan.Resolve<CargoBountyPrototype>(bounty.Bounty, out var prototype))
             return;
 
         label.Id = bounty.Id;
@@ -156,7 +156,7 @@ public sealed partial class CargoSystem
         if (!TryGetBountyFromId(station, component.Id, out var bounty, database))
             return;
 
-        if (!_protoMan.TryIndex(bounty.Value.Bounty, out var bountyPrototype) ||
+        if (!_protoMan.Resolve(bounty.Value.Bounty, out var bountyPrototype) ||
             !IsBountyComplete(container.Owner, bountyPrototype))
             return;
 
@@ -275,7 +275,7 @@ public sealed partial class CargoSystem
 
     public bool IsBountyComplete(EntityUid container, CargoBountyData data, out HashSet<EntityUid> bountyEntities)
     {
-        if (!_protoMan.TryIndex(data.Bounty, out var proto))
+        if (!_protoMan.Resolve(data.Bounty, out var proto))
         {
             bountyEntities = new();
             return false;
index febe093d98a78356d3f4d69310a855f2e1aa6b8b..0b5f0155937610820808a4851bf1e63f578fefb9 100644 (file)
@@ -167,7 +167,7 @@ namespace Content.Server.Cargo.Systems
 
             // Find our order again. It might have been dispatched or approved already
             var order = orderDatabase.Orders[component.Account].Find(order => args.OrderId == order.OrderId && !order.Approved);
-            if (order == null || !_protoMan.TryIndex(order.Account, out var account))
+            if (order == null || !_protoMan.Resolve(order.Account, out var account))
             {
                 return;
             }
@@ -322,7 +322,7 @@ namespace Content.Server.Cargo.Systems
 
         private void OnAddOrderMessageSlipPrinter(EntityUid uid, CargoOrderConsoleComponent component, CargoConsoleAddOrderMessage args, CargoProductPrototype product)
         {
-            if (!_protoMan.TryIndex(component.Account, out var account))
+            if (!_protoMan.Resolve(component.Account, out var account))
                 return;
 
             if (Timing.CurTime < component.NextPrintTime)
index 2dc001a9c99ffe13c40923a7f13d77ef4460ea84..b073cc0e697bb2655ee6977ef859aab2b87e12ff 100644 (file)
@@ -433,7 +433,7 @@ public sealed partial class ChatSystem : SharedChatSystem
             RaiseLocalEvent(source, nameEv);
             name = nameEv.VoiceName;
             // Check for a speech verb override
-            if (nameEv.SpeechVerb != null && _prototypeManager.TryIndex(nameEv.SpeechVerb, out var proto))
+            if (nameEv.SpeechVerb != null && _prototypeManager.Resolve(nameEv.SpeechVerb, out var proto))
                 speech = proto;
         }
 
index 48d547d1e0c4d91af94b1d70f7eb107e72b1a727..d5b220c3e8306fb5970d286dd5ae673fef7c30a1 100644 (file)
@@ -66,7 +66,7 @@ public sealed class TransformableContainerSystem : EntitySystem
 
     private void OnRefreshNameModifiers(Entity<TransformableContainerComponent> entity, ref RefreshNameModifiersEvent args)
     {
-        if (_prototypeManager.TryIndex(entity.Comp.CurrentReagent, out var currentReagent))
+        if (_prototypeManager.Resolve(entity.Comp.CurrentReagent, out var currentReagent))
         {
             args.AddModifier("transformable-container-component-glass", priority: -1, ("reagent", currentReagent.LocalizedName));
         }
index b0d62be5239cac8af6ae6965a5e2cee271236232..6e0f38ad51e9e16558368afc29dcf48d4962b539 100644 (file)
@@ -43,13 +43,13 @@ public sealed partial class CloningSystem : SharedCloningSystem
     public bool TryCloning(EntityUid original, MapCoordinates? coords, ProtoId<CloningSettingsPrototype> settingsId, [NotNullWhen(true)] out EntityUid? clone)
     {
         clone = null;
-        if (!_prototype.TryIndex(settingsId, out var settings))
+        if (!_prototype.Resolve(settingsId, out var settings))
             return false; // invalid settings
 
         if (!TryComp<HumanoidAppearanceComponent>(original, out var humanoid))
             return false; // whatever body was to be cloned, was not a humanoid
 
-        if (!_prototype.TryIndex(humanoid.Species, out var speciesPrototype))
+        if (!_prototype.Resolve(humanoid.Species, out var speciesPrototype))
             return false; // invalid species
 
         var attemptEv = new CloningAttemptEvent(settings);
index 157e4211586a739e6db71e8b33e03a84cc109416..42c64db99143548696ccb57409ea0071fe255fd7 100644 (file)
@@ -145,7 +145,7 @@ namespace Content.Server.Construction
                 return guide;
 
             // If the graph doesn't actually exist, do nothing.
-            if (!PrototypeManager.TryIndex(construction.Graph, out ConstructionGraphPrototype? graph))
+            if (!PrototypeManager.Resolve(construction.Graph, out ConstructionGraphPrototype? graph))
                 return null;
 
             // If either the start node or the target node are missing, do nothing.
index 8dfe665541c9e921d6cb7126e3bb42949728cd80..a46d42f3e3734cbaef275c26945f8dfaa683625d 100644 (file)
@@ -61,7 +61,7 @@ public sealed class DamageForceSaySystem : EntitySystem
         var ev = new BeforeForceSayEvent(component.ForceSayStringDataset);
         RaiseLocalEvent(uid, ev);
 
-        if (!_prototype.TryIndex(ev.Prefix, out var prefixList))
+        if (!_prototype.Resolve(ev.Prefix, out var prefixList))
             return;
 
         var suffix = Loc.GetString(_random.Pick(prefixList.Values));
index 155cf08962d4fb7378566f8a4936b2fa500366dd..b0dfae71b7fc69e2b0067e3f26dfadd1340ef431 100644 (file)
@@ -20,7 +20,7 @@ public sealed class ExaminableDamageSystem : EntitySystem
 
     private void OnExamine(Entity<ExaminableDamageComponent> ent, ref ExaminedEvent args)
     {
-        if (!_prototype.TryIndex(ent.Comp.Messages, out var proto) || proto.Values.Count == 0)
+        if (!_prototype.Resolve(ent.Comp.Messages, out var proto) || proto.Values.Count == 0)
             return;
 
         var percent = GetDamagePercent(ent);
index 5fc9b53316a62890a6f30718bf918b8713c27b69..72d9427dffcf10f17e473d410ae85862542cc820 100644 (file)
@@ -102,7 +102,7 @@ public sealed partial class DeliverySystem : SharedDeliverySystem
         if (ent.Comp.WasPenalized)
             return;
 
-        if (!_protoMan.TryIndex(ent.Comp.PenaltyBankAccount, out var accountInfo))
+        if (!_protoMan.Resolve(ent.Comp.PenaltyBankAccount, out var accountInfo))
             return;
 
         var multiplier = GetDeliveryMultiplier(ent);
index 96fa4dd438ba152b62059666254a6ed58b1cf3e6..4a275ac8958de74510e6a1c3aa8805b6ead276f6 100644 (file)
@@ -66,7 +66,7 @@ public sealed partial class WeightedSpawnEntityBehavior : IThresholdBehavior
         if (SpawnAfter != 0)
         {
             // if it fails to get the spawner, this won't ever work so just return
-            if (!system.PrototypeManager.TryIndex(TempEntityProtoId, out var tempSpawnerProto))
+            if (!system.PrototypeManager.Resolve(TempEntityProtoId, out var tempSpawnerProto))
                 return;
 
             // spawn the spawner, assign it a lifetime, and assign the entity that it will spawn when despawned
index f423a432612ca37f1472616678155fc183b00525..4e447c7fab0444571890c82fea584b877cbc0580 100644 (file)
@@ -949,9 +949,7 @@ public sealed class EntityEffectSystem : EntitySystem
             return;
 
         var targetProto = _random.Pick(plantholder.Seed.MutationPrototypes);
-        _protoManager.TryIndex(targetProto, out SeedPrototype? protoSeed);
-
-        if (protoSeed == null)
+        if (!_protoManager.TryIndex(targetProto, out SeedPrototype? protoSeed))
         {
             Log.Error($"Seed prototype could not be found: {targetProto}!");
             return;
index 3527e2a11c2bc60c8e9565e77bf8a66d03e6bca7..84f87a487bdeab5c55b65a22ee77a5528a922a8f 100644 (file)
@@ -32,7 +32,7 @@ public sealed class AntagLoadProfileRuleSystem : GameRuleSystem<AntagLoadProfile
             : HumanoidCharacterProfile.RandomWithSpecies();
 
 
-        if (profile?.Species is not { } speciesId || !_proto.TryIndex(speciesId, out var species))
+        if (profile?.Species is not { } speciesId || !_proto.Resolve(speciesId, out var species))
         {
             species = _proto.Index<SpeciesPrototype>(SharedHumanoidAppearanceSystem.DefaultSpecies);
         }
index 2895416a7f0d483fe9024d0fbba32cd6d2e3700c..c81001daaca56e06d3023bf1d25d6deb206dbea0 100644 (file)
@@ -17,7 +17,7 @@ public sealed class PuddleMessVariationPassSystem : VariationPassSystem<PuddleMe
     {
         var totalTiles = Stations.GetTileCount(args.Station.AsNullable());
 
-        if (!_proto.TryIndex(ent.Comp.RandomPuddleSolutionFill, out var proto))
+        if (!_proto.Resolve(ent.Comp.RandomPuddleSolutionFill, out var proto))
             return;
 
         var puddleMod = Random.NextGaussian(ent.Comp.TilesPerSpillAverage, ent.Comp.TilesPerSpillStdDev);
index 98261c0908b6524896265e063d3078ee37ba4660..182d8e968ef614a95d16f73cac9a693bf72bbfa8 100644 (file)
@@ -808,7 +808,7 @@ public sealed class GhostRoleSystem : EntitySystem
 
     public void OnGhostRoleRadioMessage(Entity<GhostRoleMobSpawnerComponent> entity, ref GhostRoleRadioMessage args)
     {
-        if (!_prototype.TryIndex(args.ProtoId, out var ghostRoleProto))
+        if (!_prototype.Resolve(args.ProtoId, out var ghostRoleProto))
             return;
 
         // if the prototype chosen isn't actually part of the selectable options, ignore it
index 5a83ca39b1da8aea5165357109ddedbd0a67a01f..ce3a2705a0dfafbabda10251f98b86fc0fcca511 100644 (file)
@@ -32,7 +32,7 @@ public sealed class SpookySpeakerSystem : EntitySystem
         if (curTime < entity.Comp.NextSpeakTime)
             return;
 
-        if (!_proto.TryIndex(entity.Comp.MessageSet, out var messages))
+        if (!_proto.Resolve(entity.Comp.MessageSet, out var messages))
             return;
 
         // Grab a random localized message from the set
index 930f2e3156f81acbf8b995ba5e2a64a9d1d4f872..e884e181eeb3721d7b887155bc8db0162571f2aa 100644 (file)
@@ -49,8 +49,8 @@ public sealed class ChameleonControllerSystem : SharedChameleonControllerSystem
     {
         var outfitPrototype = _proto.Index(outfit);
 
-        _proto.TryIndex(outfitPrototype.Job, out var jobPrototype);
-        _proto.TryIndex(outfitPrototype.StartingGear, out var startingGearPrototype);
+        _proto.Resolve(outfitPrototype.Job, out var jobPrototype);
+        _proto.Resolve(outfitPrototype.StartingGear, out var startingGearPrototype);
 
         GetJobEquipmentInformation(jobPrototype, user, out var customRoleLoadout, out var defaultRoleLoadout, out var jobStartingGearPrototype);
 
@@ -81,7 +81,7 @@ public sealed class ChameleonControllerSystem : SharedChameleonControllerSystem
         if (jobPrototype == null)
             return;
 
-        _proto.TryIndex(jobPrototype.StartingGear, out jobStartingGearPrototype);
+        _proto.Resolve(jobPrototype.StartingGear, out jobStartingGearPrototype);
 
         if (!TryComp<ActorComponent>(user, out var actorComponent))
             return;
index f5c8c4d0d8912e33bb9f9968a7e71f998dea965d..c2d2614a0ac81305b24e468a553f7a433f26212f 100644 (file)
@@ -725,7 +725,7 @@ namespace Content.Server.Kitchen.EntitySystems
         {
             foreach (ProtoId<FoodRecipePrototype> recipeId in ent.Comp.ProvidedRecipes)
             {
-                if (_prototype.TryIndex(recipeId, out var recipeProto))
+                if (_prototype.Resolve(recipeId, out var recipeProto))
                 {
                     args.Recipes.Add(recipeProto);
                 }
index 02abb0779121a50cf2c76d13645cf3008c2ad695..97602ad2ba17ed408cda24027904c1ef3e2314ed 100644 (file)
@@ -137,7 +137,7 @@ namespace Content.Server.Lathe
             var recipes = GetAvailableRecipes(uid, component, true);
             foreach (var id in recipes)
             {
-                if (!_proto.TryIndex(id, out var proto))
+                if (!_proto.Resolve(id, out var proto))
                     continue;
                 foreach (var (mat, _) in proto.Materials)
                 {
index c0b9beaa9aaa4253ea75b846fa3dd097963c8f80..27e25a4b4f3c60acafeecec8b6fbbcb65352425d 100644 (file)
@@ -92,7 +92,7 @@ public sealed class NameIdentifierSystem : EntitySystem
         if (ent.Comp.Group is null)
             return;
 
-        if (!_prototypeManager.TryIndex(ent.Comp.Group, out var group))
+        if (!_prototypeManager.Resolve(ent.Comp.Group, out var group))
             return;
 
         int id;
@@ -131,7 +131,7 @@ public sealed class NameIdentifierSystem : EntitySystem
         if (ent.Comp.LifeStage > ComponentLifeStage.Running)
             return;
 
-        if (!_prototypeManager.TryIndex(ent.Comp.Group, out var group))
+        if (!_prototypeManager.Resolve(ent.Comp.Group, out var group))
             return;
 
         var format = group.FullName ? "name-identifier-format-full" : "name-identifier-format-append";
index 496cb387e82b30b9974c1dc46f4bfb4524850d76..6974bc1fda3f0fd84b8388ca51a3021adc2e35c0 100644 (file)
@@ -127,7 +127,7 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
             SetSeed(uid, component, _random.Next());
         }
 
-        if (_proto.TryIndex(component.Template, out var biome))
+        if (_proto.Resolve(component.Template, out var biome))
             SetTemplate(uid, component, biome);
 
         var xform = Transform(uid);
index 04289a40980d927752668cc5188a048a2c759068..72f18e00cbe8b1eb7f7d0fd7082dedb5535e4526 100644 (file)
@@ -63,7 +63,7 @@ public sealed class JobWhitelistManager : IPostInjectInit
         if (!_config.GetCVar(CCVars.GameRoleWhitelist))
             return true;
 
-        if (!_prototypes.TryIndex(job, out var jobPrototype) ||
+        if (!_prototypes.Resolve(job, out var jobPrototype) ||
             !jobPrototype.Whitelisted)
         {
             return true;
index e75801d6de05ffce1b6d677ff922529c39a3026e..d55920f83c87def6e918e91ffdb9017d3fc5d219 100644 (file)
@@ -238,7 +238,7 @@ public sealed class PlayTimeTrackingSystem : EntitySystem
 
         for (var i = 0; i < jobs.Count; i++)
         {
-            if (_prototypes.TryIndex(jobs[i], out var job)
+            if (_prototypes.Resolve(jobs[i], out var job)
                 && JobRequirements.TryRequirementsMet(job, playTimes, out _, EntityManager, _prototypes, (HumanoidCharacterProfile?) _preferencesManager.GetPreferences(userId).SelectedCharacter))
             {
                 continue;
index b9453d2924b518c253e238e2a95636d6c8976c90..9547bc1ea52c7901d2bd07f04b5ac2590ac11e7e 100644 (file)
@@ -112,7 +112,7 @@ public sealed partial class PolymorphSystem : EntitySystem
 
     private void OnPolymorphActionEvent(Entity<PolymorphableComponent> ent, ref PolymorphActionEvent args)
     {
-        if (!_proto.TryIndex(args.ProtoId, out var prototype) || args.Handled)
+        if (!_proto.Resolve(args.ProtoId, out var prototype) || args.Handled)
             return;
 
         PolymorphEntity(ent, prototype.Configuration);
@@ -389,7 +389,7 @@ public sealed partial class PolymorphSystem : EntitySystem
         if (target.Comp.PolymorphActions.ContainsKey(id))
             return;
 
-        if (!_proto.TryIndex(id, out var polyProto))
+        if (!_proto.Resolve(id, out var polyProto))
             return;
 
         var entProto = _proto.Index(polyProto.Configuration.Entity);
index db1e1faad6b0e981d0f9b4585bc11a1a57668801..23caff1e5d0e7d12e4c367fd0321705401a8c44a 100644 (file)
@@ -25,8 +25,7 @@ public sealed class PolymorphCommand : ToolshedCommand
     {
         _system ??= GetSys<PolymorphSystem>();
 
-        if (!_proto.TryIndex(protoId, out var prototype))
-            return null;
+        var prototype = _proto.Index(protoId);
 
         return _system.PolymorphEntity(input, prototype.Configuration);
     }
index 48adb8af188a874b1bf0562e75a36f7a5fd164bb..10f11bb85419a6ae5ad2ae5b51b86eed4f86ab7a 100644 (file)
@@ -16,7 +16,7 @@ public sealed partial class DungeonJob
     /// </summary>
     private async Task PostGen(BiomeDunGen dunGen, Dungeon dungeon, HashSet<Vector2i> reservedTiles, Random random)
     {
-        if (!_prototype.TryIndex(dunGen.BiomeTemplate, out var indexedBiome))
+        if (!_prototype.Resolve(dunGen.BiomeTemplate, out var indexedBiome))
             return;
 
         var biomeSystem = _entManager.System<BiomeSystem>();
index d6e3c09d6222c44685b7f0646abeb8109af2e5a6..451bb8baee561b8b32ee7333b61fced9aef0e561 100644 (file)
@@ -57,7 +57,7 @@ public sealed partial class DungeonJob
 
         var roomConnections = new Dictionary<DungeonRoom, List<DungeonRoom>>();
         var tileDef = _tileDefManager[gen.Tile];
-        _prototype.TryIndex(gen.Flank, out var flankContents);
+        _prototype.Resolve(gen.Flank, out var flankContents);
         var contents = _prototype.Index(gen.Contents);
 
         foreach (var (room, border) in roomBorders)
index 78ab2b7a0d28ac54abf581b3db35dcf5eae36b20..92531912725e6a68c7a1f78a76f555361411239b 100644 (file)
@@ -72,7 +72,7 @@ public sealed partial class DungeonJob
             var remapping = new Dictionary<EntProtoId, EntProtoId>();
 
             // TODO: Move this to engine
-            if (_prototype.TryIndex(gen.Entity, out var proto) &&
+            if (_prototype.Resolve(gen.Entity, out var proto) &&
                 proto.Components.TryGetComponent("EntityRemap", out var comps))
             {
                 var remappingComp = (EntityRemapComponent) comps;
index 5222c31bfe6be114f9651b9211753fa4d4612498..a32fa810c9787f4f8029d0b9cc0468dbb67846e9 100644 (file)
@@ -17,7 +17,7 @@ public sealed class RadiationProtectionSystem : EntitySystem
 
     private void OnInit(EntityUid uid, RadiationProtectionComponent component, ComponentInit args)
     {
-        if (!_prototypeManager.TryIndex(component.RadiationProtectionModifierSetId, out var modifier))
+        if (!_prototypeManager.Resolve(component.RadiationProtectionModifierSetId, out var modifier))
             return;
         var buffComp = EnsureComp<DamageProtectionBuffComponent>(uid);
         // add the damage modifier if it isn't in the dict yet
index bdc368fa93299b778525f7556ead8b8d7131b0cd..6af52b980fccffaddfac3112552514c09e8a33cd 100644 (file)
@@ -84,7 +84,7 @@ public sealed class RadioSystem : EntitySystem
         name = FormattedMessage.EscapeText(name);
 
         SpeechVerbPrototype speech;
-        if (evt.SpeechVerb != null && _prototype.TryIndex(evt.SpeechVerb, out var evntProto))
+        if (evt.SpeechVerb != null && _prototype.Resolve(evt.SpeechVerb, out var evntProto))
             speech = evntProto;
         else
             speech = _chat.GetSpeechVerb(messageSource, message);
index 346e13bd07b0c05bd0e10f34b2d41a5f4c2f7fad..71fb8a9cb576fef7052e89d5fdd39676cc8a2aa1 100644 (file)
@@ -49,7 +49,7 @@ public sealed class RoleSystem : SharedRoleSystem
         if (!Player.TryGetSessionById(mind.UserId, out var session))
             return;
 
-        if (!_proto.TryIndex(mind.RoleType, out var proto))
+        if (!_proto.Resolve(mind.RoleType, out var proto))
             return;
 
         var roleText = Loc.GetString(proto.Name);
index 2e6ebe396c55fba6c66ac9d2428ea5cd9eed806f..ca704d8e506bfdd49f049b8194d43cb721fe1240 100644 (file)
@@ -89,7 +89,7 @@ public sealed partial class ShuttleSystem
 
         var dungeonProtoId = _random.Pick(group.Protos);
 
-        if (!_protoManager.TryIndex(dungeonProtoId, out var dungeonProto))
+        if (!_protoManager.Resolve(dungeonProtoId, out var dungeonProto))
         {
             return false;
         }
@@ -192,7 +192,7 @@ public sealed partial class ShuttleSystem
                         throw new NotImplementedException();
                 }
 
-                if (_protoManager.TryIndex(group.NameDataset, out var dataset))
+                if (_protoManager.Resolve(group.NameDataset, out var dataset))
                 {
                     _metadata.SetEntityName(spawned, _salvage.GetFTLName(dataset, _random.Next()));
                 }
index d1a32a6a5ba02475c551e180ebcdff5bf72c2c31..e90acf1b80db6b1dbb9490c73c6e8092e896c237 100644 (file)
@@ -60,7 +60,7 @@ public sealed class BorgSwitchableTypeSystem : SharedBorgSwitchableTypeSystem
         }
 
         // Configure special components
-        if (Prototypes.TryIndex(ent.Comp.SelectedBorgType, out var previousPrototype))
+        if (Prototypes.Resolve(ent.Comp.SelectedBorgType, out var previousPrototype))
         {
             if (previousPrototype.AddComponents is { } removeComponents)
                 EntityManager.RemoveComponents(ent, removeComponents);
index db82dc70a2930067636a79b62676d7ac2e6da46a..1a592b99294178d6b8b4c67f5b4aadcb2de67ea8 100644 (file)
@@ -32,7 +32,7 @@ public sealed class ContainerSpawnPointSystem : EntitySystem
 
         // If it's just a spawn pref check if it's for cryo (silly).
         if (args.HumanoidCharacterProfile?.SpawnPriority != SpawnPriorityPreference.Cryosleep &&
-            (!_proto.TryIndex(args.Job, out var jobProto) || jobProto.JobEntity == null))
+            (!_proto.Resolve(args.Job, out var jobProto) || jobProto.JobEntity == null))
         {
             return;
         }
index a69b5a65e430f7fceb2d9fb222ecb018983fcfc0..5f91742eb128e69677c70e0a58f80a2a319bccde 100644 (file)
@@ -22,7 +22,7 @@ public sealed partial class EmotesMenuSystem : EntitySystem
         if (!player.HasValue)
             return;
 
-        if (!_prototypeManager.TryIndex(msg.ProtoId, out var proto) || proto.ChatTriggers.Count == 0)
+        if (!_prototypeManager.Resolve(msg.ProtoId, out var proto) || proto.ChatTriggers.Count == 0)
             return;
 
         _chat.TryEmoteWithChat(player.Value, msg.ProtoId);
index 328f4f0504c76ed3626718234cb34d12a8a3c84d..2bc067542d4ee3cc6495a5ee1d4815bfbc21b36d 100644 (file)
@@ -181,7 +181,7 @@ public sealed class SpreaderSystem : EntitySystem
         occupiedTiles = [];
         neighbors = [];
         // TODO remove occupiedTiles -- its currently unused and just slows this method down.
-        if (!_prototype.TryIndex(prototype, out var spreaderPrototype))
+        if (!_prototype.Resolve(prototype, out var spreaderPrototype))
             return;
 
         if (!TryComp<MapGridComponent>(comp.GridUid, out var grid))
index c6c682bcf3d936efc6a3f48ea41f597589540e0b..3510aca85ecbd016c7c2e28539881785b174a246 100644 (file)
@@ -362,7 +362,7 @@ public sealed partial class StationJobsSystem
                 if (!(priority == selectedPriority || selectedPriority is null))
                     continue;
 
-                if (!_prototypeManager.TryIndex(jobId, out var job))
+                if (!_prototypeManager.Resolve(jobId, out var job))
                     continue;
 
                 if (!job.CanBeAntag && (!_player.TryGetSessionById(player, out var session) || antagBlocked.Contains(session)))
index 46d2e308d06c40926dbb8010f3ee3247b86c590b..3967e320a8e22bab9a91ee8917af024e306be0de 100644 (file)
@@ -88,7 +88,7 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
         EntityUid? station,
         EntityUid? entity = null)
     {
-        _prototypeManager.TryIndex(job ?? string.Empty, out var prototype);
+        _prototypeManager.Resolve(job, out var prototype);
         RoleLoadout? loadout = null;
 
         // Need to get the loadout up-front to handle names if we use an entity spawn override.
@@ -168,7 +168,7 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
 
     private void DoJobSpecials(ProtoId<JobPrototype>? job, EntityUid entity)
     {
-        if (!_prototypeManager.TryIndex(job ?? string.Empty, out JobPrototype? prototype))
+        if (!_prototypeManager.Resolve(job, out JobPrototype? prototype))
             return;
 
         foreach (var jobSpecial in prototype.Special)
@@ -199,7 +199,7 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
         _cardSystem.TryChangeFullName(cardId, characterName, card);
         _cardSystem.TryChangeJobTitle(cardId, jobPrototype.LocalizedName, card);
 
-        if (_prototypeManager.TryIndex(jobPrototype.Icon, out var jobIcon))
+        if (_prototypeManager.Resolve(jobPrototype.Icon, out var jobIcon))
             _cardSystem.TryChangeJobIcon(cardId, jobIcon, card);
 
         var extendedAccess = false;
index 6585fe32483a4f0749bbbed01f3e40b6bd638cfd..b86d30e2e7bbd71bd7d82df5b3cb292e213ff251 100644 (file)
@@ -71,7 +71,7 @@ public sealed class EventManagerSystem : EntitySystem
             return;
         }
 
-        if (!_prototype.TryIndex(randomLimitedEvent, out _))
+        if (!_prototype.Resolve(randomLimitedEvent, out _))
         {
             Log.Warning("A requested event is not available!");
             return;
@@ -104,7 +104,7 @@ public sealed class EventManagerSystem : EntitySystem
 
         foreach (var eventid in selectedEvents)
         {
-            if (!_prototype.TryIndex(eventid, out var eventproto))
+            if (!_prototype.Resolve(eventid, out var eventproto))
             {
                 Log.Warning("An event ID has no prototype index!");
                 continue;
index 8d33b858de49a20e93e3c54277ac29c93831adc2..dba21911dc7935c7fa65ff4ca0d532e1d2ffc227 100644 (file)
@@ -54,7 +54,7 @@ public sealed class GreytideVirusRule : StationEventSystem<GreytideVirusRuleComp
         var accessIds = new HashSet<ProtoId<AccessLevelPrototype>>();
         foreach (var group in chosen)
         {
-            if (_prototype.TryIndex(group, out var proto))
+            if (_prototype.Resolve(group, out var proto))
                 accessIds.UnionWith(proto.Tags);
         }
 
index 32e42a52dd44af21f2e0da8c03a21fb12ce7198b..d4af86cd7102f97a148528926a3dce60e98cd701 100644 (file)
@@ -121,7 +121,7 @@ public sealed class SurveillanceCameraRouterSystem : EntitySystem
             return;
         }
 
-        if (!_prototypeManager.TryIndex<DeviceFrequencyPrototype>(component.AvailableNetworks[args.Network],
+        if (!_prototypeManager.Resolve<DeviceFrequencyPrototype>(component.AvailableNetworks[args.Network],
                 out var frequency))
         {
             return;
index 2a288d90175dbba9912e6ab024191eb779188562..7f7dbc6c97c689e21f6557a7f8b51820ea8c0c04 100644 (file)
@@ -190,7 +190,7 @@ public sealed class SurveillanceCameraSystem : EntitySystem
             return;
         }
 
-        if (!_prototypeManager.TryIndex<DeviceFrequencyPrototype>(component.AvailableNetworks[args.Network],
+        if (!_prototypeManager.Resolve<DeviceFrequencyPrototype>(component.AvailableNetworks[args.Network],
                 out var frequency))
         {
             return;
index 46f45d1286988a663fa097abbb9d9412eb837a3d..0e3090c77eb26ff6ee7e2cbb0dc1f6096cbaf722 100644 (file)
@@ -340,7 +340,7 @@ public sealed class TelephoneSystem : SharedTelephoneSystem
         name = FormattedMessage.EscapeText(name);
 
         SpeechVerbPrototype speech;
-        if (ev.SpeechVerb != null && _prototype.TryIndex(ev.SpeechVerb, out var evntProto))
+        if (ev.SpeechVerb != null && _prototype.Resolve(ev.SpeechVerb, out var evntProto))
             speech = evntProto;
         else
             speech = _chat.GetSpeechVerb(messageSource, message);
index f4a9ca75fda07f55a618a8df6dad2f80df225274..e4aa7b5ec170f888a9292c5f46484ea6290e2eab 100644 (file)
@@ -88,7 +88,7 @@ public sealed class UplinkSystem : EntitySystem
     /// </summary>
     private bool ImplantUplink(EntityUid user, FixedPoint2 balance, bool giveDiscounts)
     {
-        if (!_proto.TryIndex<ListingPrototype>(FallbackUplinkCatalog, out var catalog))
+        if (!_proto.Resolve<ListingPrototype>(FallbackUplinkCatalog, out var catalog))
             return false;
 
         if (!catalog.Cost.TryGetValue(TelecrystalCurrencyPrototype, out var cost))
index 59cb9537f2e48044a160c8d0170c43c31cb32aa2..d6035f887b15c356aec0b0653d6fc8b7bb26520b 100644 (file)
@@ -26,7 +26,7 @@ public sealed class TraitSystem : EntitySystem
     {
         // Check if player's job allows to apply traits
         if (args.JobId == null ||
-            !_prototypeManager.TryIndex<JobPrototype>(args.JobId ?? string.Empty, out var protoJob) ||
+            !_prototypeManager.Resolve<JobPrototype>(args.JobId, out var protoJob) ||
             !protoJob.ApplyTraits)
         {
             return;
@@ -36,7 +36,7 @@ public sealed class TraitSystem : EntitySystem
         {
             if (!_prototypeManager.TryIndex<TraitPrototype>(traitId, out var traitPrototype))
             {
-                Log.Warning($"No trait found with ID {traitId}!");
+                Log.Error($"No trait found with ID {traitId}!");
                 return;
             }
 
index 6da6f707c120071850424ca0ed53a57cca847143..1e08587ce796bb9eb851152e0b2183283d0f47a1 100644 (file)
@@ -34,7 +34,7 @@ public sealed class SpeakOnTriggerSystem : EntitySystem
             message = Loc.GetString(ent.Comp.Text);
         else
         {
-            if (!_prototypeManager.TryIndex(ent.Comp.Pack, out var messagePack))
+            if (!_prototypeManager.Resolve(ent.Comp.Pack, out var messagePack))
                 return;
             message = Loc.GetString(_random.Pick(messagePack.Values));
         }
index fef52a5b5d2b1d07f048310a62905aac94ee8e36..c9fd429c4793a05fea1d8e8eb7e4e3913cb1fb1c 100644 (file)
@@ -73,7 +73,7 @@ public sealed class WiresSystem : SharedWiresSystem
         List<IWireAction> wireActions = new();
         var dummyWires = 0;
 
-        if (!_protoMan.TryIndex(wires.LayoutId, out WireLayoutPrototype? layoutPrototype))
+        if (!_protoMan.Resolve(wires.LayoutId, out WireLayoutPrototype? layoutPrototype))
         {
             return;
         }
index f4ff5dd60c68448caeca0b18fe6c043b0eb598c2..5107a87c2a06890254dcb0cc7d012e4207ca6148 100644 (file)
@@ -183,7 +183,7 @@ namespace Content.Server.Zombies
             if (args.Handled)
                 return;
 
-            _protoManager.TryIndex(component.EmoteSoundsId, out var sounds);
+            _protoManager.Resolve(component.EmoteSoundsId, out var sounds);
 
             args.Handled = _chat.TryPlayEmoteSound(uid, sounds, args.Emote);
         }
index 00ee87b3b67fa4c47cd2b7b4788eae4e78d5b988..dce9d4b76b8602e39d130e9e0f2e59c5fee311d4 100644 (file)
@@ -51,7 +51,7 @@ public record struct GetAccessTagsEvent(HashSet<ProtoId<AccessLevelPrototype>> T
 {
     public void AddGroup(ProtoId<AccessGroupPrototype> group)
     {
-        if (!PrototypeManager.TryIndex<AccessGroupPrototype>(group, out var groupPrototype))
+        if (!PrototypeManager.Resolve<AccessGroupPrototype>(group, out var groupPrototype))
             return;
 
         Tags.UnionWith(groupPrototype.Tags);
index 9ca82b67b4a527a03cfc44f99c261280fdbb8ea4..93c61ea9f0941619b835596dad79d3c3b23f4a03 100644 (file)
@@ -41,7 +41,7 @@ public sealed partial class IdCardComponent : Component
     /// </summary>
     [DataField]
     [AutoNetworkedField]
-    public ProtoId<AccessLevelPrototype>? JobPrototype;
+    public ProtoId<JobPrototype>? JobPrototype;
 
     /// <summary>
     /// The proto IDs of the departments associated with the job
index 8d54024f72a0bda4f72379ce9c0ef94e888db046..8c965971a8e51cb6455fc6a2f062e83850b9f2c6 100644 (file)
@@ -1,5 +1,6 @@
 using Content.Shared.Access.Systems;
 using Content.Shared.Containers.ItemSlots;
+using Content.Shared.Roles;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization;
@@ -25,9 +26,9 @@ public sealed partial class IdCardConsoleComponent : Component
         public readonly string FullName;
         public readonly string JobTitle;
         public readonly List<ProtoId<AccessLevelPrototype>> AccessList;
-        public readonly ProtoId<AccessLevelPrototype> JobPrototype;
+        public readonly ProtoId<JobPrototype> JobPrototype;
 
-        public WriteToTargetIdMessage(string fullName, string jobTitle, List<ProtoId<AccessLevelPrototype>> accessList, ProtoId<AccessLevelPrototype> jobPrototype)
+        public WriteToTargetIdMessage(string fullName, string jobTitle, List<ProtoId<AccessLevelPrototype>> accessList, ProtoId<JobPrototype> jobPrototype)
         {
             FullName = fullName;
             JobTitle = jobTitle;
@@ -85,7 +86,7 @@ public sealed partial class IdCardConsoleComponent : Component
         public readonly string? TargetIdJobTitle;
         public readonly List<ProtoId<AccessLevelPrototype>>? TargetIdAccessList;
         public readonly List<ProtoId<AccessLevelPrototype>>? AllowedModifyAccessList;
-        public readonly ProtoId<AccessLevelPrototype> TargetIdJobPrototype;
+        public readonly ProtoId<JobPrototype> TargetIdJobPrototype;
 
         public IdCardConsoleBoundUserInterfaceState(bool isPrivilegedIdPresent,
             bool isPrivilegedIdAuthorized,
@@ -94,7 +95,7 @@ public sealed partial class IdCardConsoleComponent : Component
             string? targetIdJobTitle,
             List<ProtoId<AccessLevelPrototype>>? targetIdAccessList,
             List<ProtoId<AccessLevelPrototype>>? allowedModifyAccessList,
-            ProtoId<AccessLevelPrototype> targetIdJobPrototype,
+            ProtoId<JobPrototype> targetIdJobPrototype,
             string privilegedIdName,
             string targetIdName)
         {
index a4b04c35597faf3c93fca193d987055329ef081d..e161d90e9140de047f2cf103b96b291bb4cf4613 100644 (file)
@@ -23,7 +23,7 @@ namespace Content.Shared.Access.Systems
             // Add all tags in groups to the list of tags.
             foreach (var group in component.Groups)
             {
-                if (!_prototypeManager.TryIndex<AccessGroupPrototype>(group, out var proto))
+                if (!_prototypeManager.Resolve<AccessGroupPrototype>(group, out var proto))
                     continue;
 
                 component.Tags.UnionWith(proto.Tags);
@@ -79,7 +79,7 @@ namespace Content.Shared.Access.Systems
 
             foreach (var group in newGroups)
             {
-                if (!_prototypeManager.TryIndex<AccessGroupPrototype>(group, out var proto))
+                if (!_prototypeManager.Resolve<AccessGroupPrototype>(group, out var proto))
                     continue;
 
                 access.Tags.UnionWith(proto.Tags);
index f6ec1c5799efd340cdb6efb4cd5bb227490b4bf1..708f8ecb3fa91034839935ab5bdf2d1d3e221702 100644 (file)
@@ -52,7 +52,7 @@ public abstract partial class SharedAtmosPipeLayersSystem : EntitySystem
         if (ent.Comp.NumberOfPipeLayers <= 1 || ent.Comp.PipeLayersLocked)
             return;
 
-        if (!_protoManager.TryIndex(ent.Comp.Tool, out var toolProto))
+        if (!_protoManager.Resolve(ent.Comp.Tool, out var toolProto))
             return;
 
         var user = args.User;
@@ -138,7 +138,7 @@ public abstract partial class SharedAtmosPipeLayersSystem : EntitySystem
 
         if (!TryGetHeldTool(args.User, ent.Comp.Tool, out var tool))
         {
-            if (_protoManager.TryIndex(ent.Comp.Tool, out var toolProto))
+            if (_protoManager.Resolve(ent.Comp.Tool, out var toolProto))
             {
                 var toolName = Loc.GetString(toolProto.ToolName).ToLower();
                 var message = Loc.GetString("atmos-pipe-layers-component-tool-missing", ("toolName", toolName));
index bf28cfe6b7ab348ad3e362e3a85221a8291d0649..0c9770bfe9830bcfc6a9c9383c7d3558321eec33 100644 (file)
@@ -31,7 +31,7 @@ public sealed class BarSignSystem : EntitySystem
 
     private void OnSetBarSignMessage(Entity<BarSignComponent> ent, ref SetBarSignMessage args)
     {
-        if (!_prototypeManager.TryIndex(args.Sign, out var signPrototype))
+        if (!_prototypeManager.Resolve(args.Sign, out var signPrototype))
             return;
 
         SetBarSign(ent, signPrototype);
index 4b3270f1ed8fbd33903ec1a121c557d11f5be929..3b46d3913c397674784b6b673a431f5e11b70b2d 100644 (file)
@@ -191,7 +191,7 @@ public abstract class SharedBloodstreamSystem : EntitySystem
         }
 
         // TODO probably cache this or something. humans get hurt a lot
-        if (!_prototypeManager.TryIndex(ent.Comp.DamageBleedModifiers, out var modifiers))
+        if (!_prototypeManager.Resolve(ent.Comp.DamageBleedModifiers, out var modifiers))
             return;
 
         // some reagents may deal and heal different damage types in the same tick, which means DamageIncreased will be true
index d98c9bd8f782c1128af1c49d6183e599c6bc4258..46a3a0de13724e91d4d6da2e48d69d59c51fb199 100644 (file)
@@ -36,7 +36,7 @@ namespace Content.Shared.Cargo.Prototypes
                 if (_name.Trim().Length != 0)
                     return _name;
 
-                if (IoCManager.Resolve<IPrototypeManager>().TryIndex(Product, out EntityPrototype? prototype))
+                if (IoCManager.Resolve<IPrototypeManager>().Resolve(Product, out EntityPrototype? prototype))
                 {
                     _name = prototype.Name;
                 }
@@ -56,7 +56,7 @@ namespace Content.Shared.Cargo.Prototypes
                 if (_description.Trim().Length != 0)
                     return _description;
 
-                if (IoCManager.Resolve<IPrototypeManager>().TryIndex(Product, out EntityPrototype? prototype))
+                if (IoCManager.Resolve<IPrototypeManager>().Resolve(Product, out EntityPrototype? prototype))
                 {
                     _description = prototype.Description;
                 }
index 4b38d926f6d82bc74a6c77c3f598ed1c376408a5..18b79bf52bbec587f8c448c374a8b96d06120fa9 100644 (file)
@@ -74,7 +74,7 @@ public abstract class SharedChameleonClothingSystem : EntitySystem
     protected void UpdateVisuals(EntityUid uid, ChameleonClothingComponent component)
     {
         if (string.IsNullOrEmpty(component.Default) ||
-            !_proto.TryIndex(component.Default, out EntityPrototype? proto))
+            !_proto.Resolve(component.Default, out EntityPrototype? proto))
             return;
 
         // world sprite icon
index 08b4f5f7630138c933ddbb85aa449ffc607d0c0e..dfe6d1377ba9eb69c87672af630f851cfb64fc7c 100644 (file)
@@ -44,7 +44,7 @@ public sealed class LoadoutSystem : EntitySystem
     {
         EntProtoId? proto = null;
 
-        if (_protoMan.TryIndex(loadout.StartingGear, out var gear))
+        if (_protoMan.Resolve(loadout.StartingGear, out var gear))
         {
             proto = GetFirstOrNull(gear);
         }
@@ -65,12 +65,12 @@ public sealed class LoadoutSystem : EntitySystem
 
         if (count == 1)
         {
-            if (gear.Equipment.Count == 1 && _protoMan.TryIndex<EntityPrototype>(gear.Equipment.Values.First(), out var proto))
+            if (gear.Equipment.Count == 1 && _protoMan.Resolve(gear.Equipment.Values.First(), out var proto))
             {
                 return proto.ID;
             }
 
-            if (gear.Inhand.Count == 1 && _protoMan.TryIndex<EntityPrototype>(gear.Inhand[0], out proto))
+            if (gear.Inhand.Count == 1 && _protoMan.Resolve(gear.Inhand[0], out proto))
             {
                 return proto.ID;
             }
@@ -90,10 +90,10 @@ public sealed class LoadoutSystem : EntitySystem
 
     public string GetName(LoadoutPrototype loadout)
     {
-        if (loadout.DummyEntity is not null && _protoMan.TryIndex<EntityPrototype>(loadout.DummyEntity, out var proto))
+        if (loadout.DummyEntity is not null && _protoMan.Resolve(loadout.DummyEntity, out var proto))
             return proto.Name;
 
-        if (_protoMan.TryIndex(loadout.StartingGear, out var gear))
+        if (_protoMan.Resolve(loadout.StartingGear, out var gear))
         {
             return GetName(gear);
         }
index cdb1b2dc74f59721369131ec96c25e38f05c0f95..e4ff855352186c26bbcd7db03fe2ce8d2fb0f0ac 100644 (file)
@@ -24,7 +24,7 @@ public sealed class SharedComponentTableSystem : EntitySystem
 
         foreach (var entity in spawns)
         {
-            if (_proto.TryIndex(entity, out var entProto))
+            if (_proto.Resolve(entity, out var entProto))
             {
                 EntityManager.AddComponents(ent, entProto.Components);
             }
index f3314dfc11bc21cbe6cb8fe49b4f26b9c57b36f0..7ac9fde94c763171086162976b562ecf2dc126ca 100644 (file)
@@ -109,7 +109,7 @@ namespace Content.Shared.Construction
                         materials[mat] += matAmount * amount * coefficient;
                     }
                 }
-                else if (_prototype.TryIndex(defaultProtoId, out var defaultProto) &&
+                else if (_prototype.Resolve(defaultProtoId, out var defaultProto) &&
                          defaultProto.TryGetComponent<PhysicalCompositionComponent>(out var physComp, EntityManager.ComponentFactory))
                 {
                     foreach (var (mat, matAmount) in physComp.MaterialComposition)
index 75908efea3aca9c192cfe36795d7b97d023a32de..d9eac28dabc5b95c86aced6a6f7ae4d3e55aa67f 100644 (file)
@@ -24,7 +24,7 @@ public sealed class ContainerCompSystem : EntitySystem
         if (args.Container.ID != ent.Comp.Container || _timing.ApplyingState)
             return;
 
-        if (_proto.TryIndex(ent.Comp.Proto, out var entProto))
+        if (_proto.Resolve(ent.Comp.Proto, out var entProto))
         {
             EntityManager.RemoveComponents(args.Entity, entProto.Components);
         }
@@ -35,7 +35,7 @@ public sealed class ContainerCompSystem : EntitySystem
         if (args.Container.ID != ent.Comp.Container || _timing.ApplyingState)
             return;
 
-        if (_proto.TryIndex(ent.Comp.Proto, out var entProto))
+        if (_proto.Resolve(ent.Comp.Proto, out var entProto))
         {
             EntityManager.AddComponents(args.Entity, entProto.Components);
         }
index 70fbc468068c998a1cbb6004edf888a545c4e9e4..f3a4f378301955f89e5149b22c30527555d63658 100644 (file)
@@ -92,7 +92,7 @@ namespace Content.Shared.Damage
         private void DamageableInit(EntityUid uid, DamageableComponent component, ComponentInit _)
         {
             if (component.DamageContainerID != null &&
-                _prototypeManager.TryIndex<DamageContainerPrototype>(component.DamageContainerID,
+                _prototypeManager.Resolve<DamageContainerPrototype>(component.DamageContainerID,
                 out var damageContainerPrototype))
             {
                 // Initialize damage dictionary, using the types and groups from the damage
@@ -195,7 +195,7 @@ namespace Content.Shared.Damage
             if (!ignoreResistances)
             {
                 if (damageable.DamageModifierSetId != null &&
-                    _prototypeManager.TryIndex<DamageModifierSetPrototype>(damageable.DamageModifierSetId, out var modifierSet))
+                    _prototypeManager.Resolve<DamageModifierSetPrototype>(damageable.DamageModifierSetId, out var modifierSet))
                 {
                     // TODO DAMAGE PERFORMANCE
                     // use a local private field instead of creating a new dictionary here..
index e844dc2280f5b66abb4391bcd200b49e0e793a00..28637f930349693b74b7b59cf211ebbf86b156e6 100644 (file)
@@ -254,9 +254,9 @@ namespace Content.Shared.Humanoid.Markings
             IoCManager.Resolve(ref prototypeManager);
             var speciesProto = prototypeManager.Index<SpeciesPrototype>(species);
             if (
-                !prototypeManager.TryIndex(speciesProto.SpriteSet, out var baseSprites) ||
+                !prototypeManager.Resolve(speciesProto.SpriteSet, out var baseSprites) ||
                 !baseSprites.Sprites.TryGetValue(layer, out var spriteName) ||
-                !prototypeManager.TryIndex(spriteName, out HumanoidSpeciesSpriteLayer? sprite) ||
+                !prototypeManager.Resolve(spriteName, out HumanoidSpeciesSpriteLayer? sprite) ||
                 sprite == null ||
                 !sprite.MarkingsMatchSkin
             )
index 1df46e53d6367ab1d6802f2b56e35d1d39cf45d3..7a22c0c29e8e6f2e71e8c754e62682b23f58fa9d 100644 (file)
@@ -91,7 +91,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
         }
 
         if (string.IsNullOrEmpty(humanoid.Initial)
-            || !_proto.TryIndex(humanoid.Initial, out HumanoidProfilePrototype? startingSet))
+            || !_proto.Resolve(humanoid.Initial, out HumanoidProfilePrototype? startingSet))
         {
             LoadProfile(uid, HumanoidCharacterProfile.DefaultWithSpecies(humanoid.Species), humanoid);
             return;
@@ -292,7 +292,7 @@ public abstract class SharedHumanoidAppearanceSystem : EntitySystem
         if (!Resolve(uid, ref humanoid))
             return;
 
-        if (!_proto.TryIndex<SpeciesPrototype>(humanoid.Species, out var species))
+        if (!_proto.Resolve<SpeciesPrototype>(humanoid.Species, out var species))
         {
             return;
         }
index 6dc6cbfe0b328dbe8538aac7d1bb292d3813d447..ce3c016080c998d6d43f06b9ce20b26d103ec485 100644 (file)
@@ -86,7 +86,7 @@ public sealed class UnpoweredFlashlightSystem : EntitySystem
         if (!_light.TryGetLight(uid, out var light))
             return;
 
-        if (_prototypeManager.TryIndex(component.EmaggedColorsPrototype, out var possibleColors))
+        if (_prototypeManager.Resolve(component.EmaggedColorsPrototype, out var possibleColors))
         {
             var pick = _random.Pick(possibleColors.Colors.Values);
             _light.SetColor(uid, pick, light);
index 0fa85666a027be2534737fa159a66581a194fd4a..697845b231fc92c42120071dedc4fae32378d6e3 100644 (file)
@@ -45,7 +45,7 @@ public sealed class FoodSequenceSystem : SharedFoodSequenceSystem
         if (!TryComp<FoodSequenceStartPointComponent>(args.Start, out var start))
             return;
 
-        if (!_proto.TryIndex(args.Proto, out var elementProto))
+        if (!_proto.Resolve(args.Proto, out var elementProto))
             return;
 
         if (!ent.Comp.OnlyFinal || elementProto.Final || start.FoodLayers.Count == start.MaxLayers)
@@ -117,8 +117,7 @@ public sealed class FoodSequenceSystem : SharedFoodSequenceSystem
         //looking for a suitable FoodSequence prototype
         if (!element.Comp1.Entries.TryGetValue(start.Comp.Key, out var elementProto))
             return false;
-
-        if (!_proto.TryIndex(elementProto, out var elementIndexed))
+        if (!_proto.Resolve(elementProto, out var elementIndexed))
             return false;
 
         //if we run out of space, we can still put in one last, final finishing element.
@@ -185,7 +184,7 @@ public sealed class FoodSequenceSystem : SharedFoodSequenceSystem
         var nameCounter = 1;
         foreach (var proto in existedContentNames)
         {
-            if (!_proto.TryIndex(proto, out var protoIndexed))
+            if (!_proto.Resolve(proto, out var protoIndexed))
                 continue;
 
             if (protoIndexed.Name is null)
index bd869c64154759f50b44b9961f398dcb1fc119e3..559a6a1019a3b8445e44049c83cd263b1f6ff71e 100644 (file)
@@ -237,13 +237,13 @@ public sealed class HungerSystem : EntitySystem
         switch (component.CurrentThreshold)
         {
             case HungerThreshold.Overfed:
-                _prototype.TryIndex(HungerIconOverfedId, out prototype);
+                _prototype.Resolve(HungerIconOverfedId, out prototype);
                 break;
             case HungerThreshold.Peckish:
-                _prototype.TryIndex(HungerIconPeckishId, out prototype);
+                _prototype.Resolve(HungerIconPeckishId, out prototype);
                 break;
             case HungerThreshold.Starving:
-                _prototype.TryIndex(HungerIconStarvingId, out prototype);
+                _prototype.Resolve(HungerIconStarvingId, out prototype);
                 break;
             default:
                 prototype = null;
index 808337639ab406a8c70d308aaa4f495b55b7d98a..ff0ce54953cd1d56dc94e983a47365f1ab354817 100644 (file)
@@ -126,15 +126,15 @@ public sealed class ThirstSystem : EntitySystem
         switch (component.CurrentThirstThreshold)
         {
             case ThirstThreshold.OverHydrated:
-                _prototype.TryIndex(ThirstIconOverhydratedId, out prototype);
+                _prototype.Resolve(ThirstIconOverhydratedId, out prototype);
                 break;
 
             case ThirstThreshold.Thirsty:
-                _prototype.TryIndex(ThirstIconThirstyId, out prototype);
+                _prototype.Resolve(ThirstIconThirstyId, out prototype);
                 break;
 
             case ThirstThreshold.Parched:
-                _prototype.TryIndex(ThirstIconParchedId, out prototype);
+                _prototype.Resolve(ThirstIconParchedId, out prototype);
                 break;
 
             default:
index 9e59573ff85fed1144f520f8ed49def613d6fe9b..b5c8ad08c5245f4add4e3c0e2cf942928254dba5 100644 (file)
@@ -53,7 +53,7 @@ public sealed partial class LastElementHasTags : FoodMetamorphRule
     {
         var lastIngredient = ingredients[ingredients.Count - 1];
 
-        if (!protoMan.TryIndex(lastIngredient.Proto, out var protoIndexed))
+        if (!protoMan.Resolve(lastIngredient.Proto, out var protoIndexed))
             return false;
 
         foreach (var tag in Tags)
@@ -96,7 +96,7 @@ public sealed partial class ElementHasTags : FoodMetamorphRule
         if (ingredients.Count < ElementNumber + 1)
             return false;
 
-        if (!protoMan.TryIndex(ingredients[ElementNumber].Proto, out var protoIndexed))
+        if (!protoMan.Resolve(ingredients[ElementNumber].Proto, out var protoIndexed))
             return false;
 
         foreach (var tag in Tags)
@@ -180,7 +180,7 @@ public sealed partial class IngredientsWithTags : FoodMetamorphRule
         var count = 0;
         foreach (var ingredient in ingredients)
         {
-            if (!protoMan.TryIndex(ingredient.Proto, out var protoIndexed))
+            if (!protoMan.Resolve(ingredient.Proto, out var protoIndexed))
                 continue;
 
             var allowed = false;
index f22669ddc70ec486fb41f58cac79a9bb4f178d25..e3447fdf3ab59707b3dda0208c090633ecfd6953 100644 (file)
@@ -399,7 +399,7 @@ namespace Content.Shared.Preferences
             // Category not found so dump it.
             TraitCategoryPrototype? traitCategory = null;
 
-            if (category != null && !protoManager.TryIndex(category, out traitCategory))
+            if (category != null && !protoManager.Resolve(category, out traitCategory))
                 return new(this);
 
             var list = new HashSet<ProtoId<TraitPrototype>>(_traitPreferences) { traitId };
@@ -662,7 +662,7 @@ namespace Content.Shared.Preferences
                 }
 
                 // No category so dump it.
-                if (!protoManager.TryIndex(traitProto.Category, out var category))
+                if (!protoManager.Resolve(traitProto.Category, out var category))
                     continue;
 
                 var existing = groups.GetOrNew(category.ID);
index cb8450a50063b7d59cc2badc55eb2182dd2ea98a..2e638d7c13bbe223dac9827dd287e2177180be8f 100644 (file)
@@ -111,7 +111,7 @@ public sealed class RCDSystem : EntitySystem
             var name = Loc.GetString(prototype.SetName);
 
             if (prototype.Prototype != null &&
-                _protoManager.TryIndex(prototype.Prototype, out var proto))
+                _protoManager.Resolve(prototype.Prototype, out var proto))
                 name = proto.Name;
 
             msg = Loc.GetString("rcd-component-examine-build-details", ("name", name));
@@ -178,7 +178,7 @@ public sealed class RCDSystem : EntitySystem
                     var deconstructedTile = _mapSystem.GetTileRef(gridUid.Value, mapGrid, location);
                     var protoName = !_turf.IsSpace(deconstructedTile) ? _deconstructTileProto : _deconstructLatticeProto;
 
-                    if (_protoManager.TryIndex(protoName, out var deconProto))
+                    if (_protoManager.Resolve(protoName, out var deconProto))
                     {
                         cost = deconProto.Cost;
                         delay = deconProto.Delay;
index 8c8629921031f403f85153088baa5b14f57841c8..4034b8b419d28a9ebdb899473ff7ee02294319e5 100644 (file)
@@ -53,7 +53,7 @@ public sealed partial class DepartmentTimeRequirement : JobRequirement
         var formattedDeptDiff = ContentLocalizationManager.FormatPlaytime(deptDiffSpan);
         var nameDepartment = "role-timer-department-unknown";
 
-        if (protoManager.TryIndex(Department, out var departmentIndexed))
+        if (protoManager.Resolve(Department, out var departmentIndexed))
         {
             nameDepartment = departmentIndexed.Name;
         }
index 6526a3237af91633ae569d79610db2c167564fab..867842308e5f19d5207fbd9a3a10dedfaa5c7a95 100644 (file)
@@ -161,7 +161,7 @@ public abstract class SharedJobSystem : EntitySystem
         prototype = null;
         MindTryGetJobId(mindId, out var protoId);
 
-        return _prototypes.TryIndex(protoId, out prototype) || prototype is not null;
+        return _prototypes.Resolve(protoId, out prototype) || prototype is not null;
     }
 
     public bool MindTryGetJobId(
index d1afae9fd1c409c5df0ae202f87f38a2376085a0..ea25555257f314af2e560bfddba714f4bb2f84a8 100644 (file)
@@ -140,7 +140,7 @@ public abstract class SharedRoleSystem : EntitySystem
             return;
         }
 
-        if (!_prototypes.TryIndex(protoId, out var protoEnt))
+        if (!_prototypes.Resolve(protoId, out var protoEnt))
         {
             Log.Error($"Failed to add role {protoId} to {ToPrettyString(mindId)} : Role prototype does not exist");
             return;
index 914470e3c9ab85557626d4a025c4f5ddfcd99448..12a7928c0be8db3b27b587894306467de9d538a4 100644 (file)
@@ -100,7 +100,7 @@ public abstract class SharedBorgSwitchableTypeSystem : EntitySystem
 
     protected void UpdateEntityAppearance(Entity<BorgSwitchableTypeComponent> entity)
     {
-        if (!Prototypes.TryIndex(entity.Comp.SelectedBorgType, out var proto))
+        if (!Prototypes.Resolve(entity.Comp.SelectedBorgType, out var proto))
             return;
 
         UpdateEntityAppearance(entity, proto);
index d3f3fe42973aea614f4d522c2e214251a2baa572..7a5131c9a175c81f9a66fe8f0233bad92cb46150 100644 (file)
@@ -15,7 +15,7 @@ public abstract partial class SharedStationAiSystem
 
     private void OnStationAiCustomization(Entity<StationAiCoreComponent> entity, ref StationAiCustomizationMessage args)
     {
-        if (!_protoManager.TryIndex(args.GroupProtoId, out var groupPrototype) || !_protoManager.TryIndex(args.CustomizationProtoId, out var customizationProto))
+        if (!_protoManager.Resolve(args.GroupProtoId, out var groupPrototype) || !_protoManager.Resolve(args.CustomizationProtoId, out var customizationProto))
             return;
 
         if (!TryGetHeld((entity, entity.Comp), out var held))
@@ -48,7 +48,7 @@ public abstract partial class SharedStationAiSystem
         if (!entity.Comp.ProtoIds.TryGetValue(_stationAiHologramCustomGroupProtoId, out var protoId))
             return;
 
-        if (!_protoManager.TryIndex(protoId, out var prototype))
+        if (!_protoManager.Resolve(protoId, out var prototype))
             return;
 
         if (!prototype.LayerData.TryGetValue(StationAiState.Hologram.ToString(), out var layerData))
@@ -70,7 +70,7 @@ public abstract partial class SharedStationAiSystem
 
         if (!TryComp<StationAiCustomizationComponent>(stationAi, out var stationAiCustomization) ||
             !stationAiCustomization.ProtoIds.TryGetValue(_stationAiCoreCustomGroupProtoId, out var protoId) ||
-            !_protoManager.TryIndex(protoId, out var prototype) ||
+            !_protoManager.Resolve(protoId, out var prototype) ||
             !prototype.LayerData.TryGetValue(state.ToString(), out var layerData))
         {
             return;
index 0a766df3489b22f043b8b8effad1c624818cf024..a1316e356521f7753dfb6b603fc4de5fc54193be 100644 (file)
@@ -181,7 +181,7 @@ public abstract class SharedSprayPainterSystem : EntitySystem
 
         if (ent.Comp.Group is not { } group
             || !painter.StylesByGroup.TryGetValue(group, out var selectedStyle)
-            || !Proto.TryIndex(group, out PaintableGroupPrototype? targetGroup))
+            || !Proto.Resolve(group, out PaintableGroupPrototype? targetGroup))
             return;
 
         // Valid paint target.
index ac65bd558410296275cd38fb62936004f1ad3595..4ed0da5b9e5f7c30c8a19c44b8d94a1b0e83cdbd 100644 (file)
@@ -73,7 +73,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem
             name = loadout.EntityName;
         }
 
-        if (string.IsNullOrEmpty(name) && PrototypeManager.TryIndex(roleProto.NameDataset, out var nameData))
+        if (string.IsNullOrEmpty(name) && PrototypeManager.Resolve(roleProto.NameDataset, out var nameData))
         {
             name = Loc.GetString(_random.Pick(nameData.Values));
         }
@@ -95,7 +95,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem
     /// </summary>
     public void EquipStartingGear(EntityUid entity, ProtoId<StartingGearPrototype>? startingGear, bool raiseEvent = true)
     {
-        PrototypeManager.TryIndex(startingGear, out var gearProto);
+        PrototypeManager.Resolve(startingGear, out var gearProto);
         EquipStartingGear(entity, gearProto, raiseEvent);
     }
 
@@ -198,7 +198,7 @@ public abstract class SharedStationSpawningSystem : EntitySystem
         {
             foreach (var items in group.Value)
             {
-                if (!PrototypeManager.TryIndex(items.Prototype, out var loadoutPrototype))
+                if (!PrototypeManager.Resolve(items.Prototype, out var loadoutPrototype))
                     return null;
 
                 var gear = ((IEquipmentLoadout) loadoutPrototype).GetGear(slot);
index 750868481e1336236868a26f95d9f5870753a98d..446b3fd3b1ae12d8365dc062fac9cebf507a01e2 100644 (file)
@@ -123,7 +123,7 @@ public sealed partial class StatusEffectsSystem : EntitySystem
 
     public bool CanAddStatusEffect(EntityUid uid, EntProtoId effectProto)
     {
-        if (!_proto.TryIndex(effectProto, out var effectProtoData))
+        if (!_proto.Resolve(effectProto, out var effectProtoData))
             return false;
 
         if (!effectProtoData.TryGetComponent<StatusEffectComponent>(out var effectProtoComp, Factory))
index 6c0cc2d65672c01086ec1abc3935e8fffd4da27d..0d744a4fe904067b2b913138bc20be96a8482cba 100644 (file)
@@ -108,7 +108,7 @@ public sealed class DumpableSystem : EntitySystem
         foreach (var entity in storage.Container.ContainedEntities)
         {
             if (!_itemQuery.TryGetComponent(entity, out var itemComp) ||
-                !_prototypeManager.TryIndex(itemComp.Size, out var itemSize))
+                !_prototypeManager.Resolve(itemComp.Size, out var itemSize))
             {
                 continue;
             }
index 74c47bbb25023d3820036fbf959db3e0c1b9cddf..e4f0aa8b234b597c50ad9044614515555a60a480 100644 (file)
@@ -579,7 +579,7 @@ public abstract class SharedStorageSystem : EntitySystem
             {
                 if (entity == args.User
                     || !_itemQuery.TryGetComponent(entity, out var itemComp) // Need comp to get item size to get weight
-                    || !_prototype.TryIndex(itemComp.Size, out var itemSize)
+                    || !_prototype.Resolve(itemComp.Size, out var itemSize)
                     || !CanInsert(uid, entity, out _, storageComp, item: itemComp)
                     || !_interactionSystem.InRangeUnobstructed(args.User, entity))
                 {
@@ -1822,7 +1822,7 @@ public abstract class SharedStorageSystem : EntitySystem
         // If we specify a max item size, use that
         if (uid.Comp.MaxItemSize != null)
         {
-            if (_prototype.TryIndex(uid.Comp.MaxItemSize.Value, out var proto))
+            if (_prototype.Resolve(uid.Comp.MaxItemSize.Value, out var proto))
                 return proto;
 
             Log.Error($"{ToPrettyString(uid.Owner)} tried to get invalid item size prototype: {uid.Comp.MaxItemSize.Value}. Stack trace:\\n{Environment.StackTrace}");
index 51ad85730c76becd3838fcfe06d4c69c87badf1e..07699fa372dbf89e409f69e9fa2573b3bdf3b565 100644 (file)
@@ -24,7 +24,7 @@ public sealed partial class StoryGeneratorSystem : EntitySystem
     public bool TryGenerateStoryFromTemplate(ProtoId<StoryTemplatePrototype> template, [NotNullWhen(true)] out string? story, int? seed = null)
     {
         // Get the story template prototype from the ID
-        if (!_protoMan.TryIndex(template, out var templateProto))
+        if (!_protoMan.Resolve(template, out var templateProto))
         {
             story = null;
             return false;
@@ -39,7 +39,7 @@ public sealed partial class StoryGeneratorSystem : EntitySystem
         foreach (var (name, list) in templateProto.Variables)
         {
             // Get the prototype for the world list dataset
-            if (!_protoMan.TryIndex(list, out var listProto))
+            if (!_protoMan.Resolve(list, out var listProto))
                 continue; // Missed one, but keep going with the rest of the story
 
             // Pick a random word from the dataset and localize it