Delta-v/Content.Server/StationEvents/Events
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
..
AlertLevelInterceptionRule.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
AnomalySpawnRule.cs Move some Station methods into shared (#38976) 2025-11-23 15:22:20 -06:00
BluespaceArtifactRule.cs :trollface: 2024-08-09 19:59:39 +01:00
BluespaceLockerRule.cs predict morgue and crematorium (#39293) 2025-11-23 15:22:29 -06:00
BreakerFlipRule.cs :trollface: 2024-08-09 20:32:23 +01:00
BureaucraticErrorRule.cs Fix Station AI being affected by Bureaucratic Event (#32021) 2024-09-14 14:23:14 +01:00
CargoGiftsRule.cs Move some Station methods into shared (#38976) 2025-11-23 15:22:20 -06:00
ClericalErrorRule.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
FalseAlarmRule.cs Station event component and system tweaks (#28331) 2024-08-09 19:52:18 +01:00
GasLeakRule.cs Station event component and system tweaks (#28331) 2024-08-09 19:52:18 +01:00
GreytideVirusRule.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
ImmovableRodRule.cs Cleanup: Pass in ``IComponentFactory`` in ``EntityPrototype.TryGetComponent`` calls inside ``ImmovableRodRule`` (#35462) 2025-03-01 14:20:25 +00:00
IonStormRule.cs cherrypick: PR 149 and 329 from cosmatic-drift-14/cosmatic-drift (#3409) 2025-04-10 13:42:24 -04:00
KudzuGrowthRule.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
MassHallucinationsRule.cs :trollface: 2024-08-09 20:32:23 +01:00
MeteorSwarmSystem.cs Move some Station methods into shared (#38976) 2025-11-23 15:22:20 -06:00
PowerGridCheckRule.cs Cleanup: Use ``SoundCollectionSpecifier`` instead of string literals in ``PowerGridCheckRule`` (#35449) 2025-03-01 14:28:57 +00:00
RandomEntityStorageSpawnRule.cs predict morgue and crematorium (#39293) 2025-11-23 15:22:29 -06:00
RandomSentienceRule.cs Stop Sentience Event targeting Zombified Creatures (#39950) 2025-11-23 15:22:32 -06:00
RandomSpawnRule.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
SolarFlareRule.cs Predict PoweredLights (#36541) 2025-11-23 15:22:23 -06:00
SpaceSpawnRule.cs Move some Station methods into shared (#38976) 2025-11-23 15:22:20 -06:00
StationEventSystem.cs Fix mid round antags not starting (#28523) 2024-08-12 20:39:21 +01:00
VentClogRule.cs Upstream Merge (June / July) attempt 2 electric boogaloo (#4607) 2025-11-06 18:22:39 +00:00
VentCrittersRule.cs more harmless critters from events (#2518) 2025-01-02 22:18:09 +00:00