descrubb
Member
Is there some already-in-place function that could replace this custom method? I couldn't find any in the 2.3 docs...
GML:
///@desc returns the number of times a value appears in an array
///@arg array array to search in
///@arg value value to search for
function array_value_exists( array, value )
{
var length, count
length = array_length(array)
count = 0
for (var i = 0; i < length; i++)
{
if typeof(array[i]) == typeof(value) && array[i] == value
count += 1
}
return count
}