Files
Bubberstation/code/datums
MrMelbert ddf9fffdd4 Fixes a hard delete with AI laws, adds a stack trace for law datums associating with mobs when already associated (#81065)
## About The Pull Request

- Adds a stack trace for law datums associating with mobs when already
associated.
- From what I can tell, any situation in which a law datum is attempting
to associate with another mob when it already has an owner assigned is
an error. So this might help track down similar bugs in the future.
- Fixes a hard delete involving AI laws. 
- When a malf AI occupies an APC, it creates an APC copy of the AI. This
is an entirely separate mob.
- In creating this copy, it uses the malf AI's current laws for the new
copy's laws. Exactly. The same datum.
- So the copy attempts to associate with the datum, and nothing happens,
but it still assigns it to the copy's laws var.
- When the AI attempts to return to their core from the APC, it deletes
the copy. Which deletes the law datum, which our main Ai still has a
reference too, so hard delete. Womp womp.
- I fixed this by implementing a new proc, `copy_lawset`. The APC copy
now gets a copy of the laws when the shunt happens.
- This is imperfect, as they are two separate law datums now, it means
any law changes to the first will not directly affect the second... I
think. The whole "parent" AI system should cover this in theory? But I
don't know if it actually does? It's quite confusing.
- We should really codify methods of linking lawsets together rather
than the hackiness that cyborgs do currently.

## Changelog

🆑 Melbert
fix: Fixed AIs who shunt to APCs causing their laws to be deleted. 
/🆑
2024-01-25 00:38:50 -08:00
..
2023-12-18 00:58:01 +01:00
2023-12-13 15:52:24 +01:00