fish-station/Content.Shared/Damage/Systems
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
..
DamageableSystem.cs Fix usages of TryIndex() (#39124) 2025-09-09 18:17:56 +02:00
DamageContactsSystem.cs Damaged by contact fix (#31921) 2024-09-07 17:46:24 -06:00
DamageExamineSystem.cs Optimization! 2024-11-10 00:45:54 -06:00
DamageOnAttackedSystem.cs Remove unused IoC dependency references. (#31704) 2024-09-01 23:22:50 +02:00
DamageOnHighSpeedImpactSystem.cs Stunnable New Status and Cleanup (#38618) 2025-07-21 19:22:11 +02:00
DamageOnHoldingSystem.cs replace all uses of TryGetContainingContainer with non-obsolete overload (#30583) 2024-08-04 15:38:53 +10:00
DamageOnInteractSystem.cs Stunnable New Status and Cleanup (#38618) 2025-07-21 19:22:11 +02:00
DamagePopupSystem.cs Predict DamagePopup (#36547) 2025-04-14 21:10:09 +02:00
DamageProtectionBuffSystem.cs Add haloperidol, potassium iodide (#27454) 2024-08-03 03:12:08 +10:00
PassiveDamageSystem.cs Random spontaneous cleanup PR (#25131) 2024-02-13 16:48:39 -05:00
RequireProjectileTargetSystem.cs Cluster grenade refactor and contra markings (#31108) 2024-12-16 13:08:07 +01:00
SharedGodmodeSystem.cs Debody Food and Drink Systems, Combine Food and Drink into One System. (#39031) 2025-08-06 12:53:38 -04:00
SharedStaminaSystem.cs Alerts Cleanup and API (#39544) 2025-09-05 12:45:48 +03:00
SharedStaminaSystem.Modifier.cs StaminaSystem to SharedStaminaSystem (#37199) 2025-05-06 12:39:05 -04:00
SharedStaminaSystem.Resistance.cs StaminaSystem to SharedStaminaSystem (#37199) 2025-05-06 12:39:05 -04:00
SlowOnDamageSystem.cs Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00