There's an inwater flag on mobs, used for the ruleset of Watermaps, not sure those are mapped out but there's essentially a bunch of checks to verify this, but I think until pathing is done on the zone it doesn't quite work right? Could be wrong.. but assuming this check is properly done it'd be as easy as adding to mob.h some form of inline bool InWater() const { return inWater; } and then you should be able to call $mob->InWater() to get a TRUE/FALSE Return of it being there or not.
Also with your code the mob i don't think would immediately return to his home point? He may stand there out of water, and then eventually decide to return... better than chasing you out!
|