fish-station/Content.Server/StationEvents/Events
Pieter-Jan Briers 0c97520276
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-09-09 18:17:56 +02:00
..
AlertLevelInterceptionRule.cs move gamerule components to shared (#28572) 2024-06-04 21:53:24 +10:00
AnomalySpawnRule.cs Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
BluespaceArtifactRule.cs move gamerule components to shared (#28572) 2024-06-04 21:53:24 +10:00
BluespaceLockerRule.cs predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
BreakerFlipRule.cs Fix replayghost spawning location (#30252) 2024-07-22 20:32:30 +01:00
BureaucraticErrorRule.cs Fix Station AI being affected by Bureaucratic Event (#32021) 2024-09-11 13:24:24 +02:00
CargoGiftsRule.cs Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
ClericalErrorRule.cs move gamerule components to shared (#28572) 2024-06-04 21:53:24 +10:00
FalseAlarmRule.cs move gamerule components to shared (#28572) 2024-06-04 21:53:24 +10:00
GasLeakRule.cs move gamerule components to shared (#28572) 2024-06-04 21:53:24 +10:00
GreytideVirusRule.cs Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
ImmovableRodRule.cs Cleanup: Pass in `IComponentFactory in EntityPrototype.TryGetComponent calls inside ImmovableRodRule` (#35462) 2025-02-24 18:57:39 +01:00
IonStormRule.cs minor Derelict Cyborg code changes. 2024-10-04 08:31:55 +02:00
KudzuGrowthRule.cs move gamerule components to shared (#28572) 2024-06-04 21:53:24 +10:00
MassHallucinationsRule.cs MassHallucinationsRule Minor Refactor (#28748) 2024-07-20 15:53:57 +10:00
MeteorSwarmSystem.cs Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
PowerGridCheckRule.cs Cleanup: Use `SoundCollectionSpecifier instead of string literals in PowerGridCheckRule` (#35449) 2025-02-25 08:16:10 +11:00
RandomEntityStorageSpawnRule.cs predict morgue and crematorium (#39293) 2025-08-21 16:49:50 -07:00
RandomSentienceRule.cs Stop Sentience Event targeting Zombified Creatures (#39950) 2025-08-29 13:48:31 +02:00
RandomSpawnRule.cs move gamerule components to shared (#28572) 2024-06-04 21:53:24 +10:00
SolarFlareRule.cs Predict PoweredLights (#36541) 2025-08-11 23:06:28 +02:00
SpaceSpawnRule.cs Move some Station methods into shared (#38976) 2025-08-08 11:22:34 -04:00
StationEventSystem.cs Don't show the Meteor Swarm announcement to players in the lobby. (#30922) 2024-08-12 12:13:28 +10:00
VentClogRule.cs Replace usages of customTypeSerializer PrototypeIdListSerializer with something that doesn't take 20 separate words to type out (#37959) 2025-07-10 05:06:51 +02:00
VentCrittersRule.cs Fix replayghost spawning location (#30252) 2024-07-22 20:32:30 +01:00