Objects
⚠⚠ WIP PAGE ⚠⚠
To check if an object is of a certain type, use istype(x, /type)
which returns a TRUE
or FALSE
value:
/obj/foo
var/x = 1
/proc/foobar(obj/passed)
if (istype(passed, /obj/foo))
var/obj/bar = passed
world << bar.x
You can also cast, (done here in the argument), then implicitly typecheck:
...
/proc/foobar(obj/foo/bar)
if (istype(bar))
world << bar.x