From 3ee2d12b349600dcbf00a171d3513ff49a22081b Mon Sep 17 00:00:00 2001 From: SandPoot Date: Fri, 18 Mar 2022 12:45:07 -0300 Subject: [PATCH 1/5] Upload files --- code/__HELPERS/unsorted.dm | 29 ++++++++++++++------- code/datums/chatmessage.dm | 2 +- code/modules/balloon_alert/balloon_alert.dm | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index f931dc5e5c..2156d888f7 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -357,16 +357,27 @@ Turf and target are separate in case you want to teleport some distance from a t if(M.ckey == key) return M -//Returns the atom sitting on the turf. -//For example, using this on a disk, which is in a bag, on a mob, will return the mob because it's on the turf. -//Optional arg 'type' to stop once it reaches a specific type instead of a turf. -/proc/get_atom_on_turf(atom/movable/M, stop_type) - var/atom/loc = M - while(loc && loc.loc && !isturf(loc.loc)) - loc = loc.loc - if(stop_type && istype(loc, stop_type)) +/** + * Returns the top-most atom sitting on the turf. + * For example, using this on a disk, which is in a bag, on a mob, + * will return the mob because it's on the turf. + * + * Arguments + * * something_in_turf - a movable within the turf, somewhere. + * * stop_type - optional - stops looking if stop_type is found in the turf, returning that type (if found). + **/ +/proc/get_atom_on_turf(atom/movable/something_in_turf, stop_type) + if(!istype(something_in_turf)) + CRASH("get_atom_on_turf was not passed an /atom/movable! Got [isnull(something_in_turf) ? "null":"type: [something_in_turf.type]"]") + + var/atom/movable/topmost_thing = something_in_turf + + while(topmost_thing?.loc && !isturf(topmost_thing.loc)) + topmost_thing = topmost_thing.loc + if(stop_type && istype(topmost_thing, stop_type)) break - return loc + + return topmost_thing //Returns a list of all locations the target is within. /proc/get_nested_locs(atom/movable/M, include_turf = FALSE) diff --git a/code/datums/chatmessage.dm b/code/datums/chatmessage.dm index ad71958107..a3a9ed5898 100644 --- a/code/datums/chatmessage.dm +++ b/code/datums/chatmessage.dm @@ -134,7 +134,7 @@ approx_lines = max(1, mheight / CHAT_MESSAGE_APPROX_LHEIGHT) // Translate any existing messages upwards, apply exponential decay factors to timers - message_loc = get_atom_on_turf(target) + message_loc = isturf(target) ? target : get_atom_on_turf(target) if (owned_by.seen_messages) var/idx = 1 var/combined_height = approx_lines diff --git a/code/modules/balloon_alert/balloon_alert.dm b/code/modules/balloon_alert/balloon_alert.dm index 8a25206ed0..c273722607 100644 --- a/code/modules/balloon_alert/balloon_alert.dm +++ b/code/modules/balloon_alert/balloon_alert.dm @@ -42,7 +42,7 @@ var/atom/movable/movable_source = src bound_width = movable_source.bound_width - var/image/balloon_alert = image(loc = get_atom_on_turf(src), layer = ABOVE_MOB_LAYER) + var/image/balloon_alert = image(loc = isturf(src) ? src : get_atom_on_turf(src), layer = ABOVE_MOB_LAYER) balloon_alert.plane = BALLOON_CHAT_PLANE balloon_alert.alpha = 0 balloon_alert.appearance_flags = RESET_ALPHA|RESET_COLOR|RESET_TRANSFORM From 739c4708b690611f9fea33b381e4f8ae405d7a6f Mon Sep 17 00:00:00 2001 From: evan Date: Sat, 19 Mar 2022 19:04:25 -0400 Subject: [PATCH 2/5] Hey what if no dead ends --- _maps/map_files/MetaStation/MetaStation.dmm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/_maps/map_files/MetaStation/MetaStation.dmm b/_maps/map_files/MetaStation/MetaStation.dmm index aac84a1989..d9b14bab19 100644 --- a/_maps/map_files/MetaStation/MetaStation.dmm +++ b/_maps/map_files/MetaStation/MetaStation.dmm @@ -16057,13 +16057,15 @@ /obj/effect/turf_decal/tile/neutral{ dir = 1 }, -/obj/structure/cable, /obj/effect/turf_decal/tile/neutral{ dir = 8 }, /obj/effect/turf_decal/tile/neutral{ dir = 4 }, +/obj/structure/cable/yellow{ + icon_state = "1-2" + }, /turf/open/floor/plasteel, /area/hallway/primary/port) "bke" = ( @@ -16666,6 +16668,9 @@ dir = 1 }, /obj/effect/turf_decal/tile/neutral, +/obj/structure/cable/yellow{ + icon_state = "1-4" + }, /turf/open/floor/plasteel, /area/hallway/primary/port) "bmc" = ( From 267f435c5a3f26aa0129e30a9bd8a022bf888d42 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 20 Mar 2022 17:30:37 -0500 Subject: [PATCH 3/5] Automatic changelog generation for PR #15564 [ci skip] --- html/changelogs/AutoChangeLog-pr-15564.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-15564.yml diff --git a/html/changelogs/AutoChangeLog-pr-15564.yml b/html/changelogs/AutoChangeLog-pr-15564.yml new file mode 100644 index 0000000000..85f7cd6fc2 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-15564.yml @@ -0,0 +1,4 @@ +author: "Melbert" +delete-after: True +changes: + - bugfix: "Balloon alerts sourced on turfs work properly." From 3e35a8b1c04c22f13ca8a43cc4320fe5757ffaa8 Mon Sep 17 00:00:00 2001 From: Changelogs Date: Mon, 21 Mar 2022 00:36:16 +0000 Subject: [PATCH 4/5] Automatic changelog compile [ci skip] --- html/changelogs/AutoChangeLog-pr-15564.yml | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 html/changelogs/AutoChangeLog-pr-15564.yml diff --git a/html/changelogs/AutoChangeLog-pr-15564.yml b/html/changelogs/AutoChangeLog-pr-15564.yml deleted file mode 100644 index 85f7cd6fc2..0000000000 --- a/html/changelogs/AutoChangeLog-pr-15564.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "Melbert" -delete-after: True -changes: - - bugfix: "Balloon alerts sourced on turfs work properly." From f2395b0e06f9b301d15c2a6e88e6a41d2f629b07 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Sun, 20 Mar 2022 22:37:51 -0500 Subject: [PATCH 5/5] Automatic changelog generation for PR #15566 [ci skip] --- html/changelogs/AutoChangeLog-pr-15566.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 html/changelogs/AutoChangeLog-pr-15566.yml diff --git a/html/changelogs/AutoChangeLog-pr-15566.yml b/html/changelogs/AutoChangeLog-pr-15566.yml new file mode 100644 index 0000000000..aef907d505 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-15566.yml @@ -0,0 +1,4 @@ +author: "bunny232" +delete-after: True +changes: + - bugfix: "A wire outside meta station customs has been fixed."