Basically, list.len-- is behaving like --list.len when inside the index operators.
mob/Login()
// allocate array
var stuff[10], n
// populate array
for(n in 1 to stuff.len) stuff[n] = n
// "pop from the stack"
for(n in 1 to stuff.len) src << stuff[stuff.len--]
Expected output
10 9 8 7 6 5 4 3 2 1Actual output
runtime error: list index out of bounds proc name: Login (/mob/Login) source file: StackTest.dm,9 usr: (src) src: Kaiochao (/mob) src.loc: null call stack: Kaiochao (/mob): Login()Workaround
Split it into two lines:
src << stuff[stuff.len]
stuff.len--