Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nightmare Insert Fixes & Elevated Nightmare Errors #5796

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/_globalvars/lists/mapping_globals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ GLOBAL_LIST_EMPTY(teleporter_landmarks)

GLOBAL_LIST_INIT(cardinals, list(NORTH, SOUTH, EAST, WEST))
GLOBAL_LIST_EMPTY(nightmare_landmarks)
GLOBAL_LIST_EMPTY(nightmare_landmark_tags_removed)

GLOBAL_LIST_EMPTY(ship_areas)

Expand Down
8 changes: 5 additions & 3 deletions code/game/objects/effects/landmarks/landmarks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@
return
GLOB.nightmare_landmarks[insert_tag] = get_turf(src)
/obj/effect/landmark/nightmare/Destroy()
if(insert_tag && autoremove \
&& GLOB.nightmare_landmarks[insert_tag] == get_turf(src))
GLOB.nightmare_landmarks.Remove(insert_tag)
if(insert_tag)
var/turf/turf = get_turf(src)
if(autoremove && GLOB.nightmare_landmarks[insert_tag] == turf)
GLOB.nightmare_landmarks.Remove(insert_tag)
GLOB.nightmare_landmark_tags_removed += insert_tag
return ..()

/obj/effect/landmark/ert_spawns/distress
Expand Down
2 changes: 1 addition & 1 deletion code/modules/nightmare/nmnodes/mapload.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
. = ..()
if(!.) return
var/dir_path = context.get_file_path(filepath, "map")
var/regex/matcher = new(@"^([0-9]+)([\.\+])([^_]+)(_.*)?\.dmm$", "i")
var/regex/matcher = new(@"^([0-9]+)([\.\+])(([^_]+)(_.*))?\.dmm$", "i")
var/list/dircontents = flist(dir_path)
for(var/filename in dircontents)
if(!matcher.Find(filename))
Expand Down
21 changes: 10 additions & 11 deletions code/modules/nightmare/nmtasks/mapload.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,36 +34,35 @@
/datum/nmtask/mapload/proc/step_parse()
. = TRUE
if(!fexists(filepath))
log_debug("Nightmare Mapload: File does not exist: [filepath]")
return
CRASH("Nightmare Mapload: File does not exist: [filepath]")
if(!parsed)
parsed = new(file(filepath))
if(!parsed?.bounds)
log_debug("Nightmare Mapload: File loading failed: [filepath]")
return
CRASH("Nightmare Mapload: File loading failed: [filepath]")
if(isnull(parsed.bounds[1]))
log_debug("Nightmare Mapload: Map parsing failed: [filepath]")
return
CRASH("Nightmare Mapload: Map parsing failed: [filepath]")
return FALSE

/datum/nmtask/mapload/proc/step_loadmap(list/statsmap)
. = TRUE
UNTIL(!Master.map_loading)
target_turf = GLOB.nightmare_landmarks[landmark]
if(!target_turf?.z)
log_debug("Nightmare Mapload: Could not find landmark: [landmark]")
return
if(landmark in GLOB.nightmare_landmark_tags_removed)
log_debug("Nightmare Mapload: Could not find landmark: [landmark] because it was deleted")
return
else
CRASH("Nightmare Mapload: Could not find landmark: [landmark]")
var/result = parsed.load(target_turf.x, target_turf.y, target_turf.z, crop_map = TRUE, no_changeturf = FALSE, place_on_top = FALSE, delete = replace)
if(!result || !parsed.bounds)
log_debug("Nightmare Mapload: Map insertion failed unexpectedly for file: [filepath]")
return
CRASH("Nightmare Mapload: Map insertion failed unexpectedly for file: [filepath]")
return FALSE

/datum/nmtask/mapload/proc/step_init(list/statsmap)
if(initialize_boundary_contents())
log_debug("Nightmare Mapload: Loaded '[filepath]' at '[landmark]' ([target_turf.x], [target_turf.y], [target_turf.z])")
return FALSE
log_debug("Nightmare Mapload: Loaded map file but could not initialize: '[filepath]' at ([target_turf.x], [target_turf.y], [target_turf.z])")
stack_trace("Nightmare Mapload: Loaded map file but could not initialize: '[filepath]' at ([target_turf.x], [target_turf.y], [target_turf.z])")
return TRUE

