mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-21 20:13:45 +01:00
Fixes maploading so that the cyberiad and space hotel load cleanly again
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
template = map_templates[template_name]
|
||||
|
||||
/obj/effect/landmark/map_loader/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
if(template)
|
||||
load(template)
|
||||
|
||||
|
||||
@@ -57,8 +57,6 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
var/list/grid_models = list()
|
||||
var/key_len = 0
|
||||
|
||||
|
||||
|
||||
var/dmm_suite/loaded_map/LM = new
|
||||
// This try-catch is used as a budget "Finally" clause, as the dirt count
|
||||
// needs to be reset
|
||||
@@ -128,7 +126,6 @@ var/global/dmm_suite/preloader/_preloader = new
|
||||
bounds[MAP_MAXY] = max(bounds[MAP_MAXY], min(ycrd, world.maxy))
|
||||
|
||||
var/maxx = xcrdStart
|
||||
log_debug("[xcrdStart]")
|
||||
if(measureOnly)
|
||||
for(var/line in gridLines)
|
||||
maxx = max(maxx, xcrdStart + length(line) / key_len - 1)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
chattyness = SNPC_CHANCE_TALK / 4
|
||||
|
||||
/mob/living/carbon/human/interactive/away/hotel/Initialize(mapload)
|
||||
..(loc, /datum/species/skrell)
|
||||
. = ..(mapload, /datum/species/skrell)
|
||||
|
||||
/mob/living/carbon/human/interactive/away/hotel/doSetup()
|
||||
..()
|
||||
@@ -24,12 +24,6 @@
|
||||
for(var/obj/item/I in get_all_slots())
|
||||
I.flags |= NODROP
|
||||
|
||||
// FIXME(crazylemon) a hack to prevent guards from running around with an
|
||||
// extra security jumpsuit like a goof
|
||||
for(var/obj/item/clothing/under/U in get_all_slots())
|
||||
if(w_uniform != U)
|
||||
qdel(U)
|
||||
|
||||
/mob/living/carbon/human/interactive/away/hotel/guard/KnockOut()
|
||||
// you'll never take me alive (this triggers the implant)
|
||||
emote("deathgasp")
|
||||
|
||||
@@ -5,14 +5,18 @@
|
||||
var/home_z
|
||||
|
||||
/mob/living/carbon/human/interactive/away/Initialize(mapload)
|
||||
..()
|
||||
. = ..()
|
||||
TRAITS |= TRAIT_ROBUST
|
||||
faction += "away"
|
||||
|
||||
/mob/living/carbon/human/interactive/away/random()
|
||||
if(ispath(override_under, /obj/item/clothing/under))
|
||||
equip_to_slot(new override_under(src), slot_w_uniform)
|
||||
..()
|
||||
// a little hacky but it should prevent doubled uniforms
|
||||
if(ispath(override_under, /obj/item/clothing/under))
|
||||
var/old_under = w_uniform
|
||||
w_uniform = null
|
||||
equip_to_slot(new override_under(src), slot_w_uniform)
|
||||
qdel(old_under)
|
||||
|
||||
/mob/living/carbon/human/interactive/away/doSetup()
|
||||
..()
|
||||
@@ -78,4 +82,4 @@
|
||||
if(living < squad_size && !length(viewers(src, world.view)))
|
||||
var/mob/living/carbon/human/interactive/away/A = new squad_type(loc)
|
||||
squad += A
|
||||
A.squad_member = 1
|
||||
A.squad_member = 1
|
||||
|
||||
@@ -523,7 +523,7 @@
|
||||
icon_state = "fan_tiny"
|
||||
buildstackamount = 2
|
||||
|
||||
/obj/structure/fans/New(loc)
|
||||
/obj/structure/fans/Initialize(loc)
|
||||
..()
|
||||
air_update_turf(1)
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@
|
||||
MYID.age = age
|
||||
MYID.registered_name = real_name
|
||||
MYID.photo = get_id_photo(src)
|
||||
MYID.access = Path_ID.access // Automatons have strange powers... strange indeed
|
||||
MYID.access = Path_ID.access.Copy() // Automatons have strange powers... strange indeed
|
||||
|
||||
RPID = new(src)
|
||||
RPID.name = "[real_name]'s ID Card ([alt_title])"
|
||||
@@ -257,7 +257,10 @@
|
||||
RPID.photo = get_id_photo(src)
|
||||
RPID.access = myjob.get_access()
|
||||
|
||||
equip_to_slot_or_del(MYID, slot_wear_id)
|
||||
if(wear_id)
|
||||
qdel(wear_id)
|
||||
if(!equip_to_slot_or_del(MYID, slot_wear_id))
|
||||
create_attack_log("<font color='blue'>Deleted ID due to slot contention</font>")
|
||||
if(wear_pda)
|
||||
MYPDA = wear_pda
|
||||
else
|
||||
@@ -403,8 +406,12 @@
|
||||
if(!hud_used)
|
||||
hud_used = new /datum/hud/human(src)
|
||||
|
||||
/mob/living/carbon/human/interactive/Initialize(mapload)
|
||||
/mob/living/carbon/human/interactive/Initialize()
|
||||
..()
|
||||
return INITIALIZE_HINT_LATELOAD
|
||||
|
||||
/mob/living/carbon/human/interactive/LateInitialize()
|
||||
. = ..()
|
||||
snpc_list += src
|
||||
|
||||
create_mob_hud()
|
||||
@@ -427,6 +434,7 @@
|
||||
/mob/living/carbon/human/interactive/Destroy()
|
||||
hear_radio_list -= src
|
||||
snpc_list -= src
|
||||
npc_master.removeBot(src)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/interactive/proc/retalTarget(mob/living/target)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/New()
|
||||
/mob/living/Initialize()
|
||||
. = ..()
|
||||
var/datum/atom_hud/data/human/medical/advanced/medhud = huds[DATA_HUD_MEDICAL_ADVANCED]
|
||||
medhud.add_to_hud(src)
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
var/death_sound = null //The sound played on death
|
||||
|
||||
|
||||
/mob/living/simple_animal/New()
|
||||
/mob/living/simple_animal/Initialize()
|
||||
..()
|
||||
simple_animal_list += src
|
||||
verbs -= /mob/verb/observe
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL
|
||||
|
||||
/mob/New()
|
||||
/mob/Initialize()
|
||||
mob_list += src
|
||||
if(stat == DEAD)
|
||||
dead_mob_list += src
|
||||
|
||||
@@ -38,4 +38,4 @@
|
||||
if(get_step(T,direction) in mother.map)
|
||||
continue
|
||||
return 1
|
||||
return 0
|
||||
return 0
|
||||
|
||||
@@ -133,6 +133,10 @@
|
||||
if(SELFLOOPING)
|
||||
link_to_self() // `link_to_self` is defined in space_transitions.dm
|
||||
|
||||
var/list/atmos_machine_typecache = typecacheof(/obj/machinery/atmospherics)
|
||||
var/list/cable_typecache = typecacheof(/obj/structure/cable)
|
||||
var/list/maploader_typecache = typecacheof(/obj/effect/landmark/map_loader)
|
||||
|
||||
/datum/space_level/proc/resume_init()
|
||||
if(dirt_count > 0)
|
||||
throw EXCEPTION("Init told to resume when z-level still dirty. Z level: '[zpos]'")
|
||||
@@ -140,23 +144,15 @@
|
||||
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 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(TRUE)
|
||||
if(istype(AM, /obj/machinery/atmospherics))
|
||||
pipes.Add(AM)
|
||||
else if(istype(AM, /obj/structure/cable))
|
||||
cables.Add(AM)
|
||||
listclearnulls(our_atoms)
|
||||
var/list/late_maps = typecache_filter_list(our_atoms, maploader_typecache)
|
||||
var/list/pipes = typecache_filter_list(our_atoms, atmos_machine_typecache)
|
||||
var/list/cables = typecache_filter_list(our_atoms, cable_typecache)
|
||||
// If we don't carefully add dirt around the map templates, bad stuff happens
|
||||
// so we separate them out here
|
||||
our_atoms -= late_maps
|
||||
SSatoms.InitializeAtoms(our_atoms, FALSE)
|
||||
log_debug("Primary initialization finished in [stop_watch(watch)]s.")
|
||||
our_atoms.Cut()
|
||||
if(pipes.len)
|
||||
@@ -168,13 +164,14 @@
|
||||
|
||||
/datum/space_level/proc/do_pipes(list/pipes)
|
||||
var/watch = start_watch()
|
||||
log_debug("Building pipenets on z-level '[zpos]'!")
|
||||
for(var/schmoo in pipes)
|
||||
var/obj/machinery/atmospherics/machine = schmoo
|
||||
if(machine)
|
||||
machine.build_network()
|
||||
log_debug("Initializing atmos machines on z-level '[zpos]'!")
|
||||
var/init_count = SSair._setup_atmos_machinery(pipes)
|
||||
log_debug("Initialized [init_count] machines, took [stop_watch(watch)]s")
|
||||
watch = start_watch()
|
||||
log_debug("Initializing pipe networks on z-level '[zpos]'!")
|
||||
init_count = SSair._setup_pipenets(pipes)
|
||||
log_debug("Initialized pipenets for [init_count] machines, took [stop_watch(watch)]s")
|
||||
pipes.Cut()
|
||||
log_debug("Took [stop_watch(watch)]s")
|
||||
|
||||
/datum/space_level/proc/do_cables(list/cables)
|
||||
var/watch = start_watch()
|
||||
@@ -187,10 +184,8 @@
|
||||
var/watch = start_watch()
|
||||
log_debug("Loading map templates on z-level '[zpos]'!")
|
||||
space_manager.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()
|
||||
for(var/atom/movable/AM in late_maps)
|
||||
AM.Initialize()
|
||||
late_maps.Cut()
|
||||
space_manager.remove_dirt(zpos)
|
||||
log_debug("Took [stop_watch(watch)]s")
|
||||
|
||||
@@ -136,9 +136,9 @@
|
||||
if(owner.gloves)
|
||||
owner.unEquip(owner.gloves)
|
||||
if(owner.l_hand)
|
||||
owner.unEquip(owner.l_hand,1)
|
||||
owner.unEquip(owner.l_hand)
|
||||
if(owner.r_hand)
|
||||
owner.unEquip(owner.r_hand,1)
|
||||
owner.unEquip(owner.r_hand)
|
||||
|
||||
. = ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user