Fixes edge cases revolving who can strip and who can't (#58445)

Fixes all simple mobs being able to strip, as well as being able to strip when your hands are blocked (e.g. cuffed).

Fixes #58260.
This commit is contained in:
Mothblocks
2021-04-16 05:18:07 +01:00
committed by GitHub
parent b45d63b7a7
commit e82a4972cc
9 changed files with 31 additions and 4 deletions
+7 -1
View File
@@ -2,6 +2,7 @@
/proc/default_ui_state(mob/user, atom/source)
return min(
ui_status_user_is_abled(user, source),
ui_status_user_has_free_hands(user, source),
ui_status_user_is_advanced_tool_user(user),
ui_status_only_living(user),
max(
@@ -47,7 +48,12 @@
/proc/ui_status_user_is_abled(mob/user, atom/source)
return user.shared_ui_interaction(source)
/// Returns a UI status such that advanced tool users will be able to update,
/// Returns a UI status such that those without blocked hands will be able to interact,
/// but everyone else can only watch.
/proc/ui_status_user_has_free_hands(mob/user, atom/source)
return HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) ? UI_UPDATE : UI_INTERACTIVE
/// Returns a UI status such that advanced tool users will be able to interact,
/// but everyone else can only watch.
/proc/ui_status_user_is_advanced_tool_user(mob/user)
return ISADVANCEDTOOLUSER(user) ? UI_INTERACTIVE : UI_UPDATE