world/New()
..()
spawn() Repopper()
spawn() Delete()
spawn() DAYNIGHT()
proc/Repopper()
while(world)
sleep(HOUR*2)
world.Repop()
world<<"<b><font color=red>AutoRepop the world has been restored!</b></font>"
proc/Delete()
while(world)
sleep(HOUR*2)
for(var/obj/Grave/G in world) del(G)
for(var/mob/Suiryuudan/S in world) del(S)
for(var/obj/Mirror/M in world) del(M)
for(var/obj/Mist/M2 in world) del(M2)
for(var/obj/projc/Kunai/k in world) del(k)
for(var/obj/projc/Shuriken/ss in world) del(ss)
for(var/obj/projc/Needle/N in world) del(N)
for(var/obj/projc/NoteKunai/NK in world) del(NK)
proc/DAYNIGHT()
while(world)
sleep(HOUR*3)
var/obj/Night/O = new /obj/Night
world<<"<b><font color=red>Night falls over the land covering it in darkness.</b></font>"
for(var/turf/T in world)
if(!T.weatherProof) T.overlays += O
else
if(istype(T,/turf/LAMPZ))
T.overlays -= O
T.icon='turfs.dmi'
T.icon_state="lit"
sleep(HOUR*3)
for(var/turf/T in world)
if(!T.weatherProof) T.overlays -= O
if(istype(T,/turf/LAMPZ))
T.overlays -= O
T.icon='turfs.dmi'
T.icon_state="lamp1"
world<<"<b><font color=yellow>The sun rises above the sky and gleams over and lights up the land.</b></font>"
obj/Night
icon='mist.dmi'
icon_state="night"
layer = MOB_LAYER+52
turf/LAMP/Area
luminosity=6
weatherProof=1
Problem description:
When night system changed over it had a lag spike, but it works, what could i do to prevent or weakin this lag spike?