Make unnatural resizing even better and more efficient with the power of DCS™️

This commit is contained in:
Chompstation Bot
2021-04-08 15:15:21 +00:00
parent 23af41589b
commit 6ce0b7ee4e
9 changed files with 169 additions and 5 deletions

View File

@@ -0,0 +1,19 @@
/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/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)
qdel(src)