diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index e9e4732bb89..3e78c10ed66 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -4,9 +4,6 @@ update_body_parts() //to update the carbon's new bodyparts appearance register_context() - // Carbons cannot taste anything without a tongue; the tongue organ removes this on Insert - ADD_TRAIT(src, TRAIT_AGEUSIA, NO_TONGUE_TRAIT) - GLOB.carbon_list += src var/static/list/loc_connections = list( COMSIG_CARBON_DISARM_PRESHOVE = PROC_REF(disarm_precollide), diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 707477274ed..ad5cdd3ab2b 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -5,9 +5,8 @@ icon_state = "" //Remove the inherent human icon that is visible on the map editor. We're rendering ourselves limb by limb, having it still be there results in a bug where the basic human icon appears below as south in all directions and generally looks nasty. setup_mood() - - // All start without eyes, and get them via set species - become_blind(NO_EYES) + // This needs to be called very very early in human init (before organs / species are created at the minimum) + setup_organless_effects() create_dna() dna.species.create_fresh_body(src) @@ -41,6 +40,15 @@ return mob_mood = new /datum/mood(src) +/// This proc is for holding effects applied when a mob is missing certain organs +/// It is called very, very early in human init because all humans innately spawn with no organs and gain them during init +/// Gaining said organs removes these effects +/mob/living/carbon/human/proc/setup_organless_effects() + // All start without eyes, and get them via set species + become_blind(NO_EYES) + // Mobs cannot taste anything without a tongue; the tongue organ removes this on Insert + ADD_TRAIT(src, TRAIT_AGEUSIA, NO_TONGUE_TRAIT) + /mob/living/carbon/human/proc/setup_human_dna() //initialize dna. for spawned humans; overwritten by other code randomize_human(src) diff --git a/code/modules/unit_tests/spawn_humans.dm b/code/modules/unit_tests/spawn_humans.dm index 8f4517b36ab..0523f141d25 100644 --- a/code/modules/unit_tests/spawn_humans.dm +++ b/code/modules/unit_tests/spawn_humans.dm @@ -5,3 +5,11 @@ new /mob/living/carbon/human/consistent(pick(locs)) sleep(5 SECONDS) + +/// Tests [/mob/living/carbon/human/proc/setup_organless_effects], specifically that they aren't applied when init is done +/datum/unit_test/human_default_traits + +/datum/unit_test/human_default_traits/Run() + var/mob/living/carbon/human/consistent/dummy = allocate(/mob/living/carbon/human/consistent) + TEST_ASSERT(!HAS_TRAIT_FROM(dummy, TRAIT_AGEUSIA, NO_TONGUE_TRAIT), "Dummy has ageusia on init, when it should've been removed by its default tongue.") + TEST_ASSERT(!dummy.is_blind_from(NO_EYES), "Dummy is blind on init, when it should've been removed by its default eyes.")