From d8d5b796343815a3b6cadc08e812cc4640c8fd79 Mon Sep 17 00:00:00 2001 From: zimon9 <122945887+zimon9@users.noreply.github.com> Date: Thu, 24 Oct 2024 06:17:03 -0400 Subject: [PATCH] Fixes searching with the orbit menu (#3629) ## About The Pull Request This PR modifies the search algorithm for points of interests so that the real name of a character, e.g. "Kristina Dryden" is what gets passed to the search function, instead of a character's "full name", e.g. "calm human woman". ![vf7sJJ034D](https://github.com/user-attachments/assets/59b9381b-f49d-4564-a8b7-e33653706693) The sorting algorithm seems to take jobs as the sorting parameter, instead of real names. As of right now, the portion of code that causes this to occur still eludes me. ## Why It's Good For The Game This felt like a minor oversight to me. It feels clunky to search for a character's name and have the search return no results because the search function had been looking for a character's _attributes_ instead. ## Changelog :cl: fix: fixed the orbit menu search function so that names work again /:cl: --- tgui/packages/tgui/interfaces/Orbit/helpers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tgui/packages/tgui/interfaces/Orbit/helpers.ts b/tgui/packages/tgui/interfaces/Orbit/helpers.ts index 7046f784cd6cd..4a90b96eb2b62 100644 --- a/tgui/packages/tgui/interfaces/Orbit/helpers.ts +++ b/tgui/packages/tgui/interfaces/Orbit/helpers.ts @@ -81,10 +81,10 @@ export const isJobOrNameMatch = ( ): boolean => { if (!searchQuery) return true; - const { full_name, job } = observable; + const { name, job } = observable; return ( - full_name?.toLowerCase().includes(searchQuery?.toLowerCase()) || + name?.toLowerCase().includes(searchQuery?.toLowerCase()) || job?.toLowerCase().includes(searchQuery?.toLowerCase()) || false );