/// Initialize atoms/areas in bounds - basically a Nightmare version of [/datum/map_template/initTemplateBounds]
Expand Down
32 changes: 16 additions & 16 deletions maps/map_files/BigRed/BigRed.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -12652,7 +12652,7 @@
/area/bigredv2/outside/office_complex)
"aLh" = (
/obj/effect/landmark/nightmare{
insert_tag = "lz1north"
insert_tag = "lz1north_mining"
},
/turf/closed/wall/solaris/reinforced,
/area/bigredv2/outside/space_port)
Expand Down Expand Up @@ -28397,7 +28397,7 @@
/area/bigredv2/outside/dorms)
"ers" = (
/obj/effect/landmark/nightmare{
insert_tag = "etatunnel"
insert_tag = "etatunnel_open"
},
/turf/closed/wall/solaris/rock,
/area/bigredv2/caves)
Expand Down Expand Up @@ -28742,7 +28742,7 @@
/area/bigredv2/caves/mining)
"eUT" = (
/obj/effect/landmark/nightmare{
insert_tag = "viro-rock"
insert_tag = "viro-rock_open"
},
/turf/closed/wall/solaris/reinforced,
/area/bigredv2/outside/virology)
Expand Down Expand Up @@ -31085,7 +31085,7 @@
/area/bigredv2/outside/space_port_lz2)
"iIp" = (
/obj/effect/landmark/nightmare{
insert_tag = "chapel"
insert_tag = "chapel_cult"
},
/turf/closed/wall/solaris,
/area/bigredv2/outside/chapel)
Expand Down Expand Up @@ -31310,7 +31310,7 @@
/area/bigredv2/caves/mining)
"jcn" = (
/obj/effect/landmark/nightmare{
insert_tag = "tcomms"
insert_tag = "tcomms_open"
},
/turf/closed/wall/solaris/rock,
/area/bigredv2/caves)
Expand Down Expand Up @@ -31462,7 +31462,7 @@
dir = 5
},
/obj/effect/landmark/nightmare{
insert_tag = "dorms"
insert_tag = "dorms_party"
},
/turf/open/floor,
/area/bigredv2/outside/dorms)
Expand Down Expand Up @@ -33180,7 +33180,7 @@
/area/bigredv2/caves/mining)
"lMt" = (
/obj/effect/landmark/nightmare{
insert_tag = "cargo"
insert_tag = "cargo_containers"
},
/turf/closed/wall/solaris,
/area/bigredv2/outside/cargo)
Expand All @@ -33195,7 +33195,7 @@
/area/bigredv2/caves_lambda)
"lMB" = (
/obj/effect/landmark/nightmare{
insert_tag = "lz1cave"
insert_tag = "lz1cave_flank"
},
/turf/closed/wall/solaris/reinforced,
/area/bigredv2/outside/space_port)
Expand Down Expand Up @@ -34345,7 +34345,7 @@
/area/bigredv2/outside/filtration_cave_cas)
"nGt" = (
/obj/effect/landmark/nightmare{
insert_tag = "admin"
insert_tag = "admin_pmc"
},
/turf/closed/wall/solaris/reinforced,
/area/bigredv2/outside/admin_building)
Expand Down Expand Up @@ -35360,7 +35360,7 @@
/area/bigredv2/outside/admin_building)
"pdN" = (
/obj/effect/landmark/nightmare{
insert_tag = "lz1entrance"
insert_tag = "lz1entrance_v2"
},
/turf/open/mars,
/area/bigredv2/outside/nw)
Expand Down Expand Up @@ -36458,7 +36458,7 @@
/area/bigredv2/caves/mining)
"qTu" = (
/obj/effect/landmark/nightmare{
insert_tag = "viro"
insert_tag = "viro_open"
},
/turf/closed/wall/solaris/rock,
/area/bigredv2/caves)
Expand Down Expand Up @@ -36795,7 +36795,7 @@
/area/bigredv2/caves/mining)
"rrl" = (
/obj/effect/landmark/nightmare{
insert_tag = "filtration"
insert_tag = "filtration_restored"
},
/turf/open/mars_cave{
icon_state = "mars_cave_2"
Expand Down Expand Up @@ -38745,7 +38745,7 @@
/area/bigredv2/caves/mining)
"tYM" = (
/obj/effect/landmark/nightmare{
insert_tag = "prison"
insert_tag = "prison_breakout"
},
/turf/closed/wall/solaris/reinforced,
/area/bigredv2/outside/marshal_office)
Expand Down Expand Up @@ -39079,7 +39079,7 @@
/area/bigredv2/caves/mining)
"uCD" = (
/obj/effect/landmark/nightmare{
insert_tag = "reactor"
insert_tag = "reactor_meltdown"
},
/turf/closed/wall/solaris/rock,
/area/bigredv2/caves)
Expand Down Expand Up @@ -39685,7 +39685,7 @@
/area/bigredv2/caves/eta/research)
"vvi" = (
/obj/effect/landmark/nightmare{
insert_tag = "lz1containers"
insert_tag = "lz1containers_scramble"
},
/turf/open/floor{
dir = 4;
Expand Down Expand Up @@ -41502,7 +41502,7 @@
/area/bigredv2/outside/n)
"yfe" = (
/obj/effect/landmark/nightmare{
insert_tag = "eta"
insert_tag = "eta_carp"
},
/turf/closed/wall/solaris/reinforced,
/area/bigredv2/caves/eta/xenobiology)
Expand Down
Loading
Loading