Skip to content

Commit

Permalink
[PORT] Soapbox component fixes (#3318)
Browse files Browse the repository at this point in the history
* Fixes soapbox hard dels (#85044)

## About The Pull Request


![firefox_P8rmiESgN1](https://github.com/user-attachments/assets/1c8b565f-3b3d-4264-b35a-79d1d056deaf)

Fixes this recently introduced hard del.

## Why It's Good For The Game

Spurious runtimes bgone.

## Changelog

:cl:
fix: fixed a hard del with soapboxes
/:cl:

* Fixes soapbox component sometimes runtiming roundstart due to not unregistering signals (#85937)

## About The Pull Request

sometimes runtimed due to reassigning signals and it has been driving me
insane

## Changelog
:cl:
fix: Fixed soapbox component sometimes runtiming roundstart
/:cl:

* kill me now

---------

Co-authored-by: Bloop <[email protected]>
Co-authored-by: SmArtKar <[email protected]>
  • Loading branch information
3 people authored Sep 13, 2024
1 parent 1c3a24d commit b6ae700
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code/datums/components/soapbox.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Gives atoms moving over us the soapbox speech and takes it away when they leave
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_loc_entered),
COMSIG_ATOM_EXITED = PROC_REF(on_loc_exited)
COMSIG_ATOM_EXITED = PROC_REF(on_loc_exited),
)

/datum/component/soapbox/Initialize(...)
Expand All @@ -16,6 +16,8 @@
///Applies loud speech to our movable when entering the turf our parent is on
/datum/component/soapbox/proc/on_loc_entered(datum/source, atom/movable/soapbox_arrive)
SIGNAL_HANDLER
if(QDELETED(soapbox_arrive) || (soapbox_arrive in soapboxers))
return
RegisterSignal(soapbox_arrive, COMSIG_MOB_SAY, PROC_REF(soapbox_speech))
soapboxers += soapbox_arrive

Expand All @@ -31,7 +33,7 @@
SIGNAL_HANDLER
for(var/atom/movable/loud as anything in soapboxers)
UnregisterSignal(loud, COMSIG_MOB_SAY)
soapboxers = list()
soapboxers.Cut()

///Gives a mob a unique say span
/datum/component/soapbox/proc/soapbox_speech(datum/source, list/speech_args)
Expand Down

0 comments on commit b6ae700

Please sign in to comment.