Files
CHOMPStation2/code/datums/components/resize_guard.dm
CHOMPStation2 9da5f59dc2 [MIRROR] >200% size exploit (#8515)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: CHOMPStation2 <chompsation2@gmail.com>
2024-06-11 21:52:50 +02:00

20 lines
606 B
Plaintext

/datum/component/resize_guard
/datum/component/resize_guard/Initialize()
if(!isliving(parent))
return COMPONENT_INCOMPATIBLE
/datum/component/resize_guard/RegisterWithParent()
// When our parent mob enters any atom, we check resize
RegisterSignal(parent, COMSIG_ATOM_ENTERING, PROC_REF(check_resize))
/datum/component/resize_guard/UnregisterFromParent()
UnregisterSignal(parent, COMSIG_ATOM_ENTERING)
/datum/component/resize_guard/proc/check_resize()
var/area/A = get_area(parent)
if(A?.limit_mob_size)
var/mob/living/L = parent
L.resize(L.size_multiplier, ignore_prefs = TRUE)
qdel(src)