Fixes a runtime with loader modsuits dropping crates (#25727)

* stacking do_afters is the source of all evil

* Update code/modules/mod/modules/modules_supply.dm

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>

---------

Signed-off-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
chuga-git
2024-06-06 14:30:40 -05:00
committed by GitHub
parent 94681fc35f
commit 284cbf6cc9
+5 -1
View File
@@ -58,7 +58,7 @@
if(target_turf.density)
return
playsound(src, 'sound/mecha/hydraulic.ogg', 25, TRUE)
if(!do_after(mod.wearer, load_time, target = target))
if(!do_after(mod.wearer, load_time, target = target, extra_checks = list(CALLBACK(src, TYPE_PROC_REF(/obj/item/mod/module/clamp, should_cancel_drop)))))
return
if(target_turf.density)
return
@@ -86,6 +86,10 @@
return FALSE
return TRUE
/// Checks if the target crate has already been dropped by another on_select_use call
/obj/item/mod/module/clamp/proc/should_cancel_drop()
return !length(stored_crates)
/obj/item/mod/module/clamp/loader
name = "MOD loader hydraulic clamp module"
icon_state = "clamp_loader"