From 3840c66edb3a6c02a8a6dc59f7d5825cb7dd7461 Mon Sep 17 00:00:00 2001 From: Chris Angelico Date: Mon, 23 Oct 2023 12:54:14 +1100 Subject: [PATCH] pointsmgr: Avoid spawning a task if there are no dynamics at all --- modules/pointsmgr.pike | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/pointsmgr.pike b/modules/pointsmgr.pike index 03eae952..d3915f17 100644 --- a/modules/pointsmgr.pike +++ b/modules/pointsmgr.pike @@ -117,6 +117,7 @@ continue Concurrent.Future update_all_rewards(object channel) { @hook_variable_changed: void notify_rewards(object channel, string varname, string newval) { //TODO: Figure out which rewards might have changed (ie which are affected by //the variable that changed) and update only those. + if (channel->config->dynamic_rewards) return; if (pending_update_alls[channel->userid]) return; //If multiple variables are updated all at once, do just one batch of updates at the end pending_update_alls[channel->userid] = 1; call_out(spawn_task, 0, update_all_rewards(channel));