mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
Lag check on initialization (and on a missed del-all proc)
This commit is contained in:
@@ -203,6 +203,7 @@ var/datum/subsystem/air/SSair
|
||||
T.excited = 1
|
||||
active_turfs |= T
|
||||
break
|
||||
CHECK_TICK
|
||||
|
||||
if(active_turfs.len)
|
||||
warning("There are [active_turfs.len] active turfs at roundstart, this is a mapping error caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required)")
|
||||
@@ -214,6 +215,7 @@ var/datum/subsystem/air/SSair
|
||||
if (z_level && AM.z != z_level)
|
||||
continue
|
||||
AM.atmosinit()
|
||||
CHECK_TICK
|
||||
|
||||
//this can't be done with setup_atmos_machinery() because
|
||||
// all atmos machinery has to initalize before the first
|
||||
@@ -223,12 +225,15 @@ var/datum/subsystem/air/SSair
|
||||
if (z_level && AM.z != z_level)
|
||||
continue
|
||||
AM.build_network()
|
||||
CHECK_TICK
|
||||
|
||||
/datum/subsystem/air/proc/setup_template_machinery(list/atmos_machines)
|
||||
for(var/A in atmos_machines)
|
||||
var/obj/machinery/atmospherics/AM = A
|
||||
AM.atmosinit()
|
||||
CHECK_TICK
|
||||
|
||||
for(var/A in atmos_machines)
|
||||
var/obj/machinery/atmospherics/AM = A
|
||||
AM.build_network()
|
||||
CHECK_TICK
|
||||
|
||||
@@ -61,11 +61,13 @@ var/datum/subsystem/lighting/SSlighting
|
||||
if (A.lighting_use_dynamic == DYNAMIC_LIGHTING_IFSTARLIGHT)
|
||||
if (config.starlight)
|
||||
A.SetDynamicLighting()
|
||||
CHECK_TICK
|
||||
|
||||
|
||||
for(var/thing in changed_lights)
|
||||
var/datum/light_source/LS = thing
|
||||
LS.check()
|
||||
CHECK_TICK
|
||||
changed_lights.Cut()
|
||||
|
||||
var/z_start = 1
|
||||
@@ -80,6 +82,7 @@ var/datum/subsystem/lighting/SSlighting
|
||||
for(var/thing in turfs_to_init)
|
||||
var/turf/T = thing
|
||||
T.init_lighting()
|
||||
CHECK_TICK
|
||||
|
||||
if(z_level)
|
||||
//we need to loop through to clear only shifted turfs from the list. or we will cause errors
|
||||
@@ -88,6 +91,7 @@ var/datum/subsystem/lighting/SSlighting
|
||||
if(T.z in z_start to z_finish)
|
||||
continue
|
||||
changed_turfs.Remove(thing)
|
||||
CHECK_TICK
|
||||
else
|
||||
changed_turfs.Cut()
|
||||
|
||||
|
||||
@@ -42,65 +42,69 @@ var/datum/subsystem/minimap/SSminimap
|
||||
var/icon/minimap = new /icon('icons/minimap.dmi')
|
||||
// Scale it up to our target size.
|
||||
minimap.Scale(MINIMAP_SIZE, MINIMAP_SIZE)
|
||||
var/list/obj_icons = list()
|
||||
var/counter = 128
|
||||
|
||||
var/counter = 64
|
||||
// Loop over turfs and generate icons.
|
||||
for(var/T in block(locate(x1, y1, z), locate(x2, y2, z)))
|
||||
|
||||
var/turf/tile = T
|
||||
var/icon/tile_icon
|
||||
var/obj/obj
|
||||
generate_tile(T, minimap)
|
||||
|
||||
// Don't use icons for space, just add objects in space if they exist.
|
||||
if(istype(tile, /turf/space))
|
||||
obj = locate(/obj/structure/lattice/catwalk) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/smooth_structures/catwalk.dmi', "catwalk", SOUTH)
|
||||
obj = locate(/obj/structure/lattice) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/smooth_structures/lattice.dmi', "lattice", SOUTH)
|
||||
obj = locate(/obj/structure/grille) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/structures.dmi', "grille", SOUTH)
|
||||
obj = locate(/obj/structure/transit_tube) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/atmospherics/pipes/transit_tube.dmi', obj.icon_state, obj.dir)
|
||||
else
|
||||
tile_icon = new /icon(tile.icon, tile.icon_state, tile.dir)
|
||||
obj_icons.Cut()
|
||||
|
||||
obj = locate(/obj/structure) in tile
|
||||
if(obj)
|
||||
obj_icons += getFlatIcon(obj)
|
||||
obj = locate(/obj/machinery) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon(obj.icon, obj.icon_state, obj.dir, 1, 0)
|
||||
obj = locate(/obj/structure/window) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon('icons/obj/smooth_structures/window.dmi', "window", SOUTH)
|
||||
|
||||
for(var/I in obj_icons)
|
||||
var/icon/obj_icon = I
|
||||
tile_icon.Blend(obj_icon, ICON_OVERLAY)
|
||||
|
||||
if(tile_icon)
|
||||
// Scale the icon.
|
||||
tile_icon.Scale(TILE_SIZE, TILE_SIZE)
|
||||
// Add the tile to the minimap.
|
||||
minimap.Blend(tile_icon, ICON_OVERLAY, ((tile.x - 1) * TILE_SIZE), ((tile.y - 1) * TILE_SIZE))
|
||||
del(tile_icon)
|
||||
|
||||
//byond bug, this fixes OOM crashes by flattening and reseting the minimap icon holder every 255 tiles
|
||||
//byond bug, this fixes OOM crashes by flattening and reseting the minimap icon holder every 64 tiles
|
||||
counter--
|
||||
if (counter <= 0)
|
||||
counter = 128
|
||||
if(counter <= 0)
|
||||
counter = 64
|
||||
var/icon/flatten = new /icon()
|
||||
flatten.Insert(minimap, "", SOUTH, 1, 0)
|
||||
del(minimap)
|
||||
minimap = flatten
|
||||
sleep(-1)
|
||||
sleep(world.tick_lag) //we have to sleep in order to get byond to clear out the proc's garbage bin
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
|
||||
// Create a new icon and insert the generated minimap, so that BYOND doesn't generate different directions.
|
||||
var/icon/final = new /icon()
|
||||
final.Insert(minimap, "", SOUTH, 1, 0)
|
||||
fcopy(final, map_path(z))
|
||||
|
||||
/datum/subsystem/minimap/proc/generate_tile(turf/tile, icon/minimap)
|
||||
var/icon/tile_icon
|
||||
var/obj/obj
|
||||
var/list/obj_icons = list()
|
||||
// Don't use icons for space, just add objects in space if they exist.
|
||||
if(istype(tile, /turf/space))
|
||||
obj = locate(/obj/structure/lattice/catwalk) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/smooth_structures/catwalk.dmi', "catwalk", SOUTH)
|
||||
obj = locate(/obj/structure/lattice) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/smooth_structures/lattice.dmi', "lattice", SOUTH)
|
||||
obj = locate(/obj/structure/grille) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/structures.dmi', "grille", SOUTH)
|
||||
obj = locate(/obj/structure/transit_tube) in tile
|
||||
if(obj)
|
||||
tile_icon = new /icon('icons/obj/atmospherics/pipes/transit_tube.dmi', obj.icon_state, obj.dir)
|
||||
else
|
||||
tile_icon = new /icon(tile.icon, tile.icon_state, tile.dir)
|
||||
obj_icons.Cut()
|
||||
|
||||
obj = locate(/obj/structure) in tile
|
||||
if(obj)
|
||||
obj_icons += getFlatIcon(obj)
|
||||
obj = locate(/obj/machinery) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon(obj.icon, obj.icon_state, obj.dir, 1, 0)
|
||||
obj = locate(/obj/structure/window) in tile
|
||||
if(obj)
|
||||
obj_icons += new /icon('icons/obj/smooth_structures/window.dmi', "window", SOUTH)
|
||||
|
||||
for(var/I in obj_icons)
|
||||
var/icon/obj_icon = I
|
||||
tile_icon.Blend(obj_icon, ICON_OVERLAY)
|
||||
|
||||
if(tile_icon)
|
||||
// Scale the icon.
|
||||
tile_icon.Scale(TILE_SIZE, TILE_SIZE)
|
||||
// Add the tile to the minimap.
|
||||
minimap.Blend(tile_icon, ICON_OVERLAY, ((tile.x - 1) * TILE_SIZE), ((tile.y - 1) * TILE_SIZE))
|
||||
del(tile_icon)
|
||||
@@ -23,6 +23,7 @@ var/datum/subsystem/objects/SSobj
|
||||
if (zlevel && A.z != zlevel)
|
||||
continue
|
||||
A.initialize()
|
||||
CHECK_TICK
|
||||
. = ..()
|
||||
|
||||
|
||||
|
||||
@@ -212,3 +212,4 @@ var/datum/subsystem/shuttle/SSshuttle
|
||||
S.dwidth = M.dwidth
|
||||
S.dheight = M.dheight
|
||||
moveShuttle(M.id, "[M.roundstart_move]", 0)
|
||||
CHECK_TICK
|
||||
|
||||
Reference in New Issue
Block a user