From 19d6466f3a5be342f5afa8e228995e5bcb359563 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 18 Mar 2024 00:22:25 +0100 Subject: [PATCH] [MIRROR] Abilities with no owner control isnt given to ghosts (#26926) * Abilities with no owner control isnt given to ghosts (#82037) ## About The Pull Request Actions that don't give the user control (so don't give them an action button) will now no longer give them to ghosts either. Ghosts should see the same information as the player when observing them. They don't need to see guardian's protection mode and bileworm's spitting, for example. ## Why It's Good For The Game Explained in the about the pull request already, ghosts should have the same information as the player they are orbiting, not see the hidden actions. It makes it annoying for contributors to have to manually set every ability meant to not be seen by players to also not be seen by ghosts. ## Changelog :cl: fix: Action abilities hidden from players are now not shown to observers either. /:cl: * Abilities with no owner control isnt given to ghosts --------- Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com> --- code/_onclick/hud/action_button.dm | 4 ++-- .../mob/living/basic/guardian/guardian_types/protector.dm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/_onclick/hud/action_button.dm b/code/_onclick/hud/action_button.dm index 92defc66101..9d4343c132e 100644 --- a/code/_onclick/hud/action_button.dm +++ b/code/_onclick/hud/action_button.dm @@ -230,7 +230,7 @@ return for(var/datum/action/action as anything in take_from.actions) - if(!action.show_to_observers) + if(!action.show_to_observers || !action.owner_has_control) continue action.GiveAction(src) RegisterSignal(take_from, COMSIG_MOB_GRANTED_ACTION, PROC_REF(on_observing_action_granted)) @@ -251,7 +251,7 @@ /mob/proc/on_observing_action_granted(mob/living/source, datum/action/action) SIGNAL_HANDLER - if(!action.show_to_observers) + if(!action.show_to_observers || !action.owner_has_control) return action.GiveAction(src) diff --git a/code/modules/mob/living/basic/guardian/guardian_types/protector.dm b/code/modules/mob/living/basic/guardian/guardian_types/protector.dm index 27ec9cace81..a7a9e718e54 100644 --- a/code/modules/mob/living/basic/guardian/guardian_types/protector.dm +++ b/code/modules/mob/living/basic/guardian/guardian_types/protector.dm @@ -16,7 +16,6 @@ /mob/living/basic/guardian/protector/Initialize(mapload, datum/guardian_fluff/theme) . = ..() shield = new(src) - shield.owner_has_control = FALSE // Hide it from the user, it's integrated with guardian UI shield.Grant(src) /mob/living/basic/guardian/protector/Destroy() @@ -49,6 +48,7 @@ background_icon_state = "base" cooldown_time = 1 SECONDS click_to_activate = FALSE + owner_has_control = FALSE // Hide it from the user, it's integrated with guardian UI /datum/action/cooldown/mob_cooldown/protector_shield/Activate(mob/living/target) if (!isliving(target))