mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user