From fdb407364aa994a55b6dcd5a7e348dba51dd99d2 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Sun, 19 Nov 2023 14:52:16 +0100 Subject: [PATCH] [MIRROR] Hardcore random will not assign incompatible quirks. [MDB IGNORE] (#25111) * Hardcore random will not assign incompatible quirks. (#79825) ## About The Pull Request Fixes #78114. Fixes #78505. Grumble grumble, code rot. #77727 inadvertently broke hardcore random quirk selection, making it not actually check the compatibility of quirks before adding them. This means that quirks that were never meant to go together could be randomly assigned, which broke all kinds of things. I've simply made it properly check for the typepath rather than checking typepaths against names, making it actually function as intended. ## Why It's Good For The Game Certain quirks are incompatible for a reason. Prevents unintended combos that break in unexpected ways. ## Changelog :cl: fix: Hardcore Random will no longer assign incompatible quirks. /:cl: * Hardcore random will not assign incompatible quirks. --------- Co-authored-by: lizardqueenlexi <105025397+lizardqueenlexi@users.noreply.github.com> --- code/modules/mob/dead/new_player/preferences_setup.dm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/dead/new_player/preferences_setup.dm b/code/modules/mob/dead/new_player/preferences_setup.dm index a1c7c0371b0..d1e75d0ab14 100644 --- a/code/modules/mob/dead/new_player/preferences_setup.dm +++ b/code/modules/mob/dead/new_player/preferences_setup.dm @@ -61,8 +61,9 @@ var/list/blacklist = bl if(!(picked_quirk in blacklist)) continue - for(var/iterator_quirk in all_quirks) //Go through all the quirks we've already selected to see if theres a blacklist match - if((iterator_quirk in blacklist) && !(iterator_quirk == picked_quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details) + for(var/quirk_name in all_quirks) //Go through all the quirks we've already selected to see if theres a blacklist match + var/selected_quirk = SSquirks.quirks[quirk_name] + if((selected_quirk in blacklist) && !(selected_quirk == picked_quirk)) //two quirks have lined up in the list of the list of quirks that conflict with each other, so return (see quirks.dm for more details) picked_quirk_blacklisted = TRUE break if(picked_quirk_blacklisted)