From db27bb7727e9fa7448cbe99b60ace38c88137b5f Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Sun, 8 Jan 2017 06:58:56 -0800 Subject: [PATCH] Throttles preferences hrefs The user will not be allowed to trigger a click on a preferences href until their previous one has finished. rshoe is using it spam us. I know somebody was talking about trying to do a more proper fix, such as by making it not re-generate these when it's the same, so i'll test merge this until 24 hours or they make such a pr. --- code/modules/client/client_procs.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 2659694a912..7ce149b4fdf 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -19,6 +19,7 @@ If you have any questions about this stuff feel free to ask. ~Carn */ /client/Topic(href, href_list, hsrc) + var/static/inprefs = FALSE if(!usr || usr != mob) //stops us calling Topic for somebody else's client. Also helps prevent usr=null return // asset_cache @@ -45,7 +46,12 @@ if("usr") hsrc = mob if("prefs") - return prefs.process_link(usr,href_list) + if (inprefs) + return + inprefs = TRUE + . = prefs.process_link(usr,href_list) + inprefs = FALSE + return if("vars") return view_var_Topic(href,href_list,hsrc)