Helper for cycling through list.

This commit is contained in:
Segrain
2014-02-03 05:02:18 +03:00
parent 6af8f01cab
commit 54d2a261f3

View File

@@ -142,6 +142,13 @@ proc/listclearnulls(list/list)
return picked
return null
//Returns the next element in parameter list after first appearance of parameter element. If it is the last element of the list or not present in list, returns first element.
/proc/next_in_list(element, list/L)
for(var/i=1, i<L.len, i++)
if(L[i] == element)
return L[i+1]
return L[1]
/*
* Sorting
*/