Commit Graph

7 Commits

Author SHA1 Message Date
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
Ed
da75258f9f Fix RoleTimeRequirement localization (#34735)
* fix job restriction localization

* Update Content.Shared/Roles/JobRequirement/RoleTimeRequirement.cs

* Update Content.Shared/Roles/JobRequirement/RoleTimeRequirement.cs

---------

Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2025-01-29 14:23:34 +01:00
Stalen
24f79c3ecc Fix playtime formatting (#32974) 2024-10-28 19:00:00 +01:00
metalgearsloth
71c9894903 Jobreq format (#32806)
* Format job requirements as hours and minutes

* Use TimeSpan.ToString for playtime instead of custom method

* wehflicts

---------

Co-authored-by: jmcb <joelsgp@protonmail.com>
2024-10-14 14:54:31 +11:00
Ed
055dfe6f0b No pacifist or blind sec (#30777)
* no pacifist sec

* also block blindness

* Update warden.yml

* Update security_officer.yml

* Update head_of_security.yml

* Update security_cadet.yml

* Update detective.yml
2024-08-19 14:42:55 +03:00
Brandon Hu
46f631fa11 tweak(AgeRequirement): Make the requiredAge more sensible (#30913) 2024-08-11 21:47:26 +03:00
Ed
a95d2257c3 JobRequirement refactor (#30347)
* refactor JobRequirements

* add profile support

* fix

* Update quartermaster.yml

* sloth fixes

* inport 30208

* Update DepartmentPrototype.cs

* species restriction

* left tweak stick

* stringbuilder is cool!
2024-08-05 14:25:49 +10:00