Skip to content

Commit

Permalink
Fixes Request Console Announcements (#75496)
Browse files Browse the repository at this point in the history
## About The Pull Request

Fixes #75495 and Fixes #75492 (?)

`treat_message` had its arguments changed in #74775 which skewed with
#75067

## Why It's Good For The Game

Bugfix

## Changelog

:cl: Melbert
fix: Request Console Announcements breaking and reporting "/list"
/:cl:
  • Loading branch information
MrMelbert committed May 18, 2023
1 parent c6b291b commit 4a2df9b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion code/game/machinery/requests_console.dm
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ GLOBAL_LIST_EMPTY(req_console_ckey_departments)
return
if(isliving(usr))
var/mob/living/L = usr
message = L.treat_message(message)
message = L.treat_message(message)["message"]

minor_announce(message, "[department] Announcement:", html_encode = FALSE)
GLOB.news_network.submit_article(message, department, "Station Announcements", null)
usr.log_talk(message, LOG_SAY, tag="station announcement from [src]")
Expand Down
7 changes: 6 additions & 1 deletion code/modules/mob/living/living_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,13 @@ GLOBAL_LIST_INIT(message_modes_stat_limits, list(
*
* message - The message to treat.
* capitalize_message - Whether we run capitalize() on the message after we're done.
*
* Returns a list, which is a packet of information corresponding to the message that has been treated, which
* contains the new message, as well as text-to-speech information.
*/
/mob/living/proc/treat_message(message, tts_message, tts_filter, capitalize_message = TRUE)
RETURN_TYPE(/list)

if(HAS_TRAIT(src, TRAIT_UNINTELLIGIBLE_SPEECH))
message = unintelligize(message)

Expand All @@ -457,7 +462,7 @@ GLOBAL_LIST_INIT(message_modes_stat_limits, list(
message = capitalize(message)
tts_message = capitalize(tts_message)

return list(message = message, tts_message = tts_message, tts_filter = tts_filter)
return list("message" = message, "tts_message" = tts_message, "tts_filter" = tts_filter)

/mob/living/proc/radio(message, list/message_mods = list(), list/spans, language)
var/obj/item/implant/radio/imp = locate() in src
Expand Down

0 comments on commit 4a2df9b

Please sign in to comment.