From 8a0ed38a589ec3005c0d6a27ab0dd34a04489d98 Mon Sep 17 00:00:00 2001 From: Ghom <42542238+Ghommie@users.noreply.github.com> Date: Thu, 21 May 2020 19:10:59 +0200 Subject: [PATCH] Fixing a few issues with the nutrition adjustment proc and the circuit printer. (#12320) --- code/datums/components/material_container.dm | 2 +- code/modules/integrated_electronics/passive/power.dm | 6 ++---- code/modules/mob/living/simple_animal/slime/life.dm | 2 +- code/modules/mob/mob.dm | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm index 2f411ff37f..5860bd029b 100644 --- a/code/datums/components/material_container.dm +++ b/code/datums/components/material_container.dm @@ -73,7 +73,7 @@ if(!material_amount) to_chat(user, "[I] does not contain sufficient materials to be accepted by [parent].") return - if(!has_space(material_amount)) + if((!precise_insertion || !GLOB.typecache_stack[I]) && !has_space(material_amount)) to_chat(user, "[parent] has not enough space. Please remove materials from [parent] in order to insert more.") return user_insert(I, user) diff --git a/code/modules/integrated_electronics/passive/power.dm b/code/modules/integrated_electronics/passive/power.dm index 4b6b8723dd..8f9a45ac4d 100644 --- a/code/modules/integrated_electronics/passive/power.dm +++ b/code/modules/integrated_electronics/passive/power.dm @@ -89,7 +89,7 @@ desc = "Produces electricity from chemicals." icon_state = "chemical_cell" extended_desc = "This is effectively an internal beaker. It will consume and produce power from plasma, slime jelly, welding fuel, carbon,\ - ethanol, nutriment, and blood in order of decreasing efficiency. It will consume fuel only if the battery can take more energy." + ethanol, nutriment, and blood in order of decreasing efficiency. It will consume fuel only if the battery can take more energy. But no fuel can be compared with blood of living human." complexity = 4 inputs = list() outputs = list("volume used" = IC_PINTYPE_NUMBER, "self reference" = IC_PINTYPE_SELFREF) @@ -102,10 +102,8 @@ var/lfwb =TRUE /obj/item/integrated_circuit/passive/power/chemical_cell/Initialize() - ..() + . = ..() create_reagents(volume, OPENCONTAINER) - extended_desc +="But no fuel can be compared with blood of living human." - /obj/item/integrated_circuit/passive/power/chemical_cell/interact(mob/user) set_pin_data(IC_OUTPUT, 2, WEAKREF(src)) diff --git a/code/modules/mob/living/simple_animal/slime/life.dm b/code/modules/mob/living/simple_animal/slime/life.dm index 08a5f0a2c9..6e8c79c3d0 100644 --- a/code/modules/mob/living/simple_animal/slime/life.dm +++ b/code/modules/mob/living/simple_animal/slime/life.dm @@ -264,7 +264,7 @@ . = ..() if(!slime_check) return - if(nutrition == max) + if(nutrition >= get_grow_nutrition()) if(powerlevel<10) if(prob(30-powerlevel*2)) powerlevel++ diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 0f92ce7c33..a09749ba04 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1051,7 +1051,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0) ///Adjust the nutrition of a mob /mob/proc/adjust_nutrition(change, max = INFINITY) //Honestly FUCK the oldcoders for putting nutrition on /mob someone else can move it up because holy hell I'd have to fix SO many typechecks - nutrition = clamp(0, nutrition + change, max) + nutrition = clamp(nutrition + change, 0, max) ///Force set the mob nutrition /mob/proc/set_nutrition(var/change) //Seriously fuck you oldcoders.