Delta-v/Content.Shared/Construction
Pieter-Jan Briers b7f297f612 Fix usages of TryIndex() (#39124)
* 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 (94f98073b0), 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>
2025-12-29 11:39:03 -06:00
..
Components Sentry turrets - Part 7: Electronics and construction graphs (#35236) 2025-11-23 15:22:33 -06:00
Conditions Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
EntitySystems Re-anchorable structures (#39542) 2025-11-23 15:22:32 -06:00
NodeEntities Sentry turrets - Part 7: Electronics and construction graphs (#35236) 2025-11-23 15:22:33 -06:00
Prototypes Layering for atmospheric pipes (#36124) 2025-08-06 22:53:27 +02:00
Serialization Construction graph improvements (#17960) 2023-07-13 20:23:52 +10:00
Steps Localizable craftmenu (#32339) 2025-05-18 16:09:54 +01:00
ConstructionGraphEdge.cs Use construction graphs for hacking protections (#20265) 2023-10-08 19:58:52 +02:00
ConstructionGraphNode.cs Localizable craftmenu (#32339) 2025-05-18 16:09:54 +01:00
ConstructionGuide.cs Cleanup the namespaces (#8132) 2022-05-13 17:59:03 +10:00
Enums.cs Replace `SpriteStateChange` construction action with `AppearanceChange` (#15914) 2023-04-30 07:04:31 +10:00
Events.cs Content update for NetEntities (#18935) 2023-09-27 21:59:12 +02:00
IGraphAction.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
IGraphCondition.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
IGraphNodeEntity.cs Construction graph improvements (#17960) 2023-07-13 20:23:52 +10:00
IGraphTransform.cs Construction graph improvements (#17960) 2023-07-13 20:23:52 +10:00
MachineDeconstructedEvent.cs stasis bed and microwave qol(#21572) 2023-11-12 20:55:31 +01:00
MachinePartSystem.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
PartAssemblySystem.cs Content ecs containers (#22484) 2024-01-22 18:47:55 +01:00
SharedCanBuildWindowOnTopComponent.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
SharedConstructionSystem.cs Cleanup remaining `MapGridComponent.GetAnchoredEntities(MapCoordinates)` uses (#37729) 2025-08-04 19:26:18 +02:00
SharedFlatpackSystem.cs Fix flatpacker (#28736) 2024-08-22 13:41:09 +01:00