From 5af7bb5559ebd5fc67b3f284e13054164b83c2d9 Mon Sep 17 00:00:00 2001
From: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Date: Thu, 2 Oct 2025 19:15:53 +0100
Subject: [PATCH] Atrocinator module stop crashing the servers please (#93141)
## About The Pull Request
Fixes #91448 a high priority issue
Fixes infinite loop causing severe time dilation when using atrocinator
modsuit module while fireman carrying someone - But the underlying code
does need a proper fix.
**How it broke**
1. Atrocinator calls zFall
2. Redirects to carrier
3. Carrier moves
4. Triggers signal on wearer
5. Infinite recursion
6. Server death mass hysteria
**How this fixes it**
- Stops buckling to player while module is active & stops turning on
module if already buckled
**Testing Screenshots**
## Why It's Good For The Game
- Stops lagging the servers to near death
## Changelog
:cl:
fix: Atrocinator modsuit module no longer lets you do a firemans carry
to prevent lag spikes
/:cl:
---------
Co-authored-by: loganuk
---
code/modules/mod/modules/modules_maint.dm | 25 +++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/code/modules/mod/modules/modules_maint.dm b/code/modules/mod/modules/modules_maint.dm
index 2e0b2dba3a0..05c9af1b33d 100644
--- a/code/modules/mod/modules/modules_maint.dm
+++ b/code/modules/mod/modules/modules_maint.dm
@@ -317,10 +317,16 @@
var/you_fucked_up = FALSE
/obj/item/mod/module/atrocinator/on_activation(mob/activator)
+ // Auto-unbuckle anyone being carried to avoid lag issues
+ if(length(mod.wearer.buckled_mobs))
+ mod.wearer.visible_message("As [mod.wearer] flips, [mod.wearer.buckled_mobs[1]] flies off of [mod.wearer.p_their()] back!")
+ mod.wearer.unbuckle_all_mobs()
+
playsound(src, 'sound/effects/curse/curseattack.ogg', 50)
mod.wearer.AddElement(/datum/element/forced_gravity, NEGATIVE_GRAVITY)
RegisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED, PROC_REF(check_upstairs))
RegisterSignal(mod.wearer, COMSIG_MOB_SAY, PROC_REF(on_talk))
+ RegisterSignal(mod.wearer, COMSIG_MOVABLE_PREBUCKLE, PROC_REF(on_someone_buckled))
ADD_TRAIT(mod.wearer, TRAIT_SILENT_FOOTSTEPS, REF(src))
passtable_on(mod.wearer, REF(src))
check_upstairs() //todo at some point flip your screen around
@@ -337,6 +343,7 @@
qdel(mod.wearer.RemoveElement(/datum/element/forced_gravity, NEGATIVE_GRAVITY))
UnregisterSignal(mod.wearer, COMSIG_MOVABLE_MOVED)
UnregisterSignal(mod.wearer, COMSIG_MOB_SAY)
+ UnregisterSignal(mod.wearer, COMSIG_MOVABLE_PREBUCKLE)
step_count = 0
REMOVE_TRAIT(mod.wearer, TRAIT_SILENT_FOOTSTEPS, REF(src))
passtable_off(mod.wearer, REF(src))
@@ -350,6 +357,16 @@
if(you_fucked_up || mod.wearer.has_gravity() > NEGATIVE_GRAVITY)
return
+ // Prevent infinite loops when being fireman carried - Stack trace if it does
+ if(mod.wearer.buckled)
+ stack_trace("Atrocinator user is buckled despite protections - this shouldn't happen!")
+ return
+
+ // Prevent infinite loops when carrying someone - Stack trace if it does
+ if(length(mod.wearer.buckled_mobs))
+ stack_trace("Atrocinator user is carrying someone despite protections - this shouldn't happen!")
+ return
+
var/turf/open/current_turf = get_turf(mod.wearer)
var/turf/open/openspace/turf_above = get_step_multiz(mod.wearer, UP)
if(current_turf && istype(turf_above))
@@ -384,6 +401,14 @@
SIGNAL_HANDLER
speech_args[SPEECH_SPANS] |= "upside_down"
+/// Prevent someone from being buckled to the wearer while atrocinator is active
+/obj/item/mod/module/atrocinator/proc/on_someone_buckled(datum/source, mob/living/buckled_mob, mob/living/buckler)
+ SIGNAL_HANDLER
+ balloon_alert(buckler, "[buckler == mod.wearer ? "you're" : "they're"] upside down!")
+ return COMPONENT_BLOCK_BUCKLE
+
+
+
/obj/item/mod/module/recycler/donk/safe
name = "MOD foam dart recycler module"
desc = "A mod module that collects and repackages fired foam darts into half-sized ammo boxes. \