Skip to content

Commit

Permalink
Merge pull request #3455 from TalkingCactus/hmmmm
Browse files Browse the repository at this point in the history
removes another source of green ghosts
  • Loading branch information
Tk420634 authored Oct 16, 2023
2 parents 6285c57 + 23aaec2 commit a61961f
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
layer = HUD_LAYER
plane = HUD_PLANE

/atom/movable/screen/inventory/proc/ClearGhosts()
cut_overlays()
QDEL_NULL(object_overlay)

/atom/movable/screen/inventory/Click(location, control, params)
if(hud?.mymob && (hud.mymob != usr))
return
Expand All @@ -116,9 +120,7 @@
if(usr.attack_ui(slot_id))
usr.update_inv_hands()
//Remove the green object overlay since we never had a chance to use MouseExited(). Also removes the red one, but that's okay.
if(object_overlay)
cut_overlay(object_overlay)
QDEL_NULL(object_overlay)
ClearGhosts()
return TRUE

/atom/movable/screen/inventory/MouseEntered()
Expand All @@ -127,8 +129,7 @@

/atom/movable/screen/inventory/MouseExited()
..()
cut_overlay(object_overlay)
QDEL_NULL(object_overlay)
ClearGhosts()

/atom/movable/screen/inventory/update_icon_state()
if(!icon_empty)
Expand All @@ -142,9 +143,6 @@

/atom/movable/screen/inventory/update_icon()
. = ..()
if(object_overlay)
cut_overlay(object_overlay)
QDEL_NULL(object_overlay)

/atom/movable/screen/inventory/proc/add_overlays()
var/mob/user = hud?.mymob
Expand All @@ -165,7 +163,7 @@
else
item_overlay.color = "#00ff00"

cut_overlay(object_overlay)
ClearGhosts()
object_overlay = item_overlay
add_overlay(object_overlay)

Expand Down

0 comments on commit a61961f

Please sign in to comment.