From 29ebf7e36e7cbd07f382955f4d2914c4aa33f351 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Wed, 13 May 2026 18:41:17 -0400 Subject: [PATCH] Sticker Hotfix (#22450) Uhhhh image --- code/game/objects/items/sticker.dm | 25 ++----------------- .../hellfirejag-sticker-harddel-fix.yml | 4 +++ 2 files changed, 6 insertions(+), 23 deletions(-) create mode 100644 html/changelogs/hellfirejag-sticker-harddel-fix.yml diff --git a/code/game/objects/items/sticker.dm b/code/game/objects/items/sticker.dm index e7abb620f63..028138c16bb 100644 --- a/code/game/objects/items/sticker.dm +++ b/code/game/objects/items/sticker.dm @@ -17,6 +17,7 @@ icon_state = pick(rand_icons) /obj/item/sticker/Destroy() + astype(attached?.resolve(), /atom/movable)?.remove_vis_contents(src) attached = null return ..() @@ -77,43 +78,21 @@ to_chat(user, SPAN_NOTICE("You remove \the [src] from \the [attached_atom].")) attached_atom.remove_vis_contents(src) attached = null - SSpersistence.objectsDeregisterTrack(src) + SSpersistence.objectsDeregisterTrack(src) /obj/item/sticker/persistent_objects_get_content() var/list/content = ..() content["pixel_x"] = pixel_x content["pixel_y"] = pixel_y - content["attached_type"] = attached ? astype(attached.resolve(), /atom/movable)?.type : null return content /obj/item/sticker/persistent_objects_apply_content(content, x, y, z) - var/attached_type = content["attached_type"] - if (!attached_type) - // Exit early, this was an invalid sticker that wasn't attached to anything. - qdel(src) - return - src.pixel_x = content["pixel_x"] src.pixel_y = content["pixel_y"] src.x = x src.y = y src.z = z - var/thing_found = FALSE - // Find the thing to attach it to. Which will only work if the sticker was attached to an object that spawns during map initialization. - for (var/atom/movable/AM in get_turf(src)) - if(AM.type != attached_type) - continue - - thing_found = TRUE - attached = WEAKREF(AM) - AM.add_vis_contents(src) - break - - // If it was attached to an object that doesn't spawn during map init, delete the sticker. - if (!thing_found) - qdel(src) - // //generic stickers, catch all for anything that doesn't fit in another category // diff --git a/html/changelogs/hellfirejag-sticker-harddel-fix.yml b/html/changelogs/hellfirejag-sticker-harddel-fix.yml new file mode 100644 index 00000000000..f591a5b8634 --- /dev/null +++ b/html/changelogs/hellfirejag-sticker-harddel-fix.yml @@ -0,0 +1,4 @@ +author: Hellfirejag +delete-after: True +changes: + - bugfix: "Hotfixed a hard del related to stickers."