Commit Graph

14 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
Tayrtahn
75db49f9c0 Clean up all missing EntitySystem proxy method uses (#38353) 2025-06-26 16:50:49 -07:00
DrSmugleaf
f5d0e955e3 Fix imports 2024-11-19 21:16:49 -08:00
lzk
8b2ea59515 don't apply traits for borg and ai (#31990)
* doesn't apply traits for borg or ai

* add some comment and summaries

* weh

weh

* well ok

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>

---------

Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com>
2024-09-12 13:36:41 +03:00
Cojoke
b57174007c Remove all Assigned Values that are Never Used (#30110)
Remove all Assigned Values that are never used
2024-07-18 20:22:23 -04:00
Plykiya
c5ff647ca6 Replace obsolete EntityWhitelist IsValid usages part 2 (#28506) 2024-06-03 17:40:03 -04:00
Ed
a4d1601758 Accent trait limit (#28046) 2024-06-03 14:47:06 -04:00
LordCarve
aafe815122 Obsolete Logger cleanup for EntitySystems (#25941)
* Small obsolete Logger cleanup

* Fixed three EntitySystem logs that weren't doing it right.
2024-03-10 01:15:13 +01:00
metalgearsloth
d254a7d2cb Don't add trait comps if present (#16424) 2023-05-14 21:18:18 +10:00
forkeyboards
e72db80060 White Cane for Blind People (#16318) 2023-05-13 13:11:35 +10:00
Paul Ritter
bca66488bf more proper serv4 usage because i forgot to push for the last pr (#12965) 2022-12-11 00:25:04 +01:00
Paul Ritter
3884c4d3db serv4 + submodule update (#12740)
Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
2022-11-27 19:25:55 +01:00
Rane
084b482cfe Entity whitelist/blacklist for traits (#12348) 2022-11-04 12:37:17 +11:00
Visne
4cc5fa239e Implement traits system (#10693) 2022-09-10 08:40:06 -07:00