Reduce server freezes during large explosions (#1326)

Moved explosion calculations into a process that processes a queue of explosions with SCHECKs in areas with significant processing.
Significantly reduces server freezes during large explosions, and almost completely nullifies them for small ones.

Likely subtly changes how explosions behave.
This commit is contained in:
Lohikar
2016-12-28 01:16:30 +02:00
committed by skull132
parent 982bf9b1a1
commit 0c59930261
10 changed files with 325 additions and 269 deletions
@@ -1,3 +1,5 @@
var/datum/controller/process/lighting/lighting_process
/datum/controller/process/lighting
var/last_light_count = 0
var/last_overlay_count = 0
@@ -6,6 +8,7 @@
name = "lighting"
schedule_interval = LIGHTING_INTERVAL
create_lighting_overlays()
lighting_process = src
/datum/controller/process/lighting/doWork()
var/list/lighting_update_lights_old = lighting_update_lights //We use a different list so any additions to the update lists during a delay from SCHECK don't cause things to be cut from the list without being updated.