Skip to content

Commit a70062a

Browse files
authoredOct 29, 2024
fix: three small mapmanip followup issues (ParadiseSS13#27200)
* fix: two small mapmanip followup issues * also qdel edge helper markers * return init hints instead
1 parent f38ccd7 commit a70062a

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ $RECYCLE.BIN
7474

7575
# Rust output.
7676
/rust/target/*
77+
rustlibs_panic.txt
7778

7879
# mkdocs output.
7980
site

‎code/game/objects/effects/map_effects/mapmanip.dm

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
/obj/effect/map_effect/marker/mapmanip/Initialize(mapload)
66
. = ..()
7-
qdel(src)
7+
return INITIALIZE_HINT_QDEL
88

99
/obj/effect/map_effect/marker/mapmanip/submap/extract
1010
name = "mapmanip marker, extract submap"
@@ -20,7 +20,15 @@
2020
pixel_x = -32
2121
pixel_y = -32
2222

23+
/obj/effect/map_effect/marker_helper
24+
name = "marker helper"
25+
layer = POINT_LAYER
26+
27+
/obj/effect/map_effect/marker_helper/Initialize(mapload)
28+
. = ..()
29+
return INITIALIZE_HINT_QDEL
30+
2331
/obj/effect/map_effect/marker_helper/mapmanip/submap/edge
24-
name = "mapmanip helper marker, edge of submap"
32+
name = "mapmanip marker helper, submap edge"
2533
icon = 'icons/effects/mapping_helpers.dmi'
2634
icon_state = "mapmanip_submap_edge"

‎code/modules/awaymissions/maploader/reader.dm

+10-9
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,26 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new())
2626
* allowed to romp unchecked.
2727
*/
2828
/datum/dmm_suite/proc/load_map(dmm_file, x_offset = 0, y_offset = 0, z_offset = 0, shouldCropMap = FALSE, measureOnly = FALSE)
29-
var/tfile = dmm_file// the map file we're creating
29+
var/map_data
3030
var/fname = "Lambda"
31-
if(isfile(tfile))
32-
fname = "[tfile]"
31+
if(isfile(dmm_file))
32+
fname = "[dmm_file]"
3333
// Make sure we dont load a dir up
3434
var/lastchar = copytext(fname, -1)
3535
if(lastchar == "/" || lastchar == "\\")
36-
log_debug("Attempted to load map template without filename (Attempted [tfile])")
36+
log_debug("Attempted to load map template without filename (Attempted [dmm_file])")
3737
return
3838

3939
// use rustlib to read, parse, process, mapmanip etc
4040
// this will "crash"/stacktrace on fail
41-
tfile = mapmanip_read_dmm(fname)
41+
// is not passed `dmm_file` because byondapi-rs doesn't support resource types yet
42+
map_data = mapmanip_read_dmm(fname)
4243
// if rustlib for whatever reason fails and returns null
4344
// try to load it the old dm way instead
44-
if(!tfile)
45-
tfile = wrap_file2text(fname)
45+
if(!map_data)
46+
map_data = wrap_file2text(dmm_file)
4647

47-
if(!length(tfile))
48+
if(!length(map_data))
4849
throw EXCEPTION("Map path '[fname]' does not exist!")
4950

5051
if(!x_offset)
@@ -65,7 +66,7 @@ GLOBAL_DATUM_INIT(_preloader, /datum/dmm_suite/preloader, new())
6566
log_debug("[measureOnly ? "Measuring" : "Loading"] map: [fname]")
6667
try
6768
LM.index = 1
68-
while(dmmRegex.Find(tfile, LM.index))
69+
while(dmmRegex.Find(map_data, LM.index))
6970
LM.index = dmmRegex.next
7071

7172
// "aa" = (/type{vars=blah})

0 commit comments

Comments
 (0)
Please sign in to comment.