ID:145145
 
Code:
proc/GameEnd()
var/list/L = list(world)
var/list/final = new
for(var/mob/M in world)
M.locked = 1
for(var/mob/N in L)
for(var/mob/N2 in L)
if(N == N2 || N2 == N)
continue
if(N.y > N2.y)
final += N
if(N2.y > N.y)
final += N2
if(N.y == N2.y)
final += N
final += N2
world << "Winners!"
for(var/mob/T in final)
world << "[T]"


Problem description:
This is supposed to output the person with the highest y position, However it returns nothing but 'Winners!'. How can i fix this?
I don't know if you can do L=list(world), and even if you can, it's probably not the best idea.

Try this:
var/list/L = list()
for(var/mob/M in world)
M.locked = 1
L+=M
In response to Detnom
it still just reports 'Winners', for lack of a smart thing to say, 'bah humbug'
In response to Doom989
*bump* for a hero.
proc/GameEnd()
var/yhighest = 0
var/mob/winner
for(var/mob/M in world)
if(M.y > yhighest)
yhighest = M.y
winner = M
world << winner


Pretty self-explanatory. The only problem is if more than one person is at the highest y co-ordinate.
In response to DeathAwaitsU
Death is the new Jim'll fix it!!

Thanks man!