I'm having some trouble calling a mob/proc from within an obj/verb (compiler says proc is undefined). However, the compiler also complains if I try to prototype the proc at the top of the file (duplicate definition!).
I have another generic proc (defined above my mob section)which calls a mob/proc with no problem, so I'm guessing there is really never a need for prototyping.
Anyway, here's the one causing the problem:
obj/tile/verb/place_tile()
set src in usr
src.loc = usr.loc
usr.men_check()
mob/player/proc/men_check()
Any suggestions?
Copyright © 2024 BYOND Software.
All rights reserved.
It looks like the problem is that the compiler doesn't know that usr is of type mob/player . You can change your code around like this:
This is pretty safe, and will always work. But if you don't want all mobs to have men_check (and I don't know if you do or not..), you can try instead:
Which is only safe if you're certain usr will of type player.
-AbyssDragon