Bugfix persistence of items in inventories and persistent charge card location (#22426)

# Summary

This PR fixes two bugs with persistent items, trash and the persistent
charge card.

## Changes

- Fixed the prevention of trash in inventories becoming persistent also
preventing any items on characters becoming persistent.
- Fixed persistent charge card location on init. If the card is not in
an command area, it will be moved into the XO office, if it is in a
command area, it will stay there.
This commit is contained in:
FabianK3
2026-05-07 20:31:08 +00:00
committed by GitHub
parent 38a5988115
commit 9f59d9dec5
4 changed files with 24 additions and 3 deletions
+2 -1
View File
@@ -495,7 +495,7 @@
if(!persistency_considered_trash)
return
if(in_storage) // Items getting moved into storages (lunchboxes, backpacks) triggers the dropped handler and requires no persistency as a result
if(in_storage || in_inventory) // Items getting moved into storages (lunchboxes, backpacks) triggers the dropped handler and requires no persistency as a result
SSpersistence.objectsDeregisterTrack(src)
return
@@ -543,6 +543,7 @@
addtimer(CALLBACK(src, PROC_REF(check_maptext)), 1) // invoke async does not work here
in_inventory = TRUE
do_pickup_animation(user)
try_make_persistent_trash()
// called when this item is removed from a storage item, which is passed on as S. The loc variable is already set to the new destination before this is called.
/obj/item/proc/on_exit_storage(obj/item/storage/S as obj)