I have this simple function that compare actors in an array and returns the desired one.
There’s a simple array of actors. Get the one at ‘index’ (index starts with 0) and set it to ‘temp’, then increment index, get item at new ‘index’, compare the two, if ok set new one to ‘temp’, if not do nothing, then increment ‘index’ and continue.
Ends when array’s length == index (index would be out of bounds, so it means that there are no more actors to try).
There’s a very strange behavior when executing this. I have it binded to W,A,S,D, and each binding produce a different and precise error always related to the highlighted branch (get_item13 failed, get_item6 failed, etc…). I have quadruple-checked thousands of times now, and can’t really figure out what the problem is…