Commit Graph

17 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
slarticodefast
2743dcf67f Move mind role components to shared (#39606) 2025-08-13 12:51:46 +02:00
beck-thompson
05fac53de6 Chameleon controller implant (Clothing fast switch) (#33887)
* Add the chameleon controller implant

* address the issues (Git please dont kill me)

* Address the review and fix some merge conflicts!

* Cleanup

* Add use delay

* Silly mistakes

* Making a PR at 2 am: Gone wrong

* Predict use delay and disable the buttons until you can choose another

* First phase custom clothing

* Better system, now relays to agent id and mindshield. Chameleon loadouts are a lot better to work with as well

* Address the review! No more evil goto

* Slams way is better I should have read more closely xD

* Some of the jobs

* Add to Cargo, CentComm, Service, Passenger, Ninja, Cluwne, Wizard + Minor changes to existing; Add chameleon to bandanas, medals, jugsuits and HUDs

* Add everything else

* Fix test

* Job name

* This looks better

* Add department organization

* Minor cleanup

* Added some mindshields

* Remove redudent comment and change funcion name to be clearer

* Fix cluwne outfit

* fix merge conflicts

---------

Co-authored-by: SlamBamActionman <slambamactionman@gmail.com>
2025-05-30 12:07:25 +02:00
Leon Friedrich
4e0018697f Add role prototype validation tests (#32801)
* Add role prototype validation test

* Rejig GetPrototypesWithComponent

* More tests n stuff
2024-10-14 14:05:25 +11:00
Errant
93c7bdc134 Mind Role Entities (#31318)
* Mind Role Entities wip

* headrev count fix

* silicon stuff, cleanup

* exclusive antag config, cleanup

* jobroleadd overwerite

* logging stuff

* MindHasRole cleanup, admin log stuff

* last second cleanup

* ocd

* minor cleanup

* remove createdTime datafield

* now actually using the event replacement I made for role time tracking

* weh
2024-10-10 10:48:56 +02:00
nikthechampiongr
a5840b925b Fix RA0032 (#32514) 2024-09-29 02:25:21 +02:00
Leon Friedrich
adeed705e6 Add Job preference tests (#28625)
* Misc Job related changes

* Add JobTest

* A

* Aa

* Lets not confuse the yaml linter

* fixes

* a
2024-06-06 00:19:24 +10:00
deltanedas
492ccc93d0 fix antag selection being evil (#28197)
* fix antag selection being evil

* fix test

* untroll the other tests

* remove role timer troll

* Allow tests to modify antag preferences

* Fix antag selection

* Misc test fixes

* Add AntagPreferenceTest

* Fix lazy mistakes

* Test cleanup

* Try stop players in lobbies from being assigned mid-round antags

* ranting

* I am going insane

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2024-05-26 01:14:29 -04:00
deltanedas
d1d11d09c7 Add TryGetPrimaryDepartment to jobs system (#23317)
* add primary departments

* make command and station specific secondary

* add a unit test

* fixy

* compile

* webedit ops

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-01-14 19:18:34 +11:00
Leon Friedrich
b6bd82caa6 Use ECS prototype-reload events (#22613)
* Use ECS prototype-reload events

* better constructors

* Maybe this fixes tests?
2023-12-23 01:13:45 +11:00
DrSmugleaf
dc3b6e31b2 Fix Client RoleSystem not inheriting SharedRoleSystem, network job component (#21436) 2023-11-07 14:44:53 -08:00
Leon Friedrich
e685cb626b Un-revert IPlayerManager refactor (#21244) 2023-10-28 09:59:53 +11:00
metalgearsloth
a2bbda43cc Revert "Update submodule to 172.0.0 (#21222)" (#21225) 2023-10-24 21:55:20 +11:00
Leon Friedrich
7ba0ea2926 IPlayerManager refactor (#21215) 2023-10-24 20:19:08 +11:00
metalgearsloth
66c4dfaa8e Fix tests (#20017) 2023-09-11 18:10:07 +10:00
metalgearsloth
b77265314b Make role timer tooltips pretty (#19605)
Co-authored-by: ElectroJr <leonsfriedrich@gmail.com>
2023-09-11 15:44:21 +10:00
DrSmugleaf
3f3ba6ac62 Move minds, roles, jobs and objectives to shared (#19679) 2023-08-30 21:46:11 -07:00