Removes code treating actions as a lazy list (#24971)

* this doesn't need to be lazy

* fix some small things
This commit is contained in:
Luc
2024-04-03 10:08:26 -04:00
committed by GitHub
parent 629522d2c7
commit 655d170ae2
3 changed files with 6 additions and 11 deletions
+4 -4
View File
@@ -54,7 +54,7 @@
continue
HideFrom(hud.mymob)
LAZYREMOVE(remove_from?.actions, src) // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared
remove_from?.actions -= src // We aren't always properly inserted into the viewers list, gotta make sure that action's cleared
viewers = list()
// owner = null
@@ -142,7 +142,7 @@
var/datum/hud/our_hud = viewer.hud_used
if(viewers[our_hud]) // Already have a copy of us? go away
return
LAZYOR(viewer.actions, src) // Move this in
viewer.actions |= src // Move this in
ShowTo(viewer)
//Adds our action button to the screen of a player
@@ -168,7 +168,7 @@
/datum/action/proc/HideFrom(mob/viewer)
var/datum/hud/our_hud = viewer.hud_used
var/atom/movable/screen/movable/action_button/button = viewers[our_hud]
LAZYREMOVE(viewer.actions, src)
viewer.actions -= src
if(button)
button.clean_up_keybinds(viewer)
qdel(button)
@@ -193,7 +193,7 @@
if(action == src) // This could be us, which is dumb
continue
var/atom/movable/screen/movable/action_button/button = action.viewers[owner.hud_used]
if(action.name == name && button.id)
if(action.name == name && button?.id)
bitfield |= button.id
bitfield = ~bitfield // Flip our possible ids, so we can check if we've found a unique one