From 3c8bd2b1ac831bd77e91bdf64a5d708c46ba7079 Mon Sep 17 00:00:00 2001 From: FlufflesTheDog Date: Thu, 20 Mar 2025 04:02:15 -0700 Subject: [PATCH] Fix del loop in modsuit devices (#90127) ## About The Pull Request When the device of a modsuit module (eg foam mister) is the first thing to be deleted, it causes a del loop runtime. Chain is: - device qdel, hasn't yet run destroy() which would normally move the device to nullspace - signal runs on_device_deletion, destroys the module - module destroy(), calls parent which deletes contents, including the still-deleting device Fixed by moving device to nullspace in on_device_deletion ## Changelog N/A --- code/modules/mod/modules/_module.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/mod/modules/_module.dm b/code/modules/mod/modules/_module.dm index 565919c07ec..2fec22edbc6 100644 --- a/code/modules/mod/modules/_module.dm +++ b/code/modules/mod/modules/_module.dm @@ -330,6 +330,7 @@ SIGNAL_HANDLER if(source == device) + device.moveToNullspace() device = null qdel(src)