-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweak: Prevent send multiple messages to same radio channel #24508
Conversation
for(var/obj/O in listening_obj) | ||
spawn(0) // KILL THIS | ||
if(O) // It's possible that it could be deleted in the meantime. | ||
if(isradio(O)) | ||
var/obj/item/radio/radio = O | ||
if(radio.broadcasting && get_dist(radio, M) <= radio.canhear_range && !(radio.frequency in transmited_channels)) | ||
if(radio.talk_into(M, message_pieces, null, verbage)) | ||
transmited_channels += radio.frequency | ||
else | ||
O.hear_talk(M, message_pieces, verbage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for(var/obj/O in listening_obj) | |
spawn(0) // KILL THIS | |
if(O) // It's possible that it could be deleted in the meantime. | |
if(isradio(O)) | |
var/obj/item/radio/radio = O | |
if(radio.broadcasting && get_dist(radio, M) <= radio.canhear_range && !(radio.frequency in transmited_channels)) | |
if(radio.talk_into(M, message_pieces, null, verbage)) | |
transmited_channels += radio.frequency | |
else | |
O.hear_talk(M, message_pieces, verbage) | |
for(var/obj/O in listening_obj) | |
spawn(0) // KILL THIS | |
if(!istype(O)) // It's possible that it could be deleted in the meantime. | |
return | |
if(!isradio(O)) | |
O.hear_talk(M, message_pieces, verbage) | |
return | |
var/obj/item/radio/radio = O | |
if(!radio.broadcasting || get_dist(radio, M) > radio.canhear_range || (radio.frequency in transmited_channels)) | |
return | |
if(radio.talk_into(M, message_pieces, null, verbage)) | |
transmited_channels += radio.frequency | |
Tried to tidy this up, please test to make sure I've not made any mistakes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@S34NW it doesn't work, unfortunately. Message isn't sent to radio channels
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue seems to be that the code returns
, while it should continue
instead, could you try that?
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This pull request seems to be stale as there have been no changes in 14 days, please make changes within 7 days or the PR will be closed. If you believe this is a mistake, please inform a development team member on Discord. |
Not stale |
This pull request seems to be stale as there have been no changes in 14 days, please make changes within 7 days or the PR will be closed. If you believe this is a mistake, please inform a development team member on Discord. |
Gotta close this, can't get onto this PR right now. You can have it, maybe I'll reopen it later. |
What Does This PR Do
Prevents sending multiple messages to same radio channel
Ported from here: ss220-space/Paradise#3337
Why It's Good For The Game
No laging and spam
Images of changes
Testing
Tested in-game
Changelog
NPFC?