Skip to content

Commit

Permalink
Merge pull request #3489 from out-of-phaze/fix/lighthouse-dev-sync
Browse files Browse the repository at this point in the history
Upstreaming dev branch fixes from Lighthouse
  • Loading branch information
MistakeNot4892 authored Nov 4, 2023
2 parents f4b07fd + e04eca3 commit 79d0ce6
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
27 changes: 14 additions & 13 deletions code/controllers/subsystems/mapping.dm
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,6 @@ SUBSYSTEM_DEF(mapping)
for(var/datum/map_template/MT as anything in get_all_template_instances())
register_map_template(MT)

// Resize the world to the max template size to fix a BYOND bug with world resizing breaking events.
// REMOVE WHEN THIS IS FIXED: https://www.byond.com/forum/post/2833191
var/new_maxx = world.maxx
var/new_maxy = world.maxy
for(var/map_template_name in map_templates)
var/datum/map_template/map_template = map_templates[map_template_name]
new_maxx = max(map_template.width, new_maxx)
new_maxy = max(map_template.height, new_maxy)
if (new_maxx > world.maxx)
world.maxx = new_maxx
if (new_maxy > world.maxy)
world.maxy = new_maxy

// Populate overmap.
if(length(global.using_map.overmap_ids))
for(var/overmap_id in global.using_map.overmap_ids)
Expand All @@ -100,6 +87,7 @@ SUBSYSTEM_DEF(mapping)
PRINT_STACK_TRACE("Missing z-level data object for z[num2text(z)]!")
level.setup_level_data()

old_maxz = world.maxz
// Build away sites.
global.using_map.build_away_sites()
global.using_map.build_planets()
Expand All @@ -114,6 +102,19 @@ SUBSYSTEM_DEF(mapping)
for(var/obj/abstract/turbolift_spawner/turbolift as anything in turbolifts_to_initialize)
turbolift.build_turbolift()

// Resize the world to the max template size to fix a BYOND bug with world resizing breaking events.
// REMOVE WHEN THIS IS FIXED: https://www.byond.com/forum/post/2833191
var/new_maxx = world.maxx
var/new_maxy = world.maxy
for(var/map_template_name in map_templates)
var/datum/map_template/map_template = map_templates[map_template_name]
new_maxx = max(map_template.width, new_maxx)
new_maxy = max(map_template.height, new_maxy)
if (new_maxx > world.maxx)
world.maxx = new_maxx
if (new_maxy > world.maxy)
world.maxy = new_maxy

// Initialize z-level objects.
#ifdef UNIT_TEST
config.roundstart_level_generation = FALSE //#FIXME: Shouldn't this be set before running level_data/setup_level_data()?
Expand Down
4 changes: 2 additions & 2 deletions code/game/turfs/exterior/_exterior.dm
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@
if(icon_has_corners)
for(var/direction in global.cornerdirs)
var/turf/exterior/turf_to_check = get_step_resolving_mimic(src, direction)
if(!isturf(turf_to_check) || turf_to_check.density || istype(turf_to_check, type))
if(!istype(turf_to_check) || turf_to_check.density || istype(turf_to_check, type))
continue

if(!istype(turf_to_check) || icon_edge_layer > turf_to_check.icon_edge_layer)
if(icon_edge_layer > turf_to_check.icon_edge_layer)
var/draw_state
var/res = (neighbors & direction)
if(res == 0)
Expand Down
10 changes: 10 additions & 0 deletions code/modules/multiz/turf_mimic_edge.dm
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@
QDEL_NULL(click_eater)
return ..()

/turf/exterior/mimic_edge/Crossed(atom/movable/O)
. = ..()
if(isobserver(O))
var/turf/drop_turf = get_mimic_turf()
if(drop_turf)
O.forceMove(drop_turf)

/turf/exterior/mimic_edge/resolve_to_actual_turf()
return get_mimic_turf()

//Properly install itself, and allow overriding how the target turf is picked
/turf/exterior/mimic_edge/proc/setup_mimic()
return
Expand Down
1 change: 1 addition & 0 deletions code/modules/random_map/noise/noise.dm
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
total += map[TRANSLATE_COORD(x+1, y)] // x + blur_radius
next_map[TRANSLATE_COORD(x, y)] = round(total / 3) // should technically be 2*blur_radius+1
// now do the same in the x axis
map = next_map.Copy()
for(var/x = 1 to limit_x)
// see comments above
var/cellone = map[TRANSLATE_COORD(x, 1)]
Expand Down
4 changes: 2 additions & 2 deletions code/unit_tests/icon_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
if(!check_state_in_icon(check_state, check_icon, TRUE))
failures += "[sign] - missing icon_state '[check_state]' in icon '[check_icon]"
if(failures.len)
fail("Signs with missing icon states: [english_list(failures)]")
fail("Signs with missing icon states:\n\t-[jointext(failures, "\n\t-")]")
else
pass("All signs have valid icon states.")
return 1
Expand Down Expand Up @@ -92,7 +92,7 @@
if(!check_state_in_icon(check_state, check_icon, TRUE))
failures += "[decal] - missing icon_state '[check_state]' in icon '[check_icon]"
if(failures.len)
fail("Decals with missing icon states: [english_list(failures)]")
fail("Decals with missing icon states:\n\t-[jointext(failures, "\n\t-")]")
else
pass("All decals have valid icon states.")
return 1

0 comments on commit 79d0ce6

Please sign in to comment.