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

View File

@@ -58,7 +58,7 @@ var/datum/subsystem/minimap/SSminimap
flatten.Insert(minimap, "", SOUTH, 1, 0)
del(minimap)
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

View File

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

View File

@@ -357,6 +357,7 @@ var/list/blood_splatter_icons = list()
/atom/Stat()
. = ..()
sleep(1)
stoplag()
//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

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>")
icon_state = "revenant_draining"
for(var/i = alpha, i > 0, i -= 10)
sleep(0.1)
stoplag()
alpha = i
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

View File

@@ -25,7 +25,7 @@
var/step = alpha / frames
for(var/i = 0, i < frames, i++)
alpha -= step
sleep(world.tick_lag)
stoplag()
/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
//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)
/turf/open/space/proc/Sandbox_Spacemove(atom/movable/A)

View File

@@ -324,6 +324,7 @@ var/next_external_rsc = 0
sleep(1)
else
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
/client/proc/send_resources()

View File

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

View File

@@ -73,7 +73,7 @@
if(!curr && active)
last.expel(src, loc, dir)
sleep(1)
stoplag()
if(!(count--))
active = 0
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
unfreeze_mob(M)
stopped_atoms -= M
sleep(1)
stoplag()
//End
for(var/mob/living/M in stopped_atoms)