Delta-v/Content.Server/GameTicking/Rules
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 Changeling devour and transform (#34002) 2025-11-23 15:22:18 -06:00
VariationPass Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
AntagLoadProfileRuleSystem.cs Fix usages of TryIndex() (#39124) 2025-12-29 11:39:03 -06:00
DeathMatchRuleSystem.cs Relocate SetOutfit method to ServerClothingSystem and LEC setoutfit command. (#38391) 2025-08-07 19:30:19 +02:00
DragonRuleSystem.cs Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00
DynamicRuleSystem.cs Multiantag Gamemode (#37783) 2025-11-23 15:22:25 -06:00
GameRuleSystem.Utility.cs Move some Station methods into shared (#38976) 2025-11-23 15:22:20 -06:00
GameRuleSystem.cs Fix test ops real (#1626) 2024-08-14 15:09:20 +00:00
InactivityTimeRestartRuleSystem.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
KillCalloutRuleSystem.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
LoadMapRuleSystem.cs Refactor map loading & saving (#34020) 2025-03-01 13:20:37 +00:00
MaxTimeRestartRuleSystem.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
NukeopsRuleSystem.cs Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00
ParadoxCloneRuleSystem.cs Add paradox clone to admin antag control (#36105) 2025-04-06 20:41:20 +01:00
RespawnRuleSystem.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
RevolutionaryRuleSystem.cs Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00
RoundstartStationVariationRuleSystem.cs Move some Station methods into shared (#38976) 2025-11-23 15:22:20 -06:00
RuleGridsSystem.cs LoadMapRule grid storage rework (#28210) 2024-06-08 20:14:24 +02:00
SandboxRuleSystem.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
SecretRuleSystem.cs Make secret take total player amount into account, lower the required amount of players ready (#4246) 2025-08-21 08:53:49 +00:00
SubGamemodesSystem.cs move gamerule components to shared (#28572) 2024-08-09 19:42:00 +01:00
SurvivorRuleSystem.cs Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00
ThiefRuleSystem.cs Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00
TraitorRuleSystem.cs Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00
ZombieRuleSystem.cs Move mind role components to shared (#39606) 2025-11-23 15:22:24 -06:00