ID:150511
 
My boot verb works sometimes, and doesn't work other times. I can't seem to reproduce the problem when I am testing for it.

The error is

bad index
proc name: boot (/client/proc/boot)
source file: host.dm,135
usr: Shadowdarke (/mob/tank)
src: Shadowdarke (/client)
call stack:
Shadowdarke (/client): boot()

and this is my boot verb. The error line is highlighted.

boot()
set category = "Host"
set desc = "Remove a soldier from the game."
var list/playlist = list()
var/obj/display/M
for(M in players)
if(!M.player) continue
playlist[M.player.key] = M
M = playlist[input("Who do you wish to boot?","Boot") in playlist]
if(M.player == src)
src << "You can not boot yourself."
return
if(M.player)
world << "[src] boots [M.player.key]."
del(M.player)
else
src << "[M] is not a player."

Each client gets a display obj for the scoreboard. display.player is a pointer to the client it belongs to.

If I am selecting a name from playlist and using it as an index in playlist, how can it be a bad index?
Shadowdarke wrote:

If I am selecting a name from playlist and using it as an index in playlist, how can it be a bad index?

This is indeed perplexing. If the input() were possibly returning a numerical value I can see how you might get an error, but it would be an "out of bounds" error, not a "bad index". I take it the error is occuring after the input() returns?

Has this only happened on the dantom hosting, or do you sometimes see this error on your own local tests? Since I haven't been able to reproduce it I'm wondering if it is a recent bug. If you are able to see it on your own, can you put a bunch of debugging info around the source (looping over the list and printing out its contents, etc)?

Thanks for the report. I have managed to isolate the problem, so it will be fixed shortly.

--Dan