ID:155821
 
Greetings. I'll jump right to the chase.

I want to change my mob's icon_state when it moves over a certain turf or location (i.e. /turf/water). I don't want it to flick(), I just want the icon_state to change. I'm at a bit of a loss. Here's the flick code I used originally as an example.

water
icon = 'water1.dmi'
density = 0
Entered(usr)
flick("water",usr)
return 1

This'll flick but I want change! I know this is probably some visage of dumb luck but I've tried a bunch of other predefined procs and nothing really comes as close. Any help would be very appreciated. :)
water
icon = 'water1.dmi'
density = 0

Entered(var/mob/M)
if(istype(M))
M.icon_state = "water"
..()

Exited(var/mob/M)
if(istype(M))
M.icon_state=initial(icon_state)
..()


If you need anything explained, feel free to ask. :3
In response to Chowder
That's a big help! Thanks so much.