mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
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** <img width="181" height="179" alt="image" src="https://github.com/user-attachments/assets/e92495f6-6b5c-44cf-854f-bb6ea8ae823d" /> <img width="262" height="220" alt="image" src="https://github.com/user-attachments/assets/592dc6b8-4c92-4835-9092-b52983ea1eb4" /> <img width="617" height="45" alt="image" src="https://github.com/user-attachments/assets/2590c435-deed-4593-8ad8-eb7a95929079" /> <img width="355" height="192" alt="image" src="https://github.com/user-attachments/assets/20f8a950-78da-4b8f-a70b-c1587942dbed" /> ## Why It's Good For The Game - Stops lagging the servers to near death ## Changelog 🆑 fix: Atrocinator modsuit module no longer lets you do a firemans carry to prevent lag spikes /🆑 --------- Co-authored-by: loganuk <falseemail@aol.com>
This commit is contained in:
@@ -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. \
|
||||
|
||||
Reference in New Issue
Block a user