Texture paths [SOLVED]

Just got back to this.

I think the problem I see (strange effects of bump or glow maps) is being caused by textures being applied in the wrong order.

Basically, the code above does not guarantee what order it will loop through e texturestages in.

Not at my pc right now, so I can’t try solutions (will try later)
But is there a way to make sure the list of stages I get back is always in the same order?