More cuffed item fixes (#96086)

## About The Pull Request

1. Picking up both items someone has cuffed to them no longer breaks the
link after dropping the first item.

2. Picking up two items linked to two separate people no longer works.
You are forced to drop the item (or if nodrop is somehow applied, the
cuffs are broken.)

3. If the beam is broken (such as by changing z-level), it will
re-instantiate.

## Changelog

🆑 Melbert
fix: Fixed issues that arise from picking up two items cuffed to the
same person
fix: Fixed issues that arise from picking up two items cuffed to two
different people
fix: Fixed issues that arise from traveling z-levels while having a
cuffed item
/🆑
This commit is contained in:
MrMelbert
2026-05-20 18:41:23 +02:00
committed by GitHub
parent 1d66337742
commit ed31561817
2 changed files with 90 additions and 23 deletions
+4 -1
View File
@@ -370,9 +370,12 @@
if((source in old_component.sources) && !old_component.allow_source_update(source))
return old_component // source already registered, no work to do
if(old_component.on_source_add(arglist(list(source) + raw_args.Copy(2))) == COMPONENT_INCOMPATIBLE)
var/source_result = old_component.on_source_add(arglist(list(source) + raw_args.Copy(2)))
if(source_result == COMPONENT_INCOMPATIBLE)
stack_trace("incompatible source added to a [old_component.type]. Args: [json_encode(raw_args)]")
return null
if(source_result == COMPONENT_REDUNDANT)
return null
else if(!new_component)
new_component = new component_type(raw_args) // There's a valid dupe mode but there's no old component, act like normal