Lag cleaning.

Ports and Improvements to help attack lag.
This commit is contained in:
QuoteFox
2020-07-29 23:54:40 +01:00
parent e47f620e89
commit b1d82e4ff5
9 changed files with 73 additions and 57 deletions
+3 -15
View File
@@ -9,7 +9,7 @@
var/turf/pixel_turf // The turf the top_atom appears to over.
var/light_power // Intensity of the emitter light.
var/light_range // The range of the emitted light.
var/light_color // The colour of the light, string, decomposed by parse_light_color()
var/light_color // The colour of the light, string, decomposed by PARSE_LIGHT_COLOR()
// Variables for keeping track of the colour.
var/lum_r
@@ -48,11 +48,10 @@
light_range = source_atom.light_range
light_color = source_atom.light_color
parse_light_color()
PARSE_LIGHT_COLOR(src)
update()
return ..()
/datum/light_source/Destroy(force)
remove_lum()
@@ -99,17 +98,6 @@
/datum/light_source/proc/vis_update()
EFFECT_UPDATE(LIGHTING_VIS_UPDATE)
// Decompile the hexadecimal colour into lumcounts of each perspective.
/datum/light_source/proc/parse_light_color()
if (light_color)
lum_r = GetRedPart (light_color) / 255
lum_g = GetGreenPart (light_color) / 255
lum_b = GetBluePart (light_color) / 255
else
lum_r = 1
lum_g = 1
lum_b = 1
// Macro that applies light to a new corner.
// It is a macro in the interest of speed, yet not having to copy paste it.
// If you're wondering what's with the backslashes, the backslashes cause BYOND to not automatically end the line.
@@ -224,7 +212,7 @@
if (source_atom.light_color != light_color)
light_color = source_atom.light_color
parse_light_color()
PARSE_LIGHT_COLOR(src)
update = TRUE
else if (applied_lum_r != lum_r || applied_lum_g != lum_g || applied_lum_b != lum_b)
+5 -1
View File
@@ -917,6 +917,9 @@
return "[area.name] : [equipment]/[lighting]/[environ] ([lastused_equip+lastused_light+lastused_environ]) : [cell? cell.percent() : "N/C"] ([charging])"
/obj/machinery/power/apc/proc/update()
var/old_light = area.power_light
var/old_equip = area.power_equip
var/old_environ = area.power_environ
if(operating && !shorted && !failure_timer)
area.power_light = (lighting > 1)
area.power_equip = (equipment > 1)
@@ -925,7 +928,8 @@
area.power_light = FALSE
area.power_equip = FALSE
area.power_environ = FALSE
area.power_change()
if(old_light != area.power_light || old_equip != area.power_equip || old_environ != area.power_environ)
area.power_change()
/obj/machinery/power/apc/proc/can_use(mob/user, loud = 0) //used by attack_hand() and Topic()
if(IsAdminGhost(user))