/mob/player
var/blindspots[][] = new/list(1, 2)
proc/Blindspots()
var/p
var/newy = y
var/newx = x
var/xref = x
var/loops = 0
var/ind = 1
if (dir == SOUTH)
for(p=0, p<6, p++)
newy = newy + 1
blindspots.Add(list(newx, newy))
if (loops)
for(p=0, p<loops, p++)
newx = newx + 1
blindspots.Add(list(newx, newy))
newx = xref
for(p=0, p<loops, p++)
newx = newx - 1
blindspots.Add(list(newx, newy))
newx = xref
loops++
ind++
Here's my code. The intent is to add the evaluated x and y variables to be used as a reference later. However, when I check the list using debug verbs, it's outputting blank lines and empty lists. Is my mistake apparent enough here to explain to me what I should be doing or what I'm doing wrong?
new /list (1, 2)
This makes a list that looks like this (in json notation):
That is, a list with 1 element, which is a list of 2 null elements. Probably not what you wanted.
Calling list.Add(list(x, y)) on the above list results in a list that looks like this:
You may have been expecting the list to be inserted in the list like so:
But according to the DM Reference,
Add proc (list):
You can add a list B as an element of list A with this: