diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 4059b7d0ff..58b74e5369 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -144,6 +144,9 @@ #define TRAIT_EXEMPT_HEALTH_EVENTS "exempt-health-events" // mobility flag traits +// IN THE FUTURE, IT WOULD BE NICE TO DO SOMETHING SIMILAR TO https://github.com/tgstation/tgstation/pull/48923/files (ofcourse not nearly the same because I have my.. thoughts on it) +// BUT FOR NOW, THESE ARE HOOKED TO DO update_mobility() VIA COMSIG IN living_mobility.dm +// SO IF YOU ADD MORE, BESURE TO UPDATE IT THERE. /// Disallow movement #define TRAIT_MOBILITY_NOMOVE "mobility_nomove" diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm index 0239c15179..6f3200dc26 100644 --- a/code/modules/mob/living/living_mobility.dm +++ b/code/modules/mob/living/living_mobility.dm @@ -1,3 +1,11 @@ +/// IN THE FUTURE, WE WILL PROBABLY REFACTOR TO LESSEN THE NEED FOR UPDATE_MOBILITY, BUT FOR NOW.. WE CAN START DOING THIS. +/// FOR BLOCKING MOVEMENT, USE TRAIT_MOBILITY_NOMOVE AS MUCH AS POSSIBLE. IT WILL MAKE REFACTORS IN THE FUTURE EASIER. +/mob/living/ComponentInitialize() + . = ..() + RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOMOVE), .proc/update_mobility) + RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOPICKUP), .proc/update_mobility) + RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOUSE), .proc/update_mobility) + //Stuff like mobility flag updates, resting updates, etc. //Force-set resting variable, without needing to resist/etc. @@ -14,7 +22,7 @@ //Force mob to rest, does NOT do stamina damage. //It's really not recommended to use this proc to give feedback, hence why silent is defaulting to true. /mob/living/proc/KnockToFloor(disarm_items = FALSE, silent = TRUE, updating = TRUE) - if(!silent) + if(!silent && !resting) to_chat(src, "You are knocked to the floor!") set_resting(TRUE, TRUE, updating) if(disarm_items)