Jump to content

Recommended Posts

Rot's foodtype is "GENERIC", since after AddComponent("edible") in spoiledfood.lua there is no specification.

So you need to make a distinction between prefabs, and not foodtypes.

local function caneattest(inst, food)
	if food.prefab == "spoiled_food" then
		return true
	end
	return false
end

inst.components.eater:SetCanEatTestFn(caneattest)

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...