Animal eating bugfix/cleanup (#8420)

This commit is contained in:
Doxxmedearly
2020-03-14 14:37:41 +01:00
committed by GitHub
parent aff8800b0f
commit e7a07e7f8c
3 changed files with 29 additions and 32 deletions
@@ -285,17 +285,20 @@
if (!stat || prob(0.5))
wake_up()
//Eating in tile
for(var/obj/item/reagent_containers/food/snacks/S in src.loc)
if(can_eat() && (nutrition < max_nutrition * 0.3)) //Only when sufficiently hungry
UnarmedAttack(S)
else
break
if(nutrition < max_nutrition / 3 && isturf(loc)) //If we're hungry enough (and not being held/in a bag), we'll check our tile for food.
handle_eating()
/mob/living/simple_animal/proc/handle_supernatural()
if(purge)
purge -= 1
/mob/living/simple_animal/proc/handle_eating()
var/list/food_choices = list()
for(var/obj/item/reagent_containers/food/snacks/S in get_turf(src))
food_choices += S
if(food_choices.len) //Only when sufficiently hungry
UnarmedAttack(pick(food_choices))
//Simple reagent processing for simple animals
//This allows animals to digest food, and only food
//Most drugs, poisons etc, are designed to work on carbons and affect many values a simple animal doesnt have