ID:2654698
 
(See the best response by Zewaka.)
How can I get icon/icon_state of a turf in a certain position? I need to check on click if a turf in the position src+1,src+1 (src is a turf too) has icon_state x.



Best response
var/turf/T = locate(src.x+1,src.y+1,src.z)
if (T.icon_state == "foo")
do_stuff()
In response to Zewaka
if(T && T.icon_state == "foo")


if(T?.icon_state == "foo")
Thank you! I've just been in BYOND for only 2 days, now i understand how it works :)