proc/startexamfight()
for(var/mob/M in world)
if(M.login)
if(M.atwr==1)
M<<"Wait your turn, soon you can show what are you capable of!"
spawn(15)
M<<"1 minute to start!"
spawn(600)
this
if(!anyfighting)
if(listexam.len>2)
var/mob/A=pick(listexam)
var/mob/B=pick(listexam)
if(A.recentfighter||B.recentfighter)
goto this
M<<"Let's start..."
spawn(20)
M<<"Next fighters will be..."
spawn(30)
M<<"[A] from [A.village] VS [B] from [B.village]!"
spawn(20)
A.loc = locate(/turf/Aposition)
B.loc = locate(/turf/Bposition)
A.dead=0
B.dead=0
M<<"Wait for order to fight!"
spawn(100)
M<<"3"
spawn(10)
M<<"2"
spawn(10)
M<<"1"
spawn(10)
M<<"Fight"
anyfighting=1
if(listexam.len==2)
var/mob/A=pick(listexam)
var/mob/B=pick(listexam)
M<<"Congratulations guys!"
spawn(20)
M<<"You are the finalists..."
spawn(30)
M<<"Both of you now, are the most new Chuunin!"
spawn(20)
A.loc = locate(/turf/Aposition)
B.loc = locate(/turf/Bposition)
A.dead=0
B.dead=0
A.finalist=1
B.finalist=1
bechuunin()
M<<"Who win this fight will get a Second Element, good luck!"
spawn(10)
M<<"Wait for order to fight!"
spawn(100)
M<<"3"
spawn(10)
M<<"2"
spawn(10)
M<<"1"
spawn(10)
M<<"Fight"
anyfighting=1
if(listexam.len==1)
var/mob/A=pick(listexam)
A<<"Congratulations you winned the Exam Chuunin!"
world<<"<b><font size =1><u><font color = red>World News:</u> [A] from [A.village] winned the Exam Chuunin!</font>"
listexam.Remove(A)
A.INEXAM=0
A.finishsecond=0
anyfighting=0
A.Give2ndEle()
while(-1) A.SpawnV()
if(A.rank=="Genin")
bechuunin()
if(A.finalist)
A.finalist=0
A.atwr=0
world << "<b><font size =1><font color = silver>The Chuunin Exam has ended, the next one will be in One Hour!"
spawn() Chuunin()
else
goto this
Problem description: After "spawn(600) this" the game crash, i think that probly is a infinity loop, is really? how i fix?
A quick fix is..
A long term fix is learning loops properly and setting up something that isn't so prone to confusing you.