mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-22 04:22:39 +01:00
Sticker Hotfix (#22450)
Uhhhh <img width="401" height="735" alt="image" src="https://github.com/user-attachments/assets/e006ebea-a9b6-410c-a365-f805a0019c60" />
This commit is contained in:
@@ -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
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user