Skip to content

Commit

Permalink
Fixes Ghosts Haunting People's Bags (#2421)
Browse files Browse the repository at this point in the history
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may
not be viewable. -->
<!-- You can view Contributing.MD for a detailed description of the pull
request process. -->

## About The Pull Request
Should fix issue #2417 and the related issue of opening sounds playing
twice when alt + clicking them.

<!-- Describe The Pull Request. Please be sure every change is
documented or this can delay review and even discourage maintainers from
merging your PR! -->

## Why It's Good For The Game
As incredibly funny as it is to haunt people as a ghost, it's probably
not overall good for the dead to be able to interact with the living.

<!-- Please add a short description of why you think these changes would
benefit the game. If you can't justify it in words, it might not be
worth adding. -->

## Changelog

:cl:
fix: ghosts playing container sounds
fix: some container sounds playing twice
/:cl:

<!-- Both :cl:'s are required for the changelog to work! You can put
your name to the right of the first :cl: if you want to overwrite your
GitHub username as author ingame. -->
<!-- You can use multiple of the same prefix (they're only used for the
icon ingame) and delete the unneeded ones. Despite some of the tags,
changelogs should generally represent how a player might be affected by
the changes rather than a summary of the PR's contents. -->
  • Loading branch information
BogCreature authored Oct 26, 2023
1 parent 2a74c23 commit 890e1c5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions code/datums/components/storage/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
return
A.add_fingerprint(M)

/datum/component/storage/proc/user_show_to_mob(mob/M, force = FALSE)
/datum/component/storage/proc/user_show_to_mob(mob/M, force = FALSE, silent = FALSE)
var/atom/A = parent
if(!istype(M))
return FALSE
Expand All @@ -613,7 +613,7 @@
to_chat(M, "<span class='warning'>[parent] seems to be [locked_flavor]!</span>")
return FALSE
if(force || M.CanReach(parent, view_only = TRUE))
if(use_sound)
if(use_sound && !silent)
playsound(A, use_sound, 50, TRUE, -5)
show_to(M)

Expand Down Expand Up @@ -739,7 +739,7 @@
/datum/component/storage/proc/show_to_ghost(datum/source, mob/dead/observer/M)
SIGNAL_HANDLER

return user_show_to_mob(M, TRUE)
return user_show_to_mob(M, TRUE, TRUE)

/datum/component/storage/proc/signal_show_attempt(datum/source, mob/showto, force = FALSE)
SIGNAL_HANDLER
Expand Down Expand Up @@ -866,8 +866,6 @@
if(!quickdraw)
A.add_fingerprint(user)
user_show_to_mob(user)
if(use_sound)
playsound(A, use_sound, 50, TRUE, -5)
return

var/obj/item/I = locate() in real_location()
Expand Down

0 comments on commit 890e1c5

Please sign in to comment.