diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 25a8149e48..def9ae59f2 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -190,6 +190,7 @@ /datum/species/proc/create_organs(var/mob/living/carbon/human/H) //Handles creation of mob organs. + H.mob_size = mob_size for(var/obj/item/organ/organ in H.contents) if((organ in H.organs) || (organ in H.internal_organs)) qdel(organ) @@ -249,7 +250,6 @@ H.mob_swap_flags = swap_flags H.mob_push_flags = push_flags H.pass_flags = pass_flags - H.mob_size = mob_size /datum/species/proc/handle_death(var/mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns). return diff --git a/code/modules/mob/mob_grab.dm b/code/modules/mob/mob_grab.dm index dde0cef8b2..e40b14dffd 100644 --- a/code/modules/mob/mob_grab.dm +++ b/code/modules/mob/mob_grab.dm @@ -372,7 +372,7 @@ //returns the number of size categories between affecting and assailant, rounded. Positive means A is larger than B /obj/item/weapon/grab/proc/size_difference(mob/A, mob/B) - return round(log(2, A.mob_size/B.mob_size), 1) + return mob_size_difference(A.mob_size, B.mob_size) /obj/item/weapon/grab var/destroying = 0 diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 22da202ede..2f788862f8 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -5,6 +5,9 @@ return L.mob_size <= MOB_SMALL return 0 +//returns the number of size categories between two mob_sizes, rounded. Positive means A is larger than B +/proc/mob_size_difference(var/mob_size_A, var/mob_size_B) + return round(log(2, mob_size_A/mob_size_B), 1) /proc/istiny(A) if(A && istype(A, /mob/living)) diff --git a/code/modules/organs/organ.dm b/code/modules/organs/organ.dm index 13eef2eaf4..d8533239e7 100644 --- a/code/modules/organs/organ.dm +++ b/code/modules/organs/organ.dm @@ -50,6 +50,7 @@ var/list/organ_cache = list() max_damage = min_broken_damage * 2 if(istype(holder)) src.owner = holder + src.w_class = max(src.w_class + mob_size_difference(holder.mob_size, MOB_MEDIUM), 1) //smaller mobs have smaller organs. species = all_species["Human"] if(holder.dna) dna = holder.dna.Clone() diff --git a/code/modules/organs/subtypes/standard.dm b/code/modules/organs/subtypes/standard.dm index 36fc7ba677..d26193c876 100644 --- a/code/modules/organs/subtypes/standard.dm +++ b/code/modules/organs/subtypes/standard.dm @@ -2,6 +2,8 @@ ORGAN DEFINES ****************************************************/ +//Make sure that w_class is set as if the parent mob was medium sized! This is because w_class is adjusted automatically for mob_size in New() + /obj/item/organ/external/chest name = "upper body" organ_tag = BP_TORSO