From de6a6ac46e792e399d6125d746b7ffa520e7106c Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Fri, 10 Apr 2026 00:50:41 +0200 Subject: [PATCH] Fixes conditionally added actions not appearing on player HUDs (#95624) ## About The Pull Request Fuckup from the refactor, this should give the action to the mob not the owner of the action. Fixes purple raptors, ninja katanas, etc ## Changelog :cl: fix: Fixed conditionally added actions not appearing on player HUDs /:cl: --- code/datums/actions/action.dm | 6 +++--- code/datums/actions/cooldown_action.dm | 2 +- .../simple_animal/hostile/mining_mobs/elites/elite.dm | 2 +- code/modules/wiremod/shell/brain_computer_interface.dm | 2 +- code/modules/wiremod/shell/implant.dm | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/code/datums/actions/action.dm b/code/datums/actions/action.dm index 119a284a16d..688c82eb5b0 100644 --- a/code/datums/actions/action.dm +++ b/code/datums/actions/action.dm @@ -353,7 +353,7 @@ if(!our_hud || viewers[our_hud]) // There's no point in this if you have no hud in the first place return - var/atom/movable/screen/movable/action_button/button = create_button() + var/atom/movable/screen/movable/action_button/button = create_button(viewer) SetId(button, viewer) button.our_hud = our_hud @@ -373,8 +373,8 @@ qdel(button) /// Creates an action button movable for the passed mob, and returns it. -/datum/action/proc/create_button() - var/atom/movable/screen/movable/action_button/button = owner.hud_used.add_screen_object(/atom/movable/screen/movable/action_button) +/datum/action/proc/create_button(mob/viewer) + var/atom/movable/screen/movable/action_button/button = viewer.hud_used.add_screen_object(/atom/movable/screen/movable/action_button) button.linked_action = src button.allow_observer_click = allow_observer_click build_button_icon(button, ALL, TRUE) diff --git a/code/datums/actions/cooldown_action.dm b/code/datums/actions/cooldown_action.dm index 40f4d6be86a..4a830c30c88 100644 --- a/code/datums/actions/cooldown_action.dm +++ b/code/datums/actions/cooldown_action.dm @@ -61,7 +61,7 @@ if(original) create_sequence_actions() -/datum/action/cooldown/create_button() +/datum/action/cooldown/create_button(mob/viewer) var/atom/movable/screen/movable/action_button/button = ..() button.maptext = "" button.maptext_x = 4 diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm index f8fcddc4bc7..7693d47647d 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm @@ -78,7 +78,7 @@ While using this makes the system rely on OnFire, it still gives options for tim ///The internal attack ID for the elite's OpenFire() proc to use var/chosen_attack_num = 0 -/datum/action/innate/elite_attack/create_button() +/datum/action/innate/elite_attack/create_button(mob/viewer) var/atom/movable/screen/movable/action_button/button = ..() button.maptext = "" button.maptext_x = 6 diff --git a/code/modules/wiremod/shell/brain_computer_interface.dm b/code/modules/wiremod/shell/brain_computer_interface.dm index da18d9d6562..126764cfa93 100644 --- a/code/modules/wiremod/shell/brain_computer_interface.dm +++ b/code/modules/wiremod/shell/brain_computer_interface.dm @@ -211,7 +211,7 @@ START_PROCESSING(SSobj, src) -/datum/action/innate/bci_charge_action/create_button() +/datum/action/innate/bci_charge_action/create_button(mob/viewer) var/atom/movable/screen/movable/action_button/button = ..() button.maptext_x = 2 button.maptext_y = 0 diff --git a/code/modules/wiremod/shell/implant.dm b/code/modules/wiremod/shell/implant.dm index 1f2e9016c71..409c1921c6f 100644 --- a/code/modules/wiremod/shell/implant.dm +++ b/code/modules/wiremod/shell/implant.dm @@ -199,7 +199,7 @@ START_PROCESSING(SSobj, src) -/datum/action/innate/implant_charge_action/create_button() +/datum/action/innate/implant_charge_action/create_button(mob/viewer) var/atom/movable/screen/movable/action_button/button = ..() button.maptext_x = 2 button.maptext_y = 0