obj
arrow
icon = 'arrow.dmi'
var/command
var/mob/monsterselected
var/spellchoice
var/cursor_x = 0; var/cursor_y = 0
var/list/menu[0][0]
proc/North()
if(cursor_y > 1)
cursor_y -= 1
else if(cursor_y <= 1)
var/list/L = menu[1]
cursor_y = L.len
screen_loc = menu[cursor_x][cursor_y]
proc/South()
var/list/L = menu[1] // Line 19
if(cursor_y > L.len)
cursor_y += 1
screen_loc = menu[cursor_x][cursor_y]
proc/East()
proc/West()
mob
proc
MakeArrow(mob/player/P,x2,y2)
var/client/C = P.client
var/obj/arrow/arrow = new /obj/arrow
arrow.layer = MOB_LAYER + 2
arrow.screen_loc = "[x2],[y2]"
C.screen += arrow
P.arrows = arrow
P.arrows.command = 0
CommandText(mob/player/P,mob/monsters/M,list/monstergroup)
for(var/obj/O in P.textlist)
del(O)
var/client/C = P.client
for(var/obj/arrow/A in P.client.screen)
del(A)
if(P.arrows)
del(P.arrows)
P.arrows.menu = new/list(1,5)
P.arrows.menu[1][1] = "1,13"
P.arrows.menu[1][2] = "1,12:2"
P.arrows.menu[1][3] = "1,11:5"
P.arrows.menu[1][4] = "1,10:7"
P.arrows.menu[1][5] = "1,9:9"
Problem description:
When I hit client/North() or client/South(), which will redirect to the obj's North/South, I get this runtime:
runtime error: list index out of bounds
proc name: South (/obj/arrow/proc/South)
source file: arrow.dm,19
usr: Polantaris (/mob/player)
src: the arrow (/obj/arrow)
call stack:
the arrow (/obj/arrow): South()
Polantaris (/client): South()
I can't figure out how it's out of bounds, and I'm not in the condition(too tired to think) to really go through it throughly. If anyone can point out the problem please do so. Thanks.
Note: If I turn
var/list/menu[0][0]
into
var/list/menu[][]
I get a "Cannot read from list" runtime instead for the same line.