It checks whether the supplied instance id is an instance of the specified object or is a child of it.
It should allow easier type-checking... I couldn't find something like this in forum, so I just wrote it.
Feel free to use it, no credit needed
GMVersion: any(?)
Pro-only? No
/*
boolean instanceof(instance_id inst, object_index ind)
returns whether inst is an instance of ind
######################################################
# PLEASE NOTE: inst must be the *id of an instance,* #
# ind must be the *index of an object* #
######################################################
by Karahs
*/
var inst, ind, indx;
inst = argument0;
ind = argument1;
indx = inst.object_index;
if(ind == indx) return true;
while(indx > 0){
indx = object_get_parent(indx);
if(ind == indx) return true;
}
return false;











