ID:269952
 
                    if(dist <= 0 && mode == 1)
world<<"<b><font color = yellow><font size = 3>The submarine has made it back to safe waters!"
for(var/mob/M in world)if(M.client && M.ready)
M.exp+=100
M.Save()
world.Reboot()//I just changed this back actually
//world.Reboot() used to be the same indentation as M.Save() and M.exp+=100


This is the code I was using to give out experience to all players that were connected and have joined the game. In my single-player testing sessions it worked just as expected.

However, I have just noticed that it gives the experience out to one person, and then reboots. I didn't notice this right away because I have a lot of people that play so I figured they didn't have experience because they were new. It had to have worked at one point because other players DID get experience, and I just checked my older versions of this code and it seems to be the same. So I don't know why it isn't working now.
Other than indentation problems and HTML problems, I don't see why it isn't working.

if(dist<=0&&mode==1)
world<<"<font color=yellow size=3><b>The submarine has made it back to safe waters!</b></font>"
for(var/mob/M in world)
if(M.client && M.ready)
M.exp+=100
M.Save()
world.Reboot()
In response to Artemio
Well I pasted it straight from my code, that's why it was already indented. You can't have an if check in the middle of nowhere. I only showed the revelant part that gives out experience. I don't think the spaces in the HTML tags matter on BYOND, but they matter if I was say, making a website.

I will have to test it again. I really wanted to see if there was a better way to do it or if I was doing something I shouldn't.
In response to Justin Knight
Well, what I meant by indentation was that if() after your for(). I'm not quite sure if that'd parse as some form of compression but I'd assumed it didn't, and it doesn't matter on BYOND, but just for future practice.
In response to Artemio
Oh, I didn't even notice what you did to the if statement after the for loop. I'm pretty sure it is a form of compression. Can you have if, else if, and else sequences with a for loop like the one above?
In response to Justin Knight
Yes, I just tested it and it is a form of compression, and to answer your question;
for(var/atom/O) if(world);else if(!world&&!src) del world