eastern-flames/eastern flames/scripts/array_contains_within/array_contains_within.gml

12 lines
303 B
Plaintext

function array_contains_within(array, val) {
var i, j;
for (i=0; i<array_length(array); i++) {
if typeof(array[i]) == "struct" {
var dudes = variable_struct_get_names(array[i]);
for (j=0; j<array_length(dudes); j++) {
if array[i][$dudes[j]] == val return true;
}
}
}
return false;
}