fish-station/Content.Server/GameTicking
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
..
Commands Fool players with decoy presets (#40053) 2025-09-04 15:03:47 +02:00
Events Metagame improvements to antag-before-job selection system (#35830) 2025-03-19 18:28:25 +01:00
Presets 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
Prototypes Cleanup: Remove redundant prototype name specifications (#35793) 2025-03-19 19:30:31 +01:00
Rules Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
GameTicker.cs Revert "Added button and manager for in game bug reports (Part 1)" (#39872) 2025-08-28 01:46:24 -07:00
GameTicker.CVars.cs Fix RA0032 (#32514) 2024-09-29 02:25:21 +02:00
GameTicker.GamePreset.cs Fool players with decoy presets (#40053) 2025-09-04 15:03:47 +02:00
GameTicker.GameRule.cs Multiantag Gamemode (#37783) 2025-08-15 16:06:51 +02:00
GameTicker.Lobby.cs Fool players with decoy presets (#40053) 2025-09-04 15:03:47 +02:00
GameTicker.LobbyBackground.cs WebP lobby images (#25184) 2024-02-16 16:55:57 -07:00
GameTicker.Player.cs remove Session from MindComponent (#34753) 2025-04-19 00:23:01 +02:00
GameTicker.Replays.cs Fix RA0032 (#32514) 2024-09-29 02:25:21 +02:00
GameTicker.RoundFlow.cs Revert "Added button and manager for in game bug reports (Part 1)" (#39872) 2025-08-28 01:46:24 -07:00
GameTicker.Spawning.cs Replace ValidatePrototypeId uses with ProtoId or EntProtoId (#38814) 2025-07-07 21:57:05 +02:00
GameTicker.StatusShell.cs Add a CCVar to allow from hiding admins in the reported player count. (#34406) 2025-01-15 22:10:54 +01:00
ManifestEntry.cs Cleanup the namespaces (#8132) 2022-05-13 17:59:03 +10:00