mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Fixes init on various things, as well as allowing the
map loader to safely load templates mid-run
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
"a" = (/turf/simulated/floor/plasteel{icon_state = "chapel"},/area/template_noop)
|
||||
(1,1,1) = {"
|
||||
a
|
||||
"}
|
||||
@@ -234,6 +234,7 @@
|
||||
|
||||
body += "<option value='?_src_=vars;mark_object=\ref[D]'>Mark Object</option>"
|
||||
body += "<option value='?_src_=vars;proc_call=\ref[D]'>Call Proc</option>"
|
||||
body += "<option value='?_src_=vars;jump_to=\ref[D]'>Jump to Object</option>"
|
||||
if(ismob(D))
|
||||
body += "<option value='?_src_=vars;mob_player_panel=\ref[D]'>Show player panel</option>"
|
||||
|
||||
@@ -394,11 +395,7 @@ body
|
||||
html += "<ul>"
|
||||
var/index = 1
|
||||
for (var/entry in L)
|
||||
if(istext(entry))
|
||||
html += debug_variable(entry, L[entry], level + 1)
|
||||
//html += debug_variable("[index]", L[index], level + 1)
|
||||
else
|
||||
html += debug_variable(index, L[index], level + 1)
|
||||
html += debug_variable(index, L[index], level + 1)
|
||||
index++
|
||||
html += "</ul>"
|
||||
|
||||
@@ -736,6 +733,17 @@ body
|
||||
if(T)
|
||||
callproc_datum(T)
|
||||
|
||||
else if(href_list["jump_to"])
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
var/atom/A = locate(href_list["jump_to"])
|
||||
var/turf/T = get_turf(A)
|
||||
if(T)
|
||||
usr.client.jumptoturf(T)
|
||||
href_list["datumrefresh"] = href_list["jump_to"]
|
||||
|
||||
|
||||
else if(href_list["rotatedatum"])
|
||||
if(!check_rights(R_DEBUG|R_ADMIN)) return
|
||||
|
||||
@@ -1080,4 +1088,3 @@ body
|
||||
src.debug_variables(DAT)
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
|
||||
|
||||
/area/New()
|
||||
|
||||
..()
|
||||
icon_state = ""
|
||||
layer = 10
|
||||
uid = ++global_uid
|
||||
@@ -34,14 +36,11 @@
|
||||
// lighting_state = 4
|
||||
//has_gravity = 0 // Space has gravity. Because.. because.
|
||||
|
||||
if(!requires_power)
|
||||
if(requires_power != 0)
|
||||
power_light = 0 //rastaf0
|
||||
power_equip = 0 //rastaf0
|
||||
power_environ = 0 //rastaf0
|
||||
|
||||
..()
|
||||
|
||||
// spawn(15)
|
||||
power_change() // all machines set to current power level, also updates lighting icon
|
||||
|
||||
/area/proc/get_cameras()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
// If you're wondering what goofery this is, this is for things that need the environment
|
||||
// around them set up - like `air_update_turf` and the like
|
||||
if(auto_init && (ticker && ticker.current_state == GAME_STATE_PLAYING))
|
||||
if((ticker && ticker.current_state == GAME_STATE_PLAYING))
|
||||
attempt_init()
|
||||
|
||||
/atom/movable/Destroy()
|
||||
@@ -46,7 +46,7 @@
|
||||
var/turf/T = get_turf(src)
|
||||
if (T && zlevels.is_zlevel_dirty(T.z))
|
||||
zlevels.postpone_init(T.z, src)
|
||||
else
|
||||
else if(auto_init)
|
||||
initialize()
|
||||
|
||||
/atom/movable/proc/initialize()
|
||||
|
||||
@@ -225,6 +225,7 @@
|
||||
air_alarm_repository.update_cache(src)
|
||||
|
||||
/obj/machinery/alarm/initialize()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
if (!master_is_operating())
|
||||
elect_master()
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/meter/initialize()
|
||||
..()
|
||||
if (!target)
|
||||
target = locate(/obj/machinery/atmospherics/pipe) in loc
|
||||
|
||||
@@ -153,4 +154,4 @@
|
||||
<ul>
|
||||
<li><b>Frequency:</b> <a href="?src=\ref[src];set_freq=-1">[format_frequency(frequency)] GHz</a> (<a href="?src=\ref[src];set_freq=[initial(frequency)]">Reset</a>)</li>
|
||||
<li>[format_tag("ID Tag","id_tag")]</li>
|
||||
</ul>"}
|
||||
</ul>"}
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
efficiency = C
|
||||
|
||||
/obj/machinery/atmospherics/unary/cryo_cell/initialize()
|
||||
..()
|
||||
if(node) return
|
||||
for(var/cdir in cardinal)
|
||||
node = findConnecting(cdir)
|
||||
@@ -495,4 +496,4 @@
|
||||
return
|
||||
|
||||
/datum/data/function/proc/display()
|
||||
return
|
||||
return
|
||||
|
||||
@@ -135,6 +135,7 @@ obj/machinery/door/airlock/proc/set_frequency(new_frequency)
|
||||
|
||||
|
||||
obj/machinery/door/airlock/initialize()
|
||||
..()
|
||||
if(frequency)
|
||||
set_frequency(frequency)
|
||||
|
||||
@@ -294,4 +295,4 @@ obj/machinery/access_button/airlock_interior
|
||||
|
||||
obj/machinery/access_button/airlock_exterior
|
||||
frequency = 1379
|
||||
command = "cycle_exterior"
|
||||
command = "cycle_exterior"
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
var/dye_color = "#FFFFFF"
|
||||
|
||||
/obj/machinery/dye_generator/initialize()
|
||||
..()
|
||||
power_change()
|
||||
|
||||
/obj/machinery/dye_generator/power_change()
|
||||
@@ -127,4 +128,4 @@
|
||||
var/b_skin = hex2num(copytext(dye_color, 6, 8))
|
||||
if(H.change_skin_color(r_skin, g_skin, b_skin))
|
||||
H.update_dna()
|
||||
user.visible_message("<span class='notice'>[user] finishes dying [M]'s [what_to_dye]!</span>", "<span class='notice'>You finish dying [M]'s [what_to_dye]!</span>")
|
||||
user.visible_message("<span class='notice'>[user] finishes dying [M]'s [what_to_dye]!</span>", "<span class='notice'>You finish dying [M]'s [what_to_dye]!</span>")
|
||||
|
||||
@@ -27,8 +27,8 @@
|
||||
src.updateDialog()
|
||||
|
||||
/obj/machinery/embedded_controller/attack_ghost(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
src.ui_interact(user)
|
||||
|
||||
/obj/machinery/embedded_controller/attack_ai(mob/user as mob)
|
||||
src.ui_interact(user)
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
unacidable = 1
|
||||
|
||||
/obj/machinery/embedded_controller/radio/initialize()
|
||||
..()
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/machinery/embedded_controller/radio/update_icon()
|
||||
@@ -77,4 +78,4 @@
|
||||
/obj/machinery/embedded_controller/radio/proc/set_frequency(new_frequency)
|
||||
radio_controller.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = radio_controller.add_object(src, frequency, radio_filter)
|
||||
radio_connection = radio_controller.add_object(src, frequency, radio_filter)
|
||||
|
||||
@@ -119,7 +119,8 @@ Class Procs:
|
||||
|
||||
/obj/machinery/initialize()
|
||||
addAtProcessing()
|
||||
return ..()
|
||||
. = ..()
|
||||
power_change()
|
||||
|
||||
/obj/machinery/proc/addAtProcessing()
|
||||
if (use_power)
|
||||
|
||||
@@ -145,6 +145,7 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
listening_level = position.z
|
||||
|
||||
/obj/machinery/telecomms/initialize()
|
||||
..()
|
||||
if(autolinkers.len)
|
||||
// Links nearby machines
|
||||
if(!long_range_link)
|
||||
@@ -584,10 +585,3 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
|
||||
var/name = "data packet (#)"
|
||||
var/garbage_collector = 1 // if set to 0, will not be garbage collected
|
||||
var/input_type = "Speech File"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
return
|
||||
|
||||
/obj/machinery/computer/teleporter/initialize()
|
||||
..()
|
||||
link_power_station()
|
||||
update_icon()
|
||||
|
||||
@@ -294,6 +295,7 @@
|
||||
RefreshParts()
|
||||
|
||||
/obj/machinery/teleport/hub/initialize()
|
||||
..()
|
||||
link_power_station()
|
||||
|
||||
/obj/machinery/teleport/hub/Destroy()
|
||||
@@ -472,6 +474,7 @@
|
||||
link_console_and_hub()
|
||||
|
||||
/obj/machinery/teleport/station/initialize()
|
||||
..()
|
||||
link_console_and_hub()
|
||||
|
||||
/obj/machinery/teleport/station/RefreshParts()
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/turretid/initialize()
|
||||
..()
|
||||
if(!control_area)
|
||||
control_area = get_area(src)
|
||||
else if(istext(control_area))
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
/obj/effect/landmark/New()
|
||||
|
||||
..()
|
||||
tag = text("landmark*[]", name)
|
||||
set_tag()
|
||||
invisibility = 101
|
||||
|
||||
switch(name) //some of these are probably obsolete
|
||||
@@ -105,18 +105,19 @@
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL_NOW
|
||||
|
||||
/obj/effect/landmark/proc/set_tag()
|
||||
tag = text("landmark*[]", name)
|
||||
|
||||
|
||||
/obj/effect/landmark/start
|
||||
name = "start"
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
icon_state = "x"
|
||||
anchored = 1.0
|
||||
|
||||
/obj/effect/landmark/start/New()
|
||||
..()
|
||||
/obj/effect/landmark/start/set_tag()
|
||||
tag = "start*[name]"
|
||||
invisibility = 101
|
||||
|
||||
return 1
|
||||
|
||||
//Costume spawner landmarks
|
||||
|
||||
@@ -260,4 +261,4 @@
|
||||
/obj/effect/landmark/costume/sexymime/New()
|
||||
new /obj/item/clothing/mask/gas/sexymime(src.loc)
|
||||
new /obj/item/clothing/under/sexymime(src.loc)
|
||||
qdel(src)
|
||||
qdel(src)
|
||||
|
||||
@@ -129,16 +129,17 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
|
||||
/turf/simulated/floor/proc/make_plating()
|
||||
return ChangeTurf(/turf/simulated/floor/plating)
|
||||
|
||||
/turf/simulated/floor/ChangeTurf(turf/simulated/floor/T)
|
||||
/turf/simulated/floor/ChangeTurf(turf/simulated/floor/T, defer_change = FALSE, keep_icon = TRUE)
|
||||
if(!istype(src,/turf/simulated/floor)) return ..() //fucking turfs switch the fucking src of the fucking running procs
|
||||
if(!ispath(T,/turf/simulated/floor)) return ..()
|
||||
var/old_icon = icon_regular_floor
|
||||
var/old_plating = icon_plating
|
||||
var/old_dir = dir
|
||||
var/turf/simulated/floor/W = ..()
|
||||
W.icon_regular_floor = old_icon
|
||||
W.icon_plating = old_plating
|
||||
W.dir = old_dir
|
||||
if(keep_icon)
|
||||
W.icon_regular_floor = old_icon
|
||||
W.icon_plating = old_plating
|
||||
W.dir = old_dir
|
||||
W.update_icon()
|
||||
return W
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
qdel(L)
|
||||
|
||||
//Creates a new turf
|
||||
/turf/proc/ChangeTurf(path, defer_change = FALSE)
|
||||
/turf/proc/ChangeTurf(path, defer_change = FALSE, keep_icon = TRUE)
|
||||
if(!path)
|
||||
return
|
||||
if(!use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed
|
||||
@@ -169,7 +169,6 @@
|
||||
|
||||
if(air_master)
|
||||
air_master.remove_from_active(src)
|
||||
|
||||
var/turf/W = new path(src)
|
||||
if(!defer_change)
|
||||
W.AfterChange()
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
qdel(I)
|
||||
|
||||
/obj/effect/buildmode_line
|
||||
var/image/I
|
||||
var/image/I
|
||||
var/client/cl
|
||||
|
||||
/obj/effect/buildmode_line/New(var/client/c, var/atom/atom_a, var/atom/atom_b, var/linename)
|
||||
@@ -101,13 +101,13 @@
|
||||
I = image('icons/misc/mark.dmi', src, "line", 19.0)
|
||||
var/x_offset = ((atom_b.x * 32) + atom_b.pixel_x) - ((atom_a.x * 32) + atom_a.pixel_x)
|
||||
var/y_offset = ((atom_b.y * 32) + atom_b.pixel_y) - ((atom_a.y * 32) + atom_a.pixel_y)
|
||||
|
||||
|
||||
var/matrix/M = matrix()
|
||||
M.Translate(0, 16)
|
||||
M.Scale(1, sqrt((x_offset * x_offset) + (y_offset * y_offset)) / 32)
|
||||
M.Turn(90 - Atan2(x_offset, y_offset)) // So... You pass coords in order x,y to this version of atan2. It should be called acsc2.
|
||||
M.Translate(atom_a.pixel_x, atom_a.pixel_y)
|
||||
|
||||
|
||||
transform = M
|
||||
cl = c
|
||||
cl.images += I
|
||||
@@ -242,6 +242,7 @@
|
||||
if(FILL_BUILDMODE)
|
||||
to_chat(user, "<span class='notice'>***********************************************************</span>")
|
||||
to_chat(user, "<span class='notice'>Left Mouse Button on turf/obj/mob = Select corner</span>")
|
||||
to_chat(user, "<span class='notice'>Left Mouse Button + Alt on turf/obj/mob = Delete region</span>")
|
||||
to_chat(user, "<span class='notice'>Right Mouse Button on buildmode button = Select object type</span>")
|
||||
to_chat(user, "<span class='notice'>***********************************************************</span>")
|
||||
if(LINK_BUILDMODE)
|
||||
@@ -509,16 +510,20 @@
|
||||
cornerB = select_tile(get_turf(object))
|
||||
if(left_click) //rectangular
|
||||
if(cornerA && cornerB)
|
||||
if(!objholder)
|
||||
to_chat(user, "<span class='warning'>Select object type first.</span>")
|
||||
if(alt_click)
|
||||
empty_region(block(get_turf(cornerA),get_turf(cornerB)))
|
||||
deselect_region()
|
||||
else
|
||||
for(var/turf/T in block(get_turf(cornerA),get_turf(cornerB)))
|
||||
if(ispath(objholder,/turf))
|
||||
T.ChangeTurf(objholder)
|
||||
else
|
||||
var/obj/A = new objholder(T)
|
||||
A.dir = build_dir
|
||||
deselect_region()
|
||||
if(!objholder)
|
||||
to_chat(user, "<span class='warning'>Select object type first.</span>")
|
||||
else
|
||||
for(var/turf/T in block(get_turf(cornerA),get_turf(cornerB)))
|
||||
if(ispath(objholder,/turf))
|
||||
T.ChangeTurf(objholder)
|
||||
else
|
||||
var/obj/A = new objholder(T)
|
||||
A.dir = build_dir
|
||||
deselect_region()
|
||||
return
|
||||
|
||||
//Something wrong - Reset
|
||||
@@ -567,13 +572,13 @@
|
||||
if(P.id_tag && P.id_tag != 1 && alert(holder, "Warning: This will unlink something else from the door. Continue?", "Buildmode", "Yes", "No") == "No")
|
||||
goto(line_jump)
|
||||
P.id_tag = M.id
|
||||
|
||||
|
||||
line_jump // For the goto
|
||||
valid_links = 0
|
||||
for(var/obj/effect/buildmode_line/L in link_lines)
|
||||
qdel(L)
|
||||
link_lines -= L
|
||||
|
||||
|
||||
if(istype(link_obj, /obj/machinery/door_control))
|
||||
var/obj/machinery/door_control/M = link_obj
|
||||
for(var/obj/machinery/door/airlock/P in range(M.range,M))
|
||||
|
||||
@@ -24,6 +24,9 @@
|
||||
if(template)
|
||||
load(template)
|
||||
|
||||
/obj/effect/landmark/map_loader/set_tag()
|
||||
return
|
||||
|
||||
/obj/effect/landmark/map_loader/proc/load(datum/map_template/t)
|
||||
if(!t)
|
||||
return
|
||||
|
||||
@@ -91,11 +91,12 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
var/ycrd = text2num(dmmRegex.group[4]) + y_offset - 1
|
||||
var/zcrd = text2num(dmmRegex.group[5]) + z_offset - 1
|
||||
|
||||
if(zcrd > world.maxz)
|
||||
if(cropMap)
|
||||
continue
|
||||
else
|
||||
zlevels.increase_max_zlevel_to(zcrd) //create a new z_level if needed
|
||||
if(!measureOnly)
|
||||
if(zcrd > world.maxz)
|
||||
if(cropMap)
|
||||
continue
|
||||
else
|
||||
zlevels.increase_max_zlevel_to(zcrd) //create a new z_level if needed
|
||||
|
||||
bounds[MAP_MINX] = min(bounds[MAP_MINX], xcrdStart)
|
||||
bounds[MAP_MINZ] = min(bounds[MAP_MINZ], zcrd)
|
||||
@@ -259,6 +260,8 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
|
||||
//first instance the /area and remove it from the members list
|
||||
index = members.len
|
||||
|
||||
var/turf/crds = locate(xcrd,ycrd,zcrd)
|
||||
if(members[index] != /area/template_noop)
|
||||
// We assume `members[index]` is an area path, as above, yes? I will operate
|
||||
// on that assumption.
|
||||
@@ -269,7 +272,6 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
_preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation
|
||||
instance = LM.area_path_to_real_area(members[index])
|
||||
|
||||
var/turf/crds = locate(xcrd,ycrd,zcrd)
|
||||
if(crds)
|
||||
instance.contents.Add(crds)
|
||||
|
||||
@@ -317,7 +319,7 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
var/turf/T = locate(x,y,z)
|
||||
if(T)
|
||||
if(ispath(path, /turf))
|
||||
T.ChangeTurf(path, 1)
|
||||
T.ChangeTurf(path, 1, 0)
|
||||
instance = T
|
||||
else if(ispath(path, /area))
|
||||
|
||||
|
||||
@@ -80,11 +80,11 @@
|
||||
var/datum/map_template/M = safepick(dir == NORTH ? north_room_templates : south_room_templates)
|
||||
if(M)
|
||||
template = M
|
||||
load(M)
|
||||
if(dir == NORTH)
|
||||
north_room_templates -= M
|
||||
else
|
||||
south_room_templates -= M
|
||||
load(M)
|
||||
|
||||
// The door to a hotel room, but also metadata for the room itself
|
||||
/obj/machinery/door/unpowered/hotel_door
|
||||
|
||||
@@ -35,6 +35,19 @@ var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away
|
||||
log_debug("\tTook [stop_watch(subtimer)]s")
|
||||
log_debug("Late setup finished - took [stop_watch(total_timer)]s")
|
||||
|
||||
/proc/empty_rect(low_x,low_y, hi_x,hi_y, z)
|
||||
var/timer = start_watch()
|
||||
log_debug("Emptying region: ([low_x], [low_y]) to ([hi_x], [hi_y]) on z '[z]'")
|
||||
empty_region(block(locate(low_x, low_y, z), locate(hi_x, hi_y, z)))
|
||||
log_debug("Took [stop_watch(timer)]s")
|
||||
|
||||
/proc/empty_region(list/turfs)
|
||||
for(var/thing in turfs)
|
||||
var/turf/T = thing
|
||||
for(var/otherthing in T)
|
||||
qdel(otherthing)
|
||||
T.ChangeTurf(/turf/space)
|
||||
|
||||
/proc/createRandomZlevel()
|
||||
if(awaydestinations.len) //crude, but it saves another var!
|
||||
return
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
/obj/effect/levelref/New()
|
||||
..()
|
||||
levels += src
|
||||
|
||||
/obj/effect/levelref/initialize()
|
||||
..()
|
||||
for(var/obj/effect/levelref/O in levels)
|
||||
if(id == O.id && O != src)
|
||||
other = O
|
||||
@@ -104,7 +107,7 @@
|
||||
/turf/unsimulated/floor/upperlevel/New()
|
||||
..()
|
||||
var/obj/effect/levelref/R = locate() in get_area(src)
|
||||
if(R)
|
||||
if(R && R.other)
|
||||
init(R)
|
||||
|
||||
/turf/unsimulated/floor/upperlevel/Destroy()
|
||||
@@ -159,6 +162,8 @@
|
||||
..()
|
||||
portals += src
|
||||
|
||||
/obj/effect/view_portal/initialize()
|
||||
..()
|
||||
if(id)
|
||||
for(var/obj/effect/view_portal/O in portals)
|
||||
if(id == O.id && O != src && can_link(O))
|
||||
@@ -361,4 +366,4 @@
|
||||
screen_loc = "CENTER[ox >= 0 ? "+" : ""][ox],CENTER[oy >= 0 ? "+" : ""][oy]"
|
||||
|
||||
/obj/effect/view_portal_dummy/attack_ghost(mob/user)
|
||||
owner.attack_ghost(user)
|
||||
owner.attack_ghost(user)
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
/obj/item/weapon/storage/bible)
|
||||
|
||||
/obj/structure/bookcase/initialize()
|
||||
..()
|
||||
for(var/obj/item/I in loc)
|
||||
if(is_type_in_list(I, valid_types))
|
||||
I.forceMove(src)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
var/on=0
|
||||
|
||||
/obj/machinery/media/receiver/boombox/initialize()
|
||||
..()
|
||||
if(on)
|
||||
update_on()
|
||||
update_icon()
|
||||
@@ -80,4 +81,4 @@
|
||||
if(on)
|
||||
icon_state="wallradio-p"
|
||||
else
|
||||
icon_state="wallradio"
|
||||
icon_state="wallradio"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
var/const/MAX_TEMP=70 // Celsius
|
||||
|
||||
/obj/machinery/media/transmitter/broadcast/initialize()
|
||||
..()
|
||||
testing("[type]/initialize() called!")
|
||||
if(autolink && autolink.len)
|
||||
for(var/obj/machinery/media/source in orange(20, src))
|
||||
|
||||
@@ -82,6 +82,7 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
//
|
||||
|
||||
/obj/machinery/gravity_generator/main/station/initialize()
|
||||
..()
|
||||
setup_parts()
|
||||
middle.overlays += "activated"
|
||||
update_list()
|
||||
@@ -215,17 +216,17 @@ var/const/GRAV_NEEDS_WRENCH = 3
|
||||
/obj/machinery/gravity_generator/main/attack_hand(mob/user as mob)
|
||||
if(!..())
|
||||
return interact(user)
|
||||
|
||||
|
||||
/obj/machinery/gravity_generator/main/attack_ai(mob/user as mob)
|
||||
return 1
|
||||
|
||||
|
||||
/obj/machinery/gravity_generator/main/attack_ghost(mob/user as mob)
|
||||
return interact(user)
|
||||
|
||||
/obj/machinery/gravity_generator/main/interact(mob/user as mob)
|
||||
if(stat & BROKEN)
|
||||
return
|
||||
|
||||
|
||||
var/dat = "Gravity Generator Breaker: "
|
||||
if(breaker)
|
||||
dat += "<span class='linkOn'>ON</span> <A href='?src=\ref[src];gentoggle=1'>OFF</A>"
|
||||
|
||||
@@ -138,6 +138,7 @@
|
||||
var/redeem_immediately = 0 // redeem immediately for holding cell
|
||||
|
||||
/obj/machinery/treadmill_monitor/initialize()
|
||||
..()
|
||||
if(id)
|
||||
for(var/obj/machinery/power/treadmill/T in machines)
|
||||
if(T.id == id)
|
||||
@@ -222,4 +223,4 @@
|
||||
#undef FONT_SIZE
|
||||
#undef FONT_COLOR
|
||||
#undef FONT_STYLE
|
||||
#undef CHARS_PER_LINE
|
||||
#undef CHARS_PER_LINE
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
var/dirt_count = 0
|
||||
var/zpos
|
||||
var/list/init_list = list()
|
||||
var/list/pipes = list()
|
||||
var/list/cables = list()
|
||||
|
||||
/datum/zlevel/New(z)
|
||||
zpos = z
|
||||
@@ -14,21 +12,35 @@
|
||||
throw EXCEPTION("Init told to resume when z-level still dirty. Z level: '[zpos]'")
|
||||
log_debug("Releasing freeze on z-level '[zpos]'!")
|
||||
log_debug("Beginning initialization!")
|
||||
var/list/our_atoms = init_list // OURS NOW!!! (Keeping this list to ourselves will prevent hijack)
|
||||
init_list = list()
|
||||
var/list/late_maps = list()
|
||||
var/list/pipes = list()
|
||||
var/list/cables = list()
|
||||
var/watch = start_watch()
|
||||
for(var/schmoo in init_list)
|
||||
for(var/schmoo in our_atoms)
|
||||
var/atom/movable/AM = schmoo
|
||||
if(AM) // to catch stuff like the nuke disk that no longer exists
|
||||
|
||||
// This can mess with our state - we leave these for last
|
||||
if(istype(AM, /obj/effect/landmark/map_loader))
|
||||
late_maps.Add(AM)
|
||||
continue
|
||||
AM.initialize()
|
||||
if(istype(AM, /obj/machinery/atmospherics))
|
||||
pipes.Add(AM)
|
||||
else if(istype(AM, /obj/structure/cable))
|
||||
cables.Add(AM)
|
||||
log_debug("Primary initialization finished in [stop_watch(watch)]s.")
|
||||
init_list.Cut()
|
||||
do_pipes()
|
||||
do_cables()
|
||||
our_atoms.Cut()
|
||||
if(pipes.len)
|
||||
do_pipes(pipes)
|
||||
if(cables.len)
|
||||
do_cables(cables)
|
||||
if(late_maps.len)
|
||||
do_late_maps(late_maps)
|
||||
|
||||
/datum/zlevel/proc/do_pipes()
|
||||
/datum/zlevel/proc/do_pipes(list/pipes)
|
||||
var/watch = start_watch()
|
||||
log_debug("Building pipenets on z-level '[zpos]'!")
|
||||
for(var/schmoo in pipes)
|
||||
@@ -38,7 +50,7 @@
|
||||
pipes.Cut()
|
||||
log_debug("Took [stop_watch(watch)]s")
|
||||
|
||||
/datum/zlevel/proc/do_cables()
|
||||
/datum/zlevel/proc/do_cables(list/cables)
|
||||
var/watch = start_watch()
|
||||
log_debug("Building powernets on z-level '[zpos]'!")
|
||||
for(var/schmoo in cables)
|
||||
@@ -47,3 +59,15 @@
|
||||
makepowernet_for(C)
|
||||
cables.Cut()
|
||||
log_debug("Took [stop_watch(watch)]s")
|
||||
|
||||
/datum/zlevel/proc/do_late_maps(list/late_maps)
|
||||
var/watch = start_watch()
|
||||
log_debug("Loading map templates on z-level '[zpos]'!")
|
||||
zlevels.add_dirt(zpos) // Let's not repeatedly resume init for each template
|
||||
for(var/schmoo in late_maps)
|
||||
var/obj/effect/landmark/map_loader/ML = schmoo
|
||||
if(ML)
|
||||
ML.initialize()
|
||||
late_maps.Cut()
|
||||
zlevels.remove_dirt(zpos)
|
||||
log_debug("Took [stop_watch(watch)]s")
|
||||
|
||||
Reference in New Issue
Block a user