Files
Bubberstation/code/modules/projectiles
SkyratBot b267e1922b [MIRROR] Fixes being able to spam ghost role notifications. (#7904)
* Fixes being able to spam ghost role notifications. (#61085)

There are methods that let players spam the everloving shit out of ghosts with BONG BONG BONG BONG BONG BONG BONG etc. through being able to constantly poll ghosts for roles with no restriction or cooldown.

Examples are laughter and slaughter demon antag_spawners.

It makes no sense to be able to concurrently poll for the same mob. As a result, I've now added a guard against this. The proc has been given a static list of mobs it's polling for ghost roles for. If it's already polling for ghost roles for a given mob, then it just early returns with an empty list, otherwise it adds the mob to the static list when the poll starts and removes it when the poll ends.

I've also done a little cleanup in var names and the proc name, with a find-and-replace done. There weren't many things calling it and none used named keywords in the args so should be fine.

There is also poll_candidates_for_mobs (also included in my cleanup) - This proc is basically only called by admins via sentience balloons and they have their own guards against spamming (the balloon pops and thus can only be used once)

Also fixes an issue in /mob/living/silicon/robot/proc/replace_banned_cyborg() where incorrect args were used in the proc call to poll for candidates.

* Fixes being able to spam ghost role notifications.

* a

Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
Co-authored-by: Gandalf <jzo123@hotmail.com>
2021-09-01 17:00:32 +01:00
..