ID:2112970
 
(See the best response by Kaiochao.)
Hello, it's me again. Now i was porting something like water, bit screwed up again. The problem is that mx and my just don't change. Can you point, where i have errors?

Code:
obj/emmiter
name = "emmiter"
icon = 'turf.dmi'
icon_state = "emmiter"
var/size = 8

var/list/posx
var/list/posy


obj/emmiter/New()

posx = new/list()
posy = new/list()
posx.Add(x)
posy.Add(y)

obj/emmiter/verb/activate()
set src in view()
var/mx = posx[1]
var/my = posy[1]
while(size > 0)
world << "cycle"
if(posx.len == 0)
break
mx = posx[1]
my = posy[1]
new /turf/water(locate(mx,my,z))
size -= 1

posx.Add(mx-1)
posy.Add(my)

posx.Add(mx+1)
posy.Add(my)

posx.Add(mx)
posy.Add(my+1)

posx.Add(mx)
posy.Add(my-1)

posx.Remove(posx[1])
posy.Remove(posy[1])


Thank you.

Best response
        posx.Remove(posx[1])
posy.Remove(posy[1])

You're trying to remove the first index, right? But what you're actually doing is removing some instance of the value, from the end, e.g.
var a[] = list(1, 2, 1, 3, 1)
a -= 1
// a == list(1, 2, 1, 3)
// what you want: a == list(2, 1, 3, 1)


You're better off using list.Cut():
posx.Cut(1, 2)
posy.Cut(1, 2)
My bad, everything works. Thank you.