From c30f07f407e80bca4ae9a6eacbd8452d62e89f5d Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Fri, 8 Jun 2018 14:12:21 +0200 Subject: [PATCH] prevent reward gained from fireworks --- main.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.lua b/main.lua index 04f739e..c5d532d 100644 --- a/main.lua +++ b/main.lua @@ -644,7 +644,12 @@ local function doit(dummy) if cfg.decrement_reward and reward_delta == 0 then reward_delta = reward_delta - 1 end - if not ingame_paused then reward = reward + reward_delta end + if not ingame_paused and game.get_state() ~= 'win_walking' then + -- note that we exclude points gained walking into the castle. + -- this way, we avoid adding the timer-based fireworks to our reward, + -- which are basically unwanted noise due to the way they trigger. + reward = reward + reward_delta + end --gui.text(72, 12, ("%+4i"):format(reward_delta), '#FFFFFF', '#0000003F') gui.text(89, 16, ("%+5i"):format(reward), '#FFFFFF', '#0000003F')