mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
Removes message arg from Hear, free performance (#93020)
## About The Pull Request The first argument of `Hear` is `message`, the message heard OR SO YOU'D THINK Actually the first argument doesn't do anything but get overridden by ALL implementations of `Hear` No other uses as far as I and Ephe can tell. Removing it makes it a ton easier to understand and gives us some free performance in radio code by not rendering messages twice ## Changelog 🆑 Melbert code: Removed some redundant code from core hearing code. Report if you hear anything weird. /🆑
This commit is contained in:
@@ -125,9 +125,6 @@
|
||||
/datum/unit_test/speech/proc/handle_hearing(datum/source, list/hearing_args)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
// So it turns out that the `message` arg for COMSIG_MOVABLE_HEAR is super redundant and should probably
|
||||
// be gutted out of both the Hear() proc and signal since it's never used
|
||||
//TEST_ASSERT(hearing_args[HEARING_MESSAGE], "Handle hearing signal does not have a message arg")
|
||||
TEST_ASSERT(hearing_args[HEARING_SPEAKER], "Handle hearing signal does not have a speaker arg")
|
||||
TEST_ASSERT(hearing_args[HEARING_LANGUAGE], "Handle hearing signal does not have a language arg")
|
||||
TEST_ASSERT(hearing_args[HEARING_RAW_MESSAGE], "Handle hearing signal does not have a raw message arg")
|
||||
@@ -166,7 +163,7 @@
|
||||
var/datum/client_interface/mock_client = new()
|
||||
listener.mock_client = mock_client
|
||||
|
||||
RegisterSignal(speaker, COMSIG_MOB_SAY, PROC_REF(handle_speech)) //
|
||||
RegisterSignal(speaker, COMSIG_MOB_SAY, PROC_REF(handle_speech))
|
||||
RegisterSignal(speaker_radio, COMSIG_RADIO_NEW_MESSAGE, PROC_REF(handle_radio_hearing))
|
||||
|
||||
RegisterSignal(listener, COMSIG_MOVABLE_HEAR, PROC_REF(handle_hearing))
|
||||
|
||||
Reference in New Issue
Block a user