Skip to content

Commit

Permalink
ports (#4735)
Browse files Browse the repository at this point in the history
discordia-space/CEV-Eris#8060
Ports the above, fixes an issue with aheal.
  • Loading branch information
cdb-is-not-good authored Aug 5, 2023
1 parent 4572a9a commit 9c64c31
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
4 changes: 0 additions & 4 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -915,10 +915,6 @@ var/list/rank_prefix = list(\
vessel.add_reagent("blood",species.blood_volume-vessel.total_volume)
fixblood()

// Fix up all organs.
// This will ignore any prosthetics in the prefs currently.
rebuild_organs()

if(!client || !key) //Don't boot out anyone already in the mob.
for(var/obj/item/organ/internal/brain/H in world)
if(H.brainmob)
Expand Down
24 changes: 24 additions & 0 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,30 @@
/mob/living/carbon/human/rejuvenate()
sanity.setLevel(sanity.max_level)
restore_blood()

// If a limb was missing, regrow
if(LAZYLEN(organs) < 7)
var/list/tags_to_grow = list(BP_HEAD, BP_CHEST, BP_GROIN, BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG)
var/upper_body_nature

for(var/obj/item/organ/external/E in organs)
if(!E.is_stump())
tags_to_grow -= E.organ_tag
if(E.organ_tag == BP_CHEST)
upper_body_nature = E.nature
else
qdel(E) // Will regrow

var/datum/preferences/user_pref = client ? client.prefs : null

for(var/tag in tags_to_grow)
// FBP limbs get replaced with makeshift if not defined by user or clientless
var/datum/body_modification/BM = user_pref ? user_pref.get_modification(tag) : (upper_body_nature == MODIFICATION_ORGANIC) ? new /datum/body_modification/none : new /datum/body_modification/limb/prosthesis
var/datum/organ_description/OD = species.has_limbs[tag]
if(BM.is_allowed(tag, user_pref, src))
BM.create_organ(src, OD, user_pref.modifications_colors[tag])
else
OD.create_organ(src)
..()

/mob/living/carbon/human/handle_vision()
Expand Down
3 changes: 1 addition & 2 deletions code/modules/organs/internal/_internal.dm
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,9 @@
return mod_data

/obj/item/organ/internal/rejuvenate()
refresh_organ_stats()
status = null
for(var/datum/component/comp as anything in GetComponents(/datum/component))
istype(comp, /datum/component/internal_wound) ? remove_wound(comp) : qdel(comp)
apply_modifiers()

// Organ eating
/obj/item/organ/internal/proc/prepare_eat()
Expand Down

0 comments on commit 9c64c31

Please sign in to comment.