Delta-v/Content.Server/Destructible/Thresholds/Behaviors
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
..
BurnBodyBehavior.cs remove extra queuedel 2025-04-12 15:46:01 +01:00
ChangeConstructionNodeBehavior.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
DoActsBehavior.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
DumpCanisterBehavior.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
DumpRestockInventory.cs CompFactory updates (#37559) 2025-08-04 15:25:05 +02:00
EjectVendorItems.cs Resolve `'EntitySystem.Get<T>()' is obsolete` in content (#27936) 2024-05-18 13:58:55 +02:00
EmptyAllContainersBehaviour.cs upstream merge 27/04/2025 (#3596) 2025-05-06 19:35:03 -04:00
EmptyContainersBehaviour.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
ExplodeBehavior.cs Refactor serialization copying to use source generators (#19412) 2023-08-22 18:14:33 -07:00
GibBehavior.cs "New player" admin logging improvements (#35961) 2025-03-23 16:17:16 +00:00
IThresholdBehavior.cs "New player" admin logging improvements (#35961) 2025-03-23 16:17:16 +00:00
OpenBehavior.cs Resolve `'EntitySystem.Get<T>()' is obsolete` in content (#27936) 2024-05-18 13:58:55 +02:00
PlaySoundBehavior.cs Unrevert audio (#21330) 2023-12-02 20:16:36 +01:00
PopupBehavior.cs New Feature: Symptoms of radiation poisoning (#39805) 2025-11-23 15:22:32 -06:00
SolutionExplosionBehavior.cs move TriggerExplosion to shared (#30227) 2025-03-01 17:02:14 +00:00
SpawnEntitiesBehavior.cs CompFactory updates (#37559) 2025-08-04 15:25:05 +02:00
SpawnGasBehavior.cs Move GasMixture to shared (#27480) 2024-05-07 04:00:15 +02:00
SpillBehavior.cs cherry pick "fix solution contents duplication on spill behavior" (#33231) (#2157) 2024-11-09 12:46:34 +00:00
TimerStartBehavior.cs Trigger Refactor (#39034) 2025-11-23 15:22:15 -06:00
TriggerBehavior.cs Trigger Refactor (#39034) 2025-11-23 15:22:15 -06:00
VomitBehavior.cs New Feature: Symptoms of radiation poisoning (#39805) 2025-11-23 15:22:32 -06:00
WeightedSpawnEntityBehavior.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00