Corpses with clients in them can no longer perform mech actions (#88959)

## About The Pull Request

Turns out most mech actions only cared about the person attempting to
use them being inside the mech, without checking for things such as the
mob being alive. This fixes that, but required a slight refactoring to
the `ui_status` proc of mechs to account for the three fundamentally
different types of mobs that can pilot a mech.

## Why It's Good For The Game

Fixes #88933

## Changelog

🆑
fix: Corpses at the pilot seat of mechs can no longer toggle the lights,
safeties, cabin sealing, strafing, overclocking, or durand shields, nor
can they rename the mech or configure its equipment.
/🆑
This commit is contained in:
Y0SH1M4S73R
2025-01-14 09:50:03 -05:00
committed by GitHub
parent 81d2e97104
commit 7fe8f29fdb
10 changed files with 74 additions and 25 deletions
+11 -1
View File
@@ -50,7 +50,9 @@
/// 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)
/proc/ui_status_user_has_free_hands(mob/user, atom/source, allowed_source)
if(allowed_source)
return HAS_TRAIT_NOT_FROM(user, TRAIT_HANDS_BLOCKED, allowed_source) ? UI_UPDATE : UI_INTERACTIVE
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,
@@ -110,3 +112,11 @@
return UI_CLOSE
return UI_INTERACTIVE
/// Return UI_INTERACTIVE if the user is inside the target atom, whether they can see it or not.
/// Return UI_CLOSE otherwise.
/proc/ui_status_user_inside(mob/user, atom/target)
if(target.contains(user))
return UI_INTERACTIVE
return UI_CLOSE