From 3aa49425722095b36e2cf90ea99b31aa01f766fc Mon Sep 17 00:00:00 2001 From: "sentry[bot]" <39604003+sentry[bot]@users.noreply.github.com> Date: Fri, 29 May 2026 22:37:51 +0200 Subject: [PATCH] Fix Treasure Trove ambience list assignment (#22542) * Please describe the intent of your changes in a clear fashion. Addresses issue SERVER-PROD-3T: "Cannot read 'sound/ambience/konyang/konyang...'.len". The `ambience` variable for `/area/trove/beach`, `/area/trove/ocean`, and `/area/trove/jungle` was incorrectly assigned a raw file path string instead of a `list()` containing the path. This caused a runtime error when the `Entered()` proc attempted to access `.len` on the string, which does not have that property. This fix wraps the file path literals in `list()` for these three areas, ensuring `ambience` is always a list as expected by the system. * Please make sure that, in the case of mapping changes, you include images of these changes in the PR's description. * Please make sure to mark your PR as wip or review required by making a comment with !wip or !review required * If you include sprites/sounds/... (assets) that you have not created yourself specify the license and original author below. * Ensure that you also credit them in the appropriate location / changelog as specified in the contributor guidelines ### Asset Licenses The following assets that **have not** been created by myself are included in this PR: | Path | Original Author | License | | --- | --- | --- | | icons/example.dmi | ExamplePerson (Example Station) | CC0 | Fixes SERVER-PROD-3T --------- Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com> Co-authored-by: VMSolidus --- code/game/area/areas.dm | 7 ++++++- html/changelogs/hellfirejag-fix-away-site-ambience.yml | 5 +++++ maps/away/away_site/treasure_trove/treasure_trove_areas.dm | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 html/changelogs/hellfirejag-fix-away-site-ambience.yml diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 27decb5d2f3..b4ab640942d 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -127,6 +127,11 @@ . = ..() /area/Initialize(mapload) +#ifdef UNIT_TEST + if (!islist(ambience)) + log_error("Area: [src.type] set list/ambience with [ambience] instead of a list. This var MUST be a list().") +#endif + icon_state = "white" color = null @@ -381,7 +386,7 @@ L.lastarea = newarea // Start playing ambience. - if(src.ambience.len && L && L.client && (L.client.prefs.sfx_toggles & ASFX_AMBIENCE) && !L.ear_deaf) + if(length(src.ambience) && L && L.client && (L.client.prefs.sfx_toggles & ASFX_AMBIENCE) && !L.ear_deaf) play_ambience(L) else stop_ambience(L) diff --git a/html/changelogs/hellfirejag-fix-away-site-ambience.yml b/html/changelogs/hellfirejag-fix-away-site-ambience.yml new file mode 100644 index 00000000000..8f1ec4d2c14 --- /dev/null +++ b/html/changelogs/hellfirejag-fix-away-site-ambience.yml @@ -0,0 +1,5 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Fixed the Hiskyn Treasure Trove away site not having any ambience." + - rscadd: "Map Areas will now cause unit tests to fail if given invalid ambience." diff --git a/maps/away/away_site/treasure_trove/treasure_trove_areas.dm b/maps/away/away_site/treasure_trove/treasure_trove_areas.dm index 09d8e57e506..a63a9d188c0 100644 --- a/maps/away/away_site/treasure_trove/treasure_trove_areas.dm +++ b/maps/away/away_site/treasure_trove/treasure_trove_areas.dm @@ -12,7 +12,7 @@ name = "Treasure Trove Beach" icon_state = "yellow" is_outside = OUTSIDE_YES - ambience = 'sound/ambience/konyang/konyang-water.ogg' + ambience = list('sound/ambience/konyang/konyang-water.ogg') area_blurb = "You can hear the sound of waves hitting the shore. Something at the back of your mind makes you think the beauty of the area hides something darker." /area/trove/beach/landing @@ -21,14 +21,14 @@ name = "Treasure Trove Ocean" icon_state = "purple" is_outside = OUTSIDE_YES - ambience = 'sound/ambience/konyang/konyang-water.ogg' + ambience = list('sound/ambience/konyang/konyang-water.ogg') area_blurb = "Endless blue in all directions broken by the occasional jutting rock." /area/trove/jungle name = "Treasure Trove Jungle" icon_state = "green" is_outside = OUTSIDE_YES - ambience = 'sound/ambience/eeriejungle1.ogg' + ambience = list('sound/ambience/eeriejungle1.ogg') area_blurb = "Lush foliage and the sounds of distant animals... and something larger." // ----- Interior