obj
var
fatt = 8
fill = 1
Food
verb
Give_to(mob/M)
if(M.fishtype)
usr << "You give [M] a [src]."
src.loc = M.loc
M.Eat(src)
else
usr << "[M] is not a fish!"
mob
proc
Eat(mob/Fish/M,obj/Food/F)
if(F.fatt >= 1)
M.fat += F.fill
F.fatt -= 1
M.hunger -= F.fatt
if(M.hunger <= 0)
M.hunger = 0
return
sleep(4)
Eat(M)
else
del(src)
Problem description:
runtime error: Cannot read null.fatt
proc name: Eat (/mob/proc/Eat)
usr: RedlineM203 (/mob/Player)
src: Redline (/mob/Fish/)
call stack:
Redline (/mob/Fish/): Eat(Shark (/obj/Food/Shark), null)
Shark (/obj/Food/Shark): Give to(Redline (/mob/Fish/))
I'm stumped.
The proc you made is a mob proc, so the fish should be the one running the proc. You got that right, with M.Eat(src).
But then in your Eat() proc, its looking for mob/Fish/M and obj/food/F, but all it's getting is the food in place of M. Understand?
Technically, you don't need mob/Fish/M at all, since the fish is running the proc, it makes the fish src. So it would look something like this:
Hope that helps.