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

This commit is contained in:
ShadowLarkens
2021-04-07 20:58:42 -07:00
parent e40f0b25f1
commit 28b4f95c8b
9 changed files with 35 additions and 53 deletions
+19
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)