Skip to content

Commit

Permalink
fix: Dup/Del Bug with chasms.
Browse files Browse the repository at this point in the history
- Ensures items are properly transferred to the core to prevent conflicts between overlapping movement mechanics. e.g. Chasms
  • Loading branch information
Coll6 committed Nov 19, 2024
1 parent e62165a commit be7a83f
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions monkestation/code/modules/smithing/oozelings/body/organs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@
victim.visible_message(span_warning("[victim]'s body completely dissolves, collapsing outwards!"), span_notice("Your body completely dissolves, collapsing outwards!"), span_notice("You hear liquid splattering."))
var/turf/death_turf = get_turf(victim)

for(var/atom/movable/item as anything in victim.get_equipped_items(include_pockets = TRUE))
victim.dropItemToGround(item)
stored_items |= item
item.forceMove(src)
//Start moving items
process_items(victim)

if(victim.get_organ_slot(ORGAN_SLOT_BRAIN) == src)
Remove(victim)
Expand Down Expand Up @@ -230,6 +228,34 @@
return TRUE
return ..()

/obj/item/organ/internal/brain/slime/proc/process_items(mob/living/carbon/human/victim)

//List of slots that drop despite the transferItemtoLoc proc
var/list/focus_slots = list(
ITEM_SLOT_SUITSTORE,
ITEM_SLOT_BELT,
ITEM_SLOT_ID,
ITEM_SLOT_LPOCKET,
ITEM_SLOT_RPOCKET
)

for(var/islot in focus_slots) // Handle dropping items on unequip
var/atom/movable/focus_item = victim.get_item_by_slot(islot)
if(focus_item)
victim.transferItemToLoc(focus_item, src, FALSE, silent = TRUE)
stored_items |= focus_item

var/atom/movable/item_on_back = victim.back
if(item_on_back) //Jank to handle modsuit covering items. Fix this.
victim.transferItemToLoc(item_on_back, src, FALSE, silent = TRUE)
stored_items |= item_on_back

var/atom/movable/rest_items = victim.get_equipped_items(include_pockets = TRUE)
for(var/atom/movable/item in rest_items)
if(item)
victim.transferItemToLoc(item, src, FALSE, silent = TRUE)
stored_items |= item

/obj/item/organ/internal/brain/slime/proc/drop_items_to_ground(turf/turf)
for(var/atom/movable/item as anything in stored_items)
item.forceMove(turf)
Expand Down

1 comment on commit be7a83f

@Coll6
Copy link
Contributor Author

@Coll6 Coll6 commented on be7a83f Nov 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bug is introduced where the nuclear auth disk doesn't get moved into the core or does and the gps no longer tracks it. When it doesn't get moved in the disk teleports many tiles away. However upon revival both are restored.
Now properly handled with the oozling core filters.

Please sign in to comment.