diff --git a/baystation12.dme b/baystation12.dme index 232289dd459..8493df70958 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1221,6 +1221,7 @@ #include "code\modules\mob\living\carbon\human\human_damage.dm" #include "code\modules\mob\living\carbon\human\human_defense.dm" #include "code\modules\mob\living\carbon\human\human_defines.dm" +#include "code\modules\mob\living\carbon\human\human_helpers.dm" #include "code\modules\mob\living\carbon\human\human_movement.dm" #include "code\modules\mob\living\carbon\human\human_organs.dm" #include "code\modules\mob\living\carbon\human\human_powers.dm" diff --git a/code/game/objects/items/weapons/material/kitchen.dm b/code/game/objects/items/weapons/material/kitchen.dm index d0e81e95484..16bea2db1b0 100644 --- a/code/game/objects/items/weapons/material/kitchen.dm +++ b/code/game/objects/items/weapons/material/kitchen.dm @@ -34,6 +34,11 @@ else return ..() + if(ishuman(M)) + var/mob/living/carbon/human/H = M + if(!H.can_eat(src)) + return + if (reagents.total_volume > 0) reagents.trans_to_mob(M, reagents.total_volume, CHEM_INGEST) if(M == user) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm new file mode 100644 index 00000000000..560502dde73 --- /dev/null +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -0,0 +1,11 @@ +/mob/living/carbon/human/proc/can_eat(var/food, var/feedback = 1) + if(!check_has_mouth()) + if(feedback) + src << "Where do you intend to put \the [food]? You don't have a mouth!" + return 0 + var/obj/item/blocked = check_mouth_coverage() + if(blocked) + if(feedback) + src << "\The [blocked] is in the way!" + return 0 + return 1 diff --git a/code/modules/reagents/reagent_containers/food/snacks.dm b/code/modules/reagents/reagent_containers/food/snacks.dm index 8ea8de00896..18b42a15004 100644 --- a/code/modules/reagents/reagent_containers/food/snacks.dm +++ b/code/modules/reagents/reagent_containers/food/snacks.dm @@ -45,12 +45,7 @@ if(M == user) //If you're eating it yourself if(istype(M,/mob/living/carbon/human)) var/mob/living/carbon/human/H = M - if(!H.check_has_mouth()) - user << "Where do you intend to put \the [src]? You don't have a mouth!" - return - var/obj/item/blocked = H.check_mouth_coverage() - if(blocked) - user << "\The [blocked] is in the way!" + if(!H.can_eat(src)) return if (fullness <= 50)