Removes some common sources of tick overrun (#6775)

This commit is contained in:
Erki
2019-07-25 22:32:19 +02:00
committed by Werner
parent 066e53111c
commit d3a7634121
4 changed files with 52 additions and 12 deletions
+3 -1
View File
@@ -135,15 +135,17 @@ mob/living/carbon/human/airflow_hit(atom/A)
zone/proc/movables(list/origins)
. = list()
if (!origins || !origins.len)
if (!origins?.len)
return
var/static/list/movables_tcache = typecacheof(list(/obj/effect, /mob/abstract))
var/atom/movable/AM
for (var/testing_turf in contents)
CHECK_TICK
for (var/am in testing_turf)
AM = am
CHECK_TICK
if (AM.simulated && !AM.anchored && !movables_tcache[AM.type])
for (var/source_turf in origins)
if (get_dist(testing_turf, source_turf) <= EDGE_KNOCKDOWN_MAX_DISTANCE)
@@ -108,11 +108,13 @@
. = ""
var/list/variables = list()
for(var/x in D.vars)
CHECK_TICK
if(x in view_variables_hide_vars)
continue
variables += x
variables = sortList(variables)
for(var/x in variables)
CHECK_TICK
. += make_view_variables_var_entry(D, x, D.vars[x])
/proc/make_view_variables_value(value, varname = "*")
@@ -4,6 +4,7 @@
effecttype = "cellcharge"
effect_type = 3
var/last_message
var/is_looping = FALSE
/datum/artifact_effect/cellcharge/DoEffectTouch(var/mob/user)
if(user)
@@ -14,22 +15,50 @@
to_chat(R, "<span class='notice'>SYSTEM ALERT: Large energy boost detected!</span>")
return 1
#define SLEEP_AND_STOP \
if (TICK_CHECK) { \
stoplag(); \
if (QDELETED(src)) { \
return 1; \
} else { \
T = get_turf(holder); \
} \
}
/datum/artifact_effect/cellcharge/DoEffectAura()
set background = 1
if(holder)
if (is_looping)
return 1
is_looping = TRUE
var/turf/T = get_turf(holder)
for (var/obj/machinery/power/apc/C in range(200, T))
for (var/obj/item/weapon/cell/B in C.contents)
B.charge += 25
for (var/obj/machinery/power/smes/S in range (src.effectrange,src))
S.charge += 25
for (var/mob/living/silicon/robot/M in range(50, T))
for (var/obj/item/weapon/cell/D in M.contents)
D.charge += 25
if(world.time - last_message > 200)
to_chat(M, "<span class='notice'>SYSTEM ALERT: Energy boost detected!</span>")
last_message = world.time
for (var/P in range(src.effectrange, T))
SLEEP_AND_STOP
if (istype(P, /obj/machinery/power/apc))
var/obj/machinery/power/apc/apc = P
if (apc.cell)
apc.cell.charge += 25
else if (istype(P, /obj/machinery/power/smes))
var/obj/machinery/power/smes/smes = P
smes.charge += 25
else if (isrobot(P))
var/mob/living/silicon/robot/M = P
if (get_dist(T, M) <= effectrange)
if (M.cell)
M.cell.charge += 25
if(world.time - last_message > 200)
to_chat(M, "<span class='notice'>SYSTEM ALERT: Energy boost detected!</span>")
last_message = world.time
is_looping = FALSE
return 1
#undef SLEEP_AND_STOP
/datum/artifact_effect/cellcharge/DoEffectPulse()
if(holder)
var/turf/T = get_turf(holder)
+7
View File
@@ -0,0 +1,7 @@
author: Skull132
delete-after: True
changes:
- tweak: "Modified the way the cell charge anomaly works. It no longer uses absurd ranges to charge stuff."
- tweak: "ZAS might be a tick slower at kicking objects around for large zones. On the flip side, it shouldn't lag the server as consistently anymore."
- tweak: "VV might take a bit to generate the VV screen for large entries."