Made more sleeps use stoplag

This buffs a few things, but makes them handle lag better and tick at the rate of world.tick_lag without causing lag
This commit is contained in:
MrStonedOne
2016-04-02 22:57:17 -07:00
parent 7827629172
commit 5098a3c884
11 changed files with 12 additions and 10 deletions

View File

@@ -198,7 +198,7 @@ Proc for attack log creation, because really why not
var/starttime = world.time var/starttime = world.time
. = 1 . = 1
while (world.time < endtime) while (world.time < endtime)
sleep(1) stoplag()
if (progress) if (progress)
progbar.update(world.time - starttime) progbar.update(world.time - starttime)
if(!user || !target) if(!user || !target)
@@ -245,7 +245,7 @@ Proc for attack log creation, because really why not
var/starttime = world.time var/starttime = world.time
. = 1 . = 1
while (world.time < endtime) while (world.time < endtime)
sleep(1) stoplag()
if (progress) if (progress)
progbar.update(world.time - starttime) progbar.update(world.time - starttime)

View File

@@ -58,7 +58,7 @@ var/datum/subsystem/minimap/SSminimap
flatten.Insert(minimap, "", SOUTH, 1, 0) flatten.Insert(minimap, "", SOUTH, 1, 0)
del(minimap) del(minimap)
minimap = flatten minimap = flatten
sleep(world.tick_lag) //we have to sleep in order to get byond to clear out the proc's garbage bin stoplag() //we have to sleep in order to get byond to clear out the proc's garbage bin
CHECK_TICK CHECK_TICK

View File

@@ -169,7 +169,7 @@
/datum/browser/alert/proc/wait() /datum/browser/alert/proc/wait()
while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout >= world.time)) while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout >= world.time))
sleep (1) stoplag()
/datum/browser/alert/Topic(href,href_list) /datum/browser/alert/Topic(href,href_list)
if (href_list["close"] || !user || !user.client) if (href_list["close"] || !user || !user.client)

View File

@@ -357,6 +357,7 @@ var/list/blood_splatter_icons = list()
/atom/Stat() /atom/Stat()
. = ..() . = ..()
sleep(1) sleep(1)
stoplag()
//This is called just before maps and objects are initialized, use it to spawn other mobs/objects //This is called just before maps and objects are initialized, use it to spawn other mobs/objects
//effects at world start up without causing runtimes //effects at world start up without causing runtimes

View File

@@ -205,7 +205,7 @@
visible_message("<span class='warning'>[src] lets out a waning screech as violet mist swirls around its dissolving body!</span>") visible_message("<span class='warning'>[src] lets out a waning screech as violet mist swirls around its dissolving body!</span>")
icon_state = "revenant_draining" icon_state = "revenant_draining"
for(var/i = alpha, i > 0, i -= 10) for(var/i = alpha, i > 0, i -= 10)
sleep(0.1) stoplag()
alpha = i alpha = i
visible_message("<span class='danger'>[src]'s body breaks apart into a fine pile of blue dust.</span>") visible_message("<span class='danger'>[src]'s body breaks apart into a fine pile of blue dust.</span>")
var/reforming_essence = essence_regen_cap //retain the gained essence capacity var/reforming_essence = essence_regen_cap //retain the gained essence capacity

View File

@@ -25,7 +25,7 @@
var/step = alpha / frames var/step = alpha / frames
for(var/i = 0, i < frames, i++) for(var/i = 0, i < frames, i++)
alpha -= step alpha -= step
sleep(world.tick_lag) stoplag()
/obj/effect/particle_effect/smoke/New() /obj/effect/particle_effect/smoke/New()
..() ..()

View File

@@ -104,7 +104,7 @@ var/global/list/turf/open/space/space_turfs = list() //i hate everything
L.pulling.loc = T L.pulling.loc = T
//now we're on the new z_level, proceed the space drifting //now we're on the new z_level, proceed the space drifting
sleep(0)//Let a diagonal move finish, if necessary stoplag()//Let a diagonal move finish, if necessary
A.newtonian_move(A.inertia_dir) A.newtonian_move(A.inertia_dir)
/turf/open/space/proc/Sandbox_Spacemove(atom/movable/A) /turf/open/space/proc/Sandbox_Spacemove(atom/movable/A)

View File

@@ -324,6 +324,7 @@ var/next_external_rsc = 0
sleep(1) sleep(1)
else else
sleep(5) sleep(5)
stoplag()
//send resources to the client. It's here in its own proc so we can move it around easiliy if need be //send resources to the client. It's here in its own proc so we can move it around easiliy if need be
/client/proc/send_resources() /client/proc/send_resources()

View File

@@ -1114,7 +1114,7 @@
for(var/obj/machinery/light/L in A) for(var/obj/machinery/light/L in A)
L.on = 1 L.on = 1
L.broken() L.broken()
sleep(1) stoplag()
/obj/machinery/power/apc/proc/shock(mob/user, prb) /obj/machinery/power/apc/proc/shock(mob/user, prb)
if(!prob(prb)) if(!prob(prb))

View File

@@ -73,7 +73,7 @@
if(!curr && active) if(!curr && active)
last.expel(src, loc, dir) last.expel(src, loc, dir)
sleep(1) stoplag()
if(!(count--)) if(!(count--))
active = 0 active = 0
return return

View File

@@ -508,7 +508,7 @@
if(get_dist(get_turf(M),get_turf(src)) > freezerange) //If they lagged/ran past the timestop somehow, just ignore them if(get_dist(get_turf(M),get_turf(src)) > freezerange) //If they lagged/ran past the timestop somehow, just ignore them
unfreeze_mob(M) unfreeze_mob(M)
stopped_atoms -= M stopped_atoms -= M
sleep(1) stoplag()
//End //End
for(var/mob/living/M in stopped_atoms) for(var/mob/living/M in stopped_atoms)