I'm a little concerned about this entire proc. Mainly how M is typecaste as mob/living/carbon, but then you do ismob() rather than checking if it is actually the type it is caste as. This could create runtimes either now, or in the future.