SortItem()
src.client.screen-=items_list
var/xx=-128
var/yy=65
var/ct=0
var/start=0
if(c_page==1)
start=1
else
start=max(1,(c_page-1)) * re_item_max
var/end = min(start + re_item_max, items_list.len)
m_page=max(1,round(items_list.len/re_item_max))
var/deez=items_list.len%re_item_max
if(deez>0)
while(deez>=0)
deez-=re_item_max
m_page++
for(var/obj/J in items_list.Copy(start,min(items_list.len,end)))
J.screen_loc="CENTER:[xx],CENTER:[yy]"
J.layer=MOB_LAYER+11+EFFECTS_LAYER
src.client.screen+=J
xx+=32
ct++
if(ct==re_item_max)
break
if(ct==3)
yy-=32
xx=-128
ct=0
Problem description:
*IMPORTANT Note* Condition of replying to this post dictates : no lectures. If you're going to attempt to lecture me, please do yourself a favor-don't bother.
I don't need "pointers" on whats "more efficient" or queries about "why are you doing this" and
"WHAT ARE THOSE?"
It's time I won't spend to explain myself(counter productive) and you will just be ignored. Nothing personal.
Moving along-
This proc displays objects in an inventory on screen.

It seemed to be working fine up until a few days ago when I noticed this error:
runtime error: list index out of bounds
proc name: SortItem (/mob/Nin/proc/SortItem)
source file: Items.dm,66
I'm aware of what the error means, and how it should be fixed,I'm just pretty sure I've spent too much time in front of my PC and my brain is fried at the moment.
Line 66 refers to this line:
for(var/obj/J in items_list.Copy(start,min(items_list.len,end)))
Meaning it's not doing what I want it to do--which is only display items start through end.
Ex.
If I have 30 items in my inventory, and I only want to display 10 per page--
this would display the items appropriately, based on the players current page (c_page).
if not that then I'd grab and make a new list with the Copy there to loop through before using for() to check and see if it exists or something.