Wintermute Engine Forum
Wintermute Engine => Scripts, plugins, utilities, goodies => Topic started by: GreyDay on February 01, 2012, 11:16:22 AM
-
I wanted to use a splice function for an Array in a game I am developing, and noticed that it isn't implemented in WME script.
I made a function that worked great for me for the purpose, and as I saw another question on the forum about it I thought that I might upload the piece of code for others to use. Nothing complicated, but nontheless:
function Splice(var array, var place){
//Move the unwanted object in the array to the end.
for (var i = place; i <= array.Length -1; i = i +1)
{
array[i] = array[i + 1];
}
//And pop it.
array.Pop();
}
-
Noticed that i put the thread in the wrong place, could someone move it?
-
Done. Thanks